Developer forum

Forum » Templates » Sidemenu links

Sidemenu links

Morten Berendtsen
Reply

So ive done a bit of testing with a new sidemenu intended for our website, so far ive found out you can extract properties dynamicly and even turn these into links like this.

<a href="<!--@Global:Page.Top.Name-->">For Science!</a>

Where the link will then lead to the corresponding top page, if the link is pressed. Provided it matches the url used and that there are no spaces or special characters.

This can in certain cases become a problem if we use this in our template as it will return errors for pagelinks where they either do not match or we have spaces in the link top page name.

What i would ultimately like to do is have the link be something like this instead.

<h href="<!--@Global:Page. Actual link used-->"><!--@Global:Page.Top.Name--></a>

So that we can use the Top name as the link text and still connect it with the actual pagelink name.

However i havent quite been able to find out how we can extract the used url dynamicly.

Any and all help will be greatly apreciated

-MB


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Morten

All links in Dynamciweb is something like Default.aspx?ID=XXX where XXX is the id of the page. So simply do like this:

<a href="Default.aspx?ID=<!--@Global:Page.Top.ID-->"><!--@Global:Page.Top.Name--></a>

Then Dynamicweb will automatically change the link from Default.aspx?ID=xxx to /Pagename.aspx or whatever.

BR Nicolai

 
Morten Berendtsen
Reply

Had not thought about the page id route, works like a charm.

Thanks Nicolai

-MB
 

 

You must be logged in to post in the forum