Reacent list path error

Topics: Customizing Orchard
Dec 19, 2011 at 5:10 PM

Hi,

My Article recent content list path is comming like below

http://localhost:30320/OrchardLocal/Routable/Item/Item?Length=8

 

I have create list.cshtml file inside my view folder like below

 

@using Orchard.Core.Contents.ViewModels;
@using Orchard.Utility.Extensions;


@using Orchard.DisplayManagement.Shapes;
@{
    var list = Model;
    var items = list.Items;
    var count = items.Count;
    var listTag = Tag(list, "ul");
    listTag.AddCssClass("articles-items");
    listTag.AddCssClass("articles-posts");
    
}
    <table class="items">  

    @foreach (var Article in items)
    {
   
         <tr>           
                <td>             
     
                 @Html.ActionLink((string)Article.Title,"Item","Articles", new { Article.ContentItem.Id })              
                
           
                </td> 
            </tr>    
    }
   </table>

there is no routerpart in my actionlink, But how url comming with routerpart?

I want make this url like below

http://localhost:30320/OrchardLocal/Articles/Item?Length=8

 

How can i make that?

Dec 19, 2011 at 5:14 PM

If Article is a ContentType, why not just use @Html.ItemDisplayLink?

Dec 20, 2011 at 4:22 AM

Hi,

 

I have use this

  @Html.ItemDisplayLink((Orchard.ContentManagement.ContentItem)Article.ContentItem)   

I can see my reacent list, but when i click one of item its redirect to home page, its not display details of article

http://localhost:30320/OrchardLocal/

 

lakmal

 

Dec 21, 2011 at 6:31 PM

 

Finally i had change my code like below

  Articles.As<RoutePart>().Path = Articles.As<RoutePart>().Slug;

Now my path issue is working