LinkItemCollection Not Rendering Url Correctly

Vote:
 

I am having some issues when rendering urls in Views. Is there something special I need to do when rendering urls in Views and/or Masterpages.  Thanks in advance.  seems like the url rewriter is not picking it up for some reason.

#62814
Nov 03, 2012 2:19
Vote:
 

In the MVC sample package (part of thge preview) on the start page there are several LinkItemCollections rendered in the bottom of the page. They are renderered through PropertyFor where the LinkItemCollection is passed in as argument.

Then there is a partial view for LinkItemCollection looking as:

<ul>
<% foreach(var linkItem in Model ?? Enumerable.Empty<EPiServer.SpecializedProperties.LinkItem>()) %>
<% { %>
<li>
<%: Html.PageLink(linkItem)%>
</li>
<% } %>
</ul>

So each linkitem is rendered through a helper method PageLink that takes an LinkItem. If you reflect that helper method you can see it uses IPermanentLinkMapper to get the corresponding ContentReference from the Guid. Then it calls PageLink overload that takes a ContentReference as parameter.

#62815
Nov 04, 2012 0:09
Vote:
 

Thanks Johan.  It is exactly what i needed.

#62816
Nov 04, 2012 0:24
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.