November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
@foreach(var linkItem in Model.CurrentPage.RelatedLinks){ <p>@ <a href="@item.Href" target="@item.Target" title="@item.LinkTitleText()">@item.LinkTitleText()</a>
</p>}
What Petter said, since the item linkItem is a LinkCollectionItem, not a object of type pagelink .
Hi Petter and Jonas,
Thanks for your suggestion but this is still not working quite as expected.
The .Href property returns items of the format "~/link/[guid].aspx?id=[id]&epslanguage=en-GB"
Which in the source displays correctly however when I hover over the link presents:
http://localhost/pathtopage/~/link/[linkguid].aspx?id=[id]&epslanguage=en-GB which when clicked causes a 404 error. Manually removing the pathtopage value so that it is "http://localhost/link/[linkguid].aspx?id=[id]&epslanguage=en-GB" redirects to the homepage - this happens for all internal links.
So there seems to be several issues here:
Would you have any further suggestions?
Many thanks,
Mark
foreach (var link in Model.Layout.MyLinkCollectionProperty)
{
<p>
<a target="@link.Target" href="@Url.ContentUrl(link.Href)">@link.Text</a>
</p>
}
Try the extension method ContentURL
Hi, I also have a problem with LinkItemCollection:
Let's say I have a LinkItemCollection property on my Front Page, and I have a Page_A somewhere in content tree, and I want to add a LinkItem to the Page_A with query parameter (for example, Page_A?someId=1).
The only way I can do this is to create a "external link" with Url to my page (http://www.mysite/Page_A?someId=1) and add it to my LinkItemCollection, but when I save and publish changes in Front Page - this link is converted from external to internal, and there is no query parameter anymore.
Is it a bug or feature :)?
Thanks
Hi,
I've implemented a LinkItemCollection in a 7.5 Relate site and when I display the links on the page all links except external links point to the homepage of the site rather than the correct page.
I've tried rendering the links two different ways as follows but get the same result for both:
@Html.PropertyFor(m => m.CurrentPage.RelatedLinks)
@foreach(var linkItem in Model.CurrentPage.RelatedLinks)
{
<p>@Html.PageLink(linkItem)</p>
}
I'm guessing I've missed something (this can't be a bug can it?), has anyone else encountered this?
Mark