How can send href link to sections id in anchor menu?
Hi all,
I want create a anchor menu. Firstly I created navigation menu without problem. Now I am creating pages inclued sections, my question is how can I send href link to sections id in anchor menu?
this would let the page scroll to the anchor, on the current page.
To display an element with the same id as the anchor, you would need to traverse your selection the same way as you already have in the menu, but render a container for each page, like so
@foreach (var item in selection)
{
var menu = item.Value<IEnumerable<IPublishedElement>>("subMenus");
var subMenuList = menu.Select(n => n.Value<IEnumerable<Link>>("subMenuLinks"));
if (subMenuList.Count() > 0)
{
foreach (var submenu in subMenuList)
{
@foreach (var sub in submenu)
{
<div id="@sub.Url">RENDER CONTENT HERE</div>
}
}
}
}
Just doing links to the actual pages might just be easier, then The line:
How can send href link to sections id in anchor menu?
Hi all,
I want create a anchor menu. Firstly I created navigation menu without problem. Now I am creating pages inclued sections, my question is how can I send href link to sections id in anchor menu?
My menu code is below
Hi,
Are you trying to create a single page with all the content, or just creating links to the pages?
The line:
Should be
this would let the page scroll to the anchor, on the current page.
To display an element with the same id as the anchor, you would need to traverse your selection the same way as you already have in the menu, but render a container for each page, like so
Just doing links to the actual pages might just be easier, then The line:
Should just be
I hope I understood your question right, and the above helps :)
is working on a reply...