Search Results

Search found 8379 results on 336 pages for 'article'.

Page 15/336 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Link form correct, or, punishable by search engines?

    - by w0rldart
    I have the following dilemma with the links of a wordpress blog that I work with, I don't know if the way it creates the link to the images is ok or not so good. For example: Article URL: http://test.com/prima-de-riesgo/ Image URL belonging to the article: http://test.com/prima-de-riesgo/europa/ So what I'm worried about is the repeating "prima-de-riesgo" part. Should I, or shouldn't I? UPDATE Wow, I can't believe that you took test.com as for the real domain, hehe! Article URL: http://queaprendemoshoy.com/prima-de-riesgo-y-otras-graficas-interesantes-del-ano-2011-deuda-publica-pib-vs-empleo-y-precio-del-oro/ Image URL belonging to the article: http://queaprendemoshoy.com/prima-de-riesgo-y-otras-graficas-interesantes-del-ano-2011-deuda-publica-pib-vs-empleo-y-precio-del-oro/deuda-publica-eurozona/ So, as I mentioned... I'm worried that prima-de-riesgo-y-otras-graficas-interesantes-del-ano-2011-deuda-publica-pib-vs-empleo-y-precio-del-oro , the common factor for the article url and image url, can be considerate as duplicate content or anything that could be punishable by search engines

    Read the article

  • linq to sql -> join

    - by ile
    SQL query: SELECT ArticleCategories.Title AS Category, Articles.Title, Articles.[Content], Articles.Date FROM ArticleCategories INNER JOIN Articles ON ArticleCategories.CategoryID = Articles.CategoryID Object repository: public class ArticleRepository { private DB db = new DB(); // // Query Methods public IQueryable<Article> FindAllArticles() { var result = from category in db.ArticleCategories join article in db.Articles on category.CategoryID equals article.CategoryID select new { CategoryID = category.CategoryID, CategoryTitle = category.Title, ArticleID = article.ArticleID, ArticleTitle = article.Title, ArticleDate = article.Date, ArticleContent = article.Content }; return result; } .... } And finally, I get this error: Error 1 Cannot implicitly convert type 'System.Linq.IQueryable' to 'System.Linq.IQueryable'. An explicit conversion exists (are you missing a cast?) C:\Documents and Settings\ilija\My Documents\Visual Studio 2008\Projects\CMS\CMS\Models\ArticleRepository.cs 29 20 CMS Any idea what did I do wrong? Thanks, Ile

    Read the article

  • mvc2 validation problem (ambiguous reference between model and models)

    - by ile
    I followed instructions for mvc validation but I can't manage to solve this problem.... This is linq to sql model: I set Entity namespace to be CMS.Model If I try to declare partial class Article in Portal.Models namespace: public partial class Article { .... } Then, after using Article article somewhere in code I get following error: 'Article' is an ambiguous reference between 'Portal.Models.Article' and 'CMS.Model.Article' Portal is project name and CMS is area.... I followed these instructions I aslo created NerdDinner from scratch and in that example validation works. I can't figure out what am I doing wrong... someone noticed my mistake? Is it related with giving name to Entity namespace (in tutorial they used default one) Thanks in advance! PS I'd like to note that I'm c# newbie so I'm not really familiar with these partial classes

    Read the article

  • Html.ActionLink in Partial View

    - by olst
    Hi. I am using the following code in my master page: <% Html.RenderAction("RecentArticles","Article"); %> where the RecentArticles Action (in ArticleController) is : [ChildActionOnly] public ActionResult RecentArticles() { var viewData = articleRepository.GetRecentArticles(3); return PartialView(viewData); } and the code in my RecentArticles.ascx partial view : <li class="title"><span><%= Html.ActionLink(article.Title, "ViewArticle", new { controller = "Article", id = article.ArticleID, path = article.Path })%></span></li> The problem is that all the links of the articles (which is built in the partial view) lead to the same url- "~/Article/ViewArticle" . I want each title link to lead to the specific article with the parameters like I'm setting in the partial view. Thanks.

    Read the article

  • django admin gives warning "Field 'X' doesn't have a default value"

    - by noam
    I have created two models out of an existing legacy DB , one for articles and one for tags that one can associate with articles: class Article(models.Model): article_id = models.AutoField(primary_key=True) text = models.CharField(max_length=400) class Meta: db_table = u'articles' class Tag(models.Model): tag_id = models.AutoField(primary_key=True) tag = models.CharField(max_length=20) article=models.ForeignKey(Article) class Meta: db_table = u'article_tags' I want to enable adding tags for an article from the admin interface, so my admin.py file looks like this: from models import Article,Tag from django.contrib import admin class TagInline(admin.StackedInline): model = Tag class ArticleAdmin(admin.ModelAdmin): inlines = [TagInline] admin.site.register(Article,ArticleAdmin) The interface looks fine, but when I try to save, I get: Warning at /admin/webserver/article/382/ Field 'tag_id' doesn't have a default value

    Read the article

  • An Overview of Batch Processing in Java EE 7

    - by Janice J. Heiss
    Up on otn/java is a new article by Oracle senior software engineer Mahesh Kannan, titled “An Overview of Batch Processing in Java EE 7.0,” which explains the new batch processing capabilities provided by JSR 352 in Java EE 7. Kannan explains that “Batch processing is used in many industries for tasks ranging from payroll processing; statement generation; end-of-day jobs such as interest calculation and ETL (extract, load, and transform) in a data warehouse; and many more. Typically, batch processing is bulk-oriented, non-interactive, and long running—and might be data- or computation-intensive. Batch jobs can be run on schedule or initiated on demand. Also, since batch jobs are typically long-running jobs, check-pointing and restarting are common features found in batch jobs.” JSR 352 defines the programming model for batch applications plus a runtime to run and manage batch jobs. The article covers feature highlights, selected APIs, the structure of Job Scheduling Language, and explains some of the key functions of JSR 352 using a simple payroll processing application. The article also describes how developers can run batch applications using GlassFish Server Open Source Edition 4.0. Kannan summarizes the article as follows: “In this article, we saw how to write, package, and run simple batch applications that use chunk-style steps. We also saw how the checkpoint feature of the batch runtime allows for the easy restart of failed batch jobs. Yet, we have barely scratched the surface of JSR 352. With the full set of Java EE components and features at your disposal, including servlets, EJB beans, CDI beans, EJB automatic timers, and so on, feature-rich batch applications can be written fairly easily.” Check out the article here.

    Read the article

  • How to Manage Technical Employees

    - by Ajarn Mark Caldwell
    In my current position as Software Engineering Manager I have been through a lot of ups and downs with staffing, ranging from laying-off everyone who was on my team as we went through the great economic downturn in 2007-2008, to numerous rounds of interviewing and hiring contractors, full-time employees, and converting some contractors to employee status.  I have not yet blogged much about my experiences, but I plan to do that more in the next few months.  But before I do that, let me point you to a great article that somebody else wrote on The Unspoken Truth About Managing Geeks that really hits the target.  If you are a non-technical person who manages technical employees, you definitely have to read that article.  And if you are a technical person who has been promoted into management, this article can really help you do your job and communicate up the line of command about your team.  When you move into management with all the new and different demands put on you, it is easy to forget how things work in the tech subculture, and to lose touch with your team.  This article will help you remember what’s going on behind the scenes and perhaps explain why people who used to get along great no longer are, or why things seem to have changed since your promotion. I have to give credit to Andy Leonard (blog | twitter) for helping me find that article.  I have been reading his series of ramble-rants on managing tech teams, and the above article is linked in the first rant in the series, entitled Goodwill, Negative and Positive.  I have read a handful of his entries in this series and so far I pretty much agree with everything he has said, so of course I would encourage you to read through that series, too.

    Read the article

  • Displaying a Paged Grid of Data in ASP.NET MVC

    This article demonstrates how to display a paged grid of data in an ASP.NET MVC application and builds upon the work done in two earlier articles: Displaying a Grid of Data in ASP.NET MVC and Sorting a Grid of Data in ASP.NET MVC. Displaying a Grid of Data in ASP.NET MVC started with creating a new ASP.NET MVC application in Visual Studio, then added the Northwind database to the project and showed how to use Microsoft's Linq-to-SQL tool to access data from the database. The article then looked at creating a Controller and View for displaying a list of product information (the Model). Sorting a Grid of Data in ASP.NET MVC enhanced the application by adding a view-specific Model (ProductGridModel) that provided the View with the sorted collection of products to display along with sort-related information, such as the name of the database column the products were sorted by and whether the products were sorted in ascending or descending order. The Sorting a Grid of Data in ASP.NET MVC article also walked through creating a partial view to render the grid's header row so that each column header was a link that, when clicked, sorted the grid by that column. In this article we enhance the view-specific Model (ProductGridModel) to include paging-related information to include the current page being viewed, how many records to show per page, and how many total records are being paged through. Next, we create an action in the Controller that efficiently retrieves the appropriate subset of records to display and then complete the exercise by building a View that displays the subset of records and includes a paging interface that allows the user to step to the next or previous page, or to jump to a particular page number, we create and use a partial view that displays a numeric paging interface Like with its predecessors, this article offers step-by-step instructions and includes a complete, working demo available for download at the end of the article. Read on to learn more! Read More >

    Read the article

  • mod_rewrite and SEO friendliness

    - by John Doe
    My website has an atypical structure and I'm not sure if this could create problems in the long run, specially for SEO positioning purposes. I have a unique, large PHP script, and I use the Apache module mod_rewrite in the .htaccess file to create friendly URLs, for example: RewriteRule ^$ /index.php?section=Main RewriteRule ^createArticle$ /index.php?section=Main&view=CreateArticle RewriteRule ^configuration$ /index.php?section=Configuration RewriteRule ^article/([0-9]{1,10})$ /index.php?section=Article&view=Default&id=$1 RewriteRule ^deleteArticle/([0-9]{1,10})$ /index.php?section=Article&view=Delete&id=$1 RewriteRule ^reportArticle/([0-9]{1,10})$ /index.php?section=Article&view=Report&id=$1 RewriteRule ^logIn$ /index.php?section=Authentication ... So, www.example.com/index.php?section=Article&view=Default&id=105 would become www.example.com/article/105. The only real physical file is index.php, in which the parameters of the URL queried is processed and the corresponding result is outputted. My question is, do the crawling robots (e.g. Googlebot) recognize these links? Do they index the resulting HTML outputted by index.php with the specified parameters as if it was a actual HTML file? Also, would this become a problem when creating a Sitemap?

    Read the article

  • fluent nhibernate one to many mapping

    - by Sammy
    I am trying to figure out what I thought was just a simple one to many mapping using fluent Nhibernate. I hoping someone can point me to the right directory to achieve this one to many relations I have an articles table and a categories table Many Articles can only belong to one Category Now my Categores table has 4 Categories and Articles has one article associated with cateory1 here is my setup. using FluentNHibernate.Mapping; using System.Collections; using System.Collections.Generic; namespace FluentMapping { public class Article { public virtual int Id { get; private set; } public virtual string Title { get; set; } public virtual Category Category{get;set;} } public class Category { public virtual int Id { get; private set; } public virtual string Description { get; set; } public virtual IList<Article> Articles { get; set; } public Category() { Articles=new List<Article>(); } public virtual void AddArticle(Article article) { article.Category = this; Articles.Add(article); } public virtual void RemoveArticle(Article article) { Articles.Remove(article); } } public class ArticleMap:ClassMap<Article> { public ArticleMap() { Table("Articles"); Id(x => x.Id).GeneratedBy.Identity(); Map(x => x.Title); References(x => x.Category).Column("CategoryId").LazyLoad(); } public class CategoryMap:ClassMap<Category> { public CategoryMap() { Table("Categories"); Id(x => x.Id).GeneratedBy.Identity(); Map(x => x.Description); HasMany(x => x.Articles).KeyColumn("CategoryId").Fetch.Join(); } } } } if I run this test [Fact] public void Can_Get_Categories() { using (var session = SessionManager.Instance.Current) { using (var transaction = session.BeginTransaction()) { var categories = session.CreateCriteria(typeof(Category)) //.CreateCriteria("Articles").Add(NHibernate.Criterion.Restrictions.EqProperty("Category", "Id")) .AddOrder(Order.Asc("Description")) .List<Category>(); } } } I am getting 7 Categories due to Left outer join used by Nhibernate any idea what I am doing wrong in here? Thanks [Solution] After a couple of hours reading nhibernate docs I here is what I came up with var criteria = session.CreateCriteria(typeof (Category)); criteria.AddOrder(Order.Asc("Description")); criteria.SetResultTransformer(new DistinctRootEntityResultTransformer()); var cats1 = criteria.List<Category>(); Using Nhibernate linq provider var linq = session.Linq<Category>(); linq.QueryOptions.RegisterCustomAction(c => c.SetResultTransformer(new DistinctRootEntityResultTransformer())); var cats2 = linq.ToList();

    Read the article

  • Save Links for Later Reading in Firefox

    - by Asian Angel
    Do you want a simple way to save and manage links for reading later? The Save-To-Read extension for Firefox makes it easy to do without an account. Using Save-To-Read As soon as you install the extension you will notice two new additions to your UI. You will see a small plus sign in the address bar and a new toolbar button (opens and closes the sidebar shown here). Your bookmarks menu will also have a new folder entry. For our example we chose to save three pages for later reading. Each time you want to save a website click on the small plus sign, and it is automatically added to your read later list. Our second article… And finally the third article. Notice that the small plus sign has become a minus sign after adding the article to our list. Opening the sidebar shows our three entries waiting to be read. Checking the bookmarks menu shows the same articles available there. When you are ready to read your articles simply click on the link in the sidebar, bookmarks menu, etc. Notice that the entry is still available at the moment…there are no automatic deletions until you are finished with an article. This is great if you accidentally click the wrong link before you are ready for it. Removing an article from the list is as simple as clicking on the address bar minus sign. It will revert to a plus sign and the entry is no longer visible in your list. For those who want to avoid using a sidebar there is a different toolbar button available too. The alternate toolbar button provides access to a drop-down article list. Choose the access style that best suits your needs. Preferences The preferences are simple to work with and focus on appearance/ease-of-use. Conclusion If you have been looking for a simpler alternative to other “read later” extensions, then Save-To-Read could be just what you have been waiting for. Another cool option for reading posts later, even on eReaders, then check out our article on saving articles to read later with Instapaper. Links Download the Save-To-Read extension (Mozilla Add-ons) Similar Articles Productive Geek Tips Save Pages for Later With Reading List Extension for FirefoxInstall Adobe PDF Reader on Ubuntu EdgyQuick Hits: 11 Firefox Tab How-TosSave Webpage Links & URLs as Files in FirefoxQuick Tip: Save Windows and Tabs When Restarting Firefox TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips HippoRemote Pro 2.2 Xobni Plus for Outlook All My Movies 5.9 CloudBerry Online Backup 1.5 for Windows Home Server TubeSort: YouTube Playlist Organizer XPS file format & XPS Viewer Explained Microsoft Office Web Apps Guide Know if Someone Accessed Your Facebook Account Shop for Music with Windows Media Player 12 Access Free Documentaries at BBC Documentaries

    Read the article

  • What algorithms can I use to detect if articles or posts are duplicates?

    - by michael
    I'm trying to detect if an article or forum post is a duplicate entry within the database. I've given this some thought, coming to the conclusion that someone who duplicate content will do so using one of the three (in descending difficult to detect): simple copy paste the whole text copy and paste parts of text merging it with their own copy an article from an external site and masquerade as their own Prepping Text For Analysis Basically any anomalies; the goal is to make the text as "pure" as possible. For more accurate results, the text is "standardized" by: Stripping duplicate white spaces and trimming leading and trailing. Newlines are standardized to \n. HTML tags are removed. Using a RegEx called Daring Fireball URLs are stripped. I use BB code in my application so that goes to. (ä)ccented and foreign (besides Enlgish) are converted to their non foreign form. I store information about each article in (1) statistics table and in (2) keywords table. (1) Statistics Table The following statistics are stored about the textual content (much like this post) text length letter count word count sentence count average words per sentence automated readability index gunning fog score For European languages Coleman-Liau and Automated Readability Index should be used as they do not use syllable counting, so should produce a reasonably accurate score. (2) Keywords Table The keywords are generated by excluding a huge list of stop words (common words), e.g., 'the', 'a', 'of', 'to', etc, etc. Sample Data text_length, 3963 letter_count, 3052 word_count, 684 sentence_count, 33 word_per_sentence, 21 gunning_fog, 11.5 auto_read_index, 9.9 keyword 1, killed keyword 2, officers keyword 3, police It should be noted that once an article gets updated all of the above statistics are regenerated and could be completely different values. How could I use the above information to detect if an article that's being published for the first time, is already existing within the database? I'm aware anything I'll design will not be perfect, the biggest risk being (1) Content that is not a duplicate will be flagged as duplicate (2) The system allows the duplicate content through. So the algorithm should generate a risk assessment number from 0 being no duplicate risk 5 being possible duplicate and 10 being duplicate. Anything above 5 then there's a good possibility that the content is duplicate. In this case the content could be flagged and linked to the article's that are possible duplicates and a human could decide whether to delete or allow. As I said before I'm storing keywords for the whole article, however I wonder if I could do the same on paragraph basis; this would also mean further separating my data in the DB but it would also make it easier for detecting (2) in my initial post. I'm thinking weighted average between the statistics, but in what order and what would be the consequences...

    Read the article

  • need an empty string, but getting an exception in ruby on rails

    - by Jon
    controller @articles = current_user.articles view <% @articles.each do |article| %> <%= link_to "#{article.title} , #{article.author.name}" articles_path%> <% end %> Sometimes the article has no author, so is null in the database, which results in the following error You have a nil object when you didn't expect it! The error occurred while evaluating nil.name I still want to output the article title in this scenario, whats the best way to do this please?

    Read the article

  • jQuery - field entry - how to duplicate and convert to seo friendly url

    - by Binyamin
    I have two HTML input fields 'article' and 'url'. How to duplicate field 'article' entry to field 'url' to SEO friendly link!? 'url' allowed symbols 'a-z' (capital letters converted to lowercase), 'url' space symbol replace with dash '-', 'url' other symbols ignored. required typing just in field 'article' <input type="text" name="article"> url field is jquery auto generated and updated by field article value <input type="text" name="url">

    Read the article

  • ruby on rails photo upload problem

    - by dodo00700
    Hallo rails version 2.3.5 I'm learning rails and I run into a problem. I'm doing some nesting forms from the railscasts tutorials. I changed the text area into a data field to upload photos and everything is working. Now i have to display the uploaded pictures and i simply can't do it. I Tried everything I could find on the net but nothing worked. PROBLEM I have the Article controller which handles the article CRUD. inside the article new form there is nested a form for uploading images. article controller def code_image @image_data = Photo.find(params[:id]) @image = @image_data.binary_data send_data(@image, :type => @image_data.content_type, :filename => @image_data.filename, :disposition => 'inline') end photo model def image_file=(input_data) self.filename = input_data.original_filename self.content_type = input_data.content_type.chomp self.binary_data = input_data.read end articles/show.html.erb <%=h @article.title %> <%=h @article.body %> <% for photos in @article.photos %> <%= image_tag(url_for({:action => 'code_image', :id => @article.photos.id})) -%> <% end %> articles/_formnew.html.erb <% form_for (:article, @article, :url => {:action=>'create'}, :html=> {:multipart=>true}) do |f| %> <%= f.error_messages % <%= f.label :title %><br /> <%= f.text_field :title %><br /><br /> <%= f.label :body %><br /> <%= f.text_area :body, :style => 'width: 600px;' %><br /><br /> <% f.fields_for :photos do |builder|%> <%= builder.label :content, "Photo"%><br /> <%= builder.file_field :image_file %><br /> <% end %> <br /> <%= f.submit "Create" %> <% end % Thanks

    Read the article

  • SQL SERVER – Weekly Series – Memory Lane – #005

    - by pinaldave
    Here is the list of curetted articles of SQLAuthority.com across all these years. Instead of just listing all the articles I have selected a few of my most favorite articles and have listed them here with additional notes below it. Let me know which one of the following is your favorite article from memory lane. 2006 SQL SERVER – Cursor to Kill All Process in Database I indeed wrote this cursor and when I often look back, I wonder how naive I was to write this. The reason for writing this cursor was to free up my database from any existing connection so I can do database operation. This worked fine but there can be a potentially big issue if there was any important transaction was killed by this process. There is another way to to achieve the same thing where we can use ALTER syntax to take database in single user mode. Read more about that over here and here. 2007 Rules of Third Normal Form and Normalization Advantage – 3NF The rules of 3NF are mentioned here Make a separate table for each set of related attributes, and give each table a primary key. If an attribute depends on only part of a multi-valued key, remove it to a separate table If attributes do not contribute to a description of the key, remove them to a separate table. Correct Syntax for Stored Procedure SP Sometime a simple question is the most important question. I often see in industry incorrectly written Stored Procedure. Few writes code after the most outer BEGIN…END and few writes code after the GO Statement. In this brief blog post, I have attempted to explain the same. 2008 Switch Between Result Pan and Query Pan – SQL Shortcut Many times when I am writing query I have to scroll the result displayed in the result set. Most of the developer uses the mouse to switch between and Query Pane and Result Pane. There are few developers who are crazy about Keyboard shortcuts. F6 is the keyword which can be used to switch between query pane and tabs of the result pane. Interesting Observation – Use of Index and Execution Plan Query Optimization is a complex game and it has its own rules. From the example in the article we have discovered that Query Optimizer does not use clustered index to retrieve data, sometime non clustered index provides optimal performance for retrieving Primary Key. When all the rows and columns are selected Primary Key should be used to select data as it provides optimal performance. 2009 Interesting Observation – TOP 100 PERCENT and ORDER BY If you pull up any application or system where there are more than 100 SQL Server Views are created – I am very confident that at one or two places you will notice the scenario wherein View the ORDER BY clause is used with TOP 100 PERCENT. SQL Server 2008 VIEW with ORDER BY clause does not throw an error; moreover, it does not acknowledge the presence of it as well. In this article we have taken three perfect examples and demonstrated which clause we should use when. Comma Separated Values (CSV) from Table Column A Very common question – How to create comma separated values from a table in the database? The answer is also very common if we use XML. Check out this article for quick learning on the same subject. Azure Start Guide – Step by Step Installation Guide Though Azure portal has changed a quite bit since I wrote this article, the concept used in this article are not old. They are still valid and many of the functions are still working as mentioned in the article. I believe this one article will put you on the track to use Azure! Size of Index Table for Each Index – Solution Earlier I have posted a small question on this blog and requested help from readers to participate here and provide a solution. The puzzle was to write a query that will return the size for each index that is on any particular table. We need a query that will return an additional column in the above listed query and it should contain the size of the index. This article presents two of the best solutions from the puzzle. 2010 Well, this week in 2010 was the week of puzzles as I posted three interesting puzzles. Till today I am noticing pretty good interesting in the puzzles. They are tricky but for sure brings a great value if you are a database developer for a long time. I suggest you go over this puzzles and their answers. Did you really know all of the answers? I am confident that reading following three blog post will for sure help you enhance the experience with T-SQL. SQL SERVER – Challenge – Puzzle – Usage of FAST Hint SQL SERVER – Puzzle – Challenge – Error While Converting Money to Decimal SQL SERVER – Challenge – Puzzle – Why does RIGHT JOIN Exists 2011 DVM sys.dm_os_sys_info Column Name Changed in SQL Server 2012 Have you ever faced a situation where something does not work? When you try to fix it - you enjoy fixing it and started to appreciate the breaking changes. Well, this was exactly I felt yesterday. Before I begin my story, I want to candidly state that I do not encourage anybody to use * in the SELECT statement. Now the disclaimer is over – I suggest you read the original story – you will love it! Get Directory Structure using Extended Stored Procedure xp_dirtree Here is the question to you – why would you do something in SQL Server where you can do the same task in command prompt much easily. Well, the answer is sometime there are real use cases when we have to do such thing. This is a similar example where I have demonstrated how in SQL Server 2012 we can use extended stored procedure to retrieve directory structure. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: Memory Lane, PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Breadcrumbs to show Navigation of user

    - by user310916
    My Folder structure in sharepoint is flat one. in the same level I have pages Home, Main Articles, Articles by Category, Article Content aspx pages. A user can navigate like Home Main Articles Articles by Category Article or Home Main Articles Article or Home Article. I want user to see the breadcrumbs as shown above. I created a web.sitemap xml file in my site definition as follows <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="Landing.aspx" title="Tips from the Top" description="The Tips from the Top Home Page"> <siteMapNode url="MainArticles.aspx" title="All Articles" description="All Articles are available here"> <siteMapNode url="ArticlesbyCategory.aspx" title="Articles by Category" description="Articles on selected category"> <siteMapNode url="CurrentArticleContent.aspx" title="Article Content" description="Article of Interest" /> </siteMapNode> <siteMapNode url="CurrentArticleContent.aspx" title="Article Content" description="Article of Interest" /> </siteMapNode> <siteMapNode url="MainTips.aspx" title="All Business Tips" description="All Business Tips are available here"> <siteMapNode url="TipsbyCategory.aspx" title="Tips by Category" description="Tips on selected category" /> </siteMapNode> </siteMapNode> </siteMap> and also added a web.config file as <siteMap defaultProvider="MapProvider"> <providers> <add name="MapProvider" type="xyz.abc.SiteDefinition.MapProvider,xyz.abc.SiteDefinition" siteMapFile = "Web.Sitemap" /> </providers> </siteMap>

    Read the article

  • Form is submitting when the page loads

    - by RailAddict
    I have a really simple Rails app. Basically an article with comments. I want the article page to show the article, comments underneath and then a textbox to write a comment and a submit button to submit it. I got it all working except for one (big) problem. When the page loads.. example.com/article/1 a blank comment is submitted to the database. I fixed that by including "validates_presence_of :body" in the Comment model. But that results in the following image when the page loads: This is my code by the way: def show @place = Article.find(params[:id]) @comment = Article.find(params[:id]).comments.create(params[:comment]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @article } end end and <% form_for([@article, @comment]) do |f| %> <p> <%= f.label :commenter %><br /> <%= f.text_field :commenter %> </p> <p> <%= f.label :body %><br /> <%= f.text_area :body %> </p> <p> <%= f.submit "Create" %> </p> <% end %>

    Read the article

  • Proper way to use a config file?

    - by user156814
    I just started using a PHP framework, Kohana (V2.3.4) and I am trying to set up a config file for each of my controllers. I never used a framework before, so obviously Kohana is new to me. I was wondering how I should set up my controllers to read my config file. For example, I have an article controller and a config file for that controller. I have 3 ways of loading config settings // config/article.php $config = array( 'display_limit' => 25, // limit of articles to list 'comment_display_limit' => 20, // limit of comments to list for each article // other things ); Should I A) Load everything into an array of settings // set a config array class article_controller extends controller{ public $config = array(); function __construct(){ $this->config = Kohana::config('article'); } } B) Load and set each setting as its own property // set each config as a property class article_controller extends controller{ public $display_limit; public $comment_display_limit; function __construct(){ $config = Kohana::config('article'); foreach ($config as $key => $value){ $this->$key = $value; } } } C) Load each setting only when needed // load config settings only when needed class article_controller extends controller{ function __construct(){} // list all articles function show_all(){ $display_limit = Kohana:;config('article.display_limit'); } // list article, with all comments function show($id = 0){ $comment_display)limit = Kohana:;config('article.comment_display_limit'); } } Note: Kohana::config() returns an array of items. Thanks

    Read the article

  • Best practice PHP Form Action

    - by Rob
    Hi there i've built a new script (from scratch not a CMS) and i've done alot of work on reducing memory usage and the time it takes for the page to be displayed (caching HTML etc) There's one thing that i'm not sure about though. Take a simple example of an article with a comments section. If the comment form posts to another page that then redirects back to the article page I won't have the problem of people clicking refresh and resending the information. However if I do it that way, I have to load up my script twice use twice as much memory and it takes twice as long whilst i'm still only displaying the page once. Here's an example from my load log. The first load of the article is from the cache, the second rebuilds the page after the comment is posted. Example 1 0 queries using 650856 bytes of memory in 0.018667 - domain.com/article/1/my_article.html 9 queries using 1325723 bytes of memory in 0.075825 - domain.com/article/1/my_article/newcomment.html 0 queries using 650856 bytes of memory in 0.029449 - domain.com/article/1/my_article.html Example 2 0 queries using 650856 bytes of memory in 0.023526 - domain.com/article/1/my_article.html 9 queries using 1659096 bytes of memory in 0.060032 - domain.com/article/1/my_article.html Obviously the time fluctuates so you can't really compare that. But as you can see with the first method I use more memory and it takes longer to load. BUT the first method avoides the refresh problem. Does anyone have any suggestions for the best approach or for alternative ways to avoid the extra load (admittadely minimal but i'd still like to avoid it) whilst also avoiding the refresh problem?

    Read the article

  • Prevent two users from editing the same data

    - by Industrial
    Hi everyone, I have seen a feature in different web applications including Wordpress (not sure?) that warns a user if he/she opens an article/post/page/whatever from the database, while someone else is editing the same data simultaneously. I would like to implement the same feature in my own application and I have given this a bit of thought. Is the following example a good practice on how to do this? It goes a little something like this: 1) User A enters a the editing page for the mysterious article X. The database tableEvents is queried to make sure that no one else is editing the same page for the moment, which no one is by then. A token is then randomly being generated and is inserted into a database table called Events. 1) User B also want's to make updates to the article X. Now since our User A already is editing the article, the Events table is queried and looks like this: | timestamp | owner | Origin | token | ------------------------------------------------------------ | 1273226321 | User A | article-x | uniqueid## | 2) The timestamp is being checked. If it's valid and less than say 100 seconds old, a message appears and the user cannot make any changes to the requested article X: Warning: User A is currently working with this article. In the meantime, editing cannot be done. Please do something else with your life. 3) If User A decides to go on and save his changes, the token is posted along with all other data to update the database, and toggles a query to delete the row with token uniqueid##. If he decides to do something else instead of committing his changes, the article X will still be available for editing in 100 seconds for User B Let me know what you think about this approach! Wish everyone a great weekend!

    Read the article

  • Generating URLs when not using an integer as an id?

    - by Synthesezia
    So I'm building a blog engine which has /articles/then-the-article-permalink as it's URL structure. I need to have prev and next links which will jump to the next article by pub_date, my code looks like this: In my articles#show @article = Article.find_by_permalink(params[:id]) @prev_article = Article.find(:first, :conditions => [ "pub_date < ?", @article.pub_date]) @next_picture = Article.find(:first, :conditions => [ "pub_date > ?", @article.pub_date]) And in my show.html.erb <%= link_to "Next", article_path(@next_article) %> <%= link_to 'Prev', article_path(@prev_article) %> In my articles model I have this: def to_param self.permalink end The specific error message I get is: article_url failed to generate from {:action=>"show", :controller=>"articles", :id=>nil}, expected: {:action=>"show", :controller=>"articles"}, diff: {:id=>nil} Without the prev and next everything is working fine but I'm out of ideas as to why this isn't working. Anyone want to helo?

    Read the article

  • CanCan polymorphic resource access problem

    - by Call 'naive' True
    Hi everybody, i don't quite understand how to restrict access to links in this particular case with CanCan. I always get "Edit" link displayed. So i believe the problem is in my incorrect definition of cancan methods(load_ and authorize_). I have CommentsController like that: class CommentsController < ApplicationController before_filter :authenticate_user! load_resource :instance_name => :commentable authorize_resource :article def index @commentable = find_commentable #loading our generic object end ...... private def find_commentable params.each { |name, value| if name =~ /(.+)_id$/ return $1.classify.constantize.includes(:comments => :karma).find(value) end } end end and i have in comments/index.html.erb following code that render file from other controller: <%= render :file => "#{get_commentable_partial_name(@commentable)}/show.html.erb", :collection => @commentable %> you can think about "#{get_commentable_partial_name(@commentable)}" like just "articles" in this case. Content of "articles/show.html.erb": <% if can? :update, @commentable %> <%= link_to 'Edit', edit_article_path(@commentable) %> | <% end %> my ability.rb: class Ability include CanCan::Ability def initialize(user) user ||= User.new # guest user if user.role? :admin can :manage, :all elsif user.role? :author can :read, [Article, Comment, Profile] can :update, Article, :user_id => user.id end end end relations with models is: class Comment < ActiveRecord::Base belongs_to :commentable, :polymorphic => true, :dependent => :destroy ... end class Article < ActiveRecord::Base has_many :comments, :as => :commentable, :dependent => :destroy ... end i have tried debug this issue like that user = User.first article = Article.first ability = Ability.new(user) ability.can?(:update, article) and i always get "= true" in ability check Note: user.role == author and article.user_id != user.id if you need more information please write thank's for your time && sorry for my english

    Read the article

  • how to avoid change in url address in rtl languages

    - by Mac Taylor
    hey guys im working on a task to make my story's links like this http://localhost/mycms/article/test/ i used : $mtitle = str_replace("\"", "'", $title); $slug_title = mysql_real_escape_string($mtitle); and a href link to show story's title in other php file i used two arrays as a moderator for google tab $urlin = array( "'(?<!/)modules.php\?name=News&amp;file=article&amp;title=([a-zA-Z0-9_-]*)'", "'(?<!/)modules.php\?name=News&amp;file=tags&tag=([a-zA-Z0-9_-]*)'" ); $urlout = array( "article/\\1/", "article/tags/" ); and it automatically change urls but when it goes to RTL languages such as arabic , it failed e.g. : http://localhost/CMS/article//????? while it should be like this : http://localhost/CMS/article/?????/ i tried different ways to correct this but none of them worked

    Read the article

  • NULL values in object properties in Entity Framework

    - by Tony
    Tables: Article, Author, Comment (1 article and 1 author can have * comments) In the database is 1 article, 1 author and 1 comment. The problem is, that code myBD my_bd = new myBD(); var articles = by_bd.Article; works OK, I can see that an Author and an Article has 1 comment. But that code var comm = (from u in my_bd.Comment where ...... select u); returns the comment but it has NULL values in property Article and Author. Why ?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >