Developer forum

Forum » Templates » Problem with shortcut and menu xslt

Problem with shortcut and menu xslt

Nikolai Kokholm
Reply

I have an IE problem with shortcut that redirects and then create a 404 error. Is it possible to grab the shortcut in the template manually and then create a direct adress to the place where you want it to go?


Replies

 
Mikkel Ricky
Reply

Maybe … Please provide more details on what doesn't work and, if possible, provide a url where we can see the issue. Then we should be able to find a solution.

Best regards,
Mikkel

 
Nikolai Kokholm
Reply

Okay I'll try to be more specific. On this page: http://www.eamv.dk/Uddannelser/Fuldtid.aspx in the sitebar menu there is a menu link called "Serviceøkonom" on this menulink I have created a shortcut to one of it's subpages. The shortcut works fine and you get redirected to the page: http://www.eamv.dk/Uddannelser/Fuldtid/Serviceøkonom/Introduktion.aspx. The Problem I have is that IE somehow cache this redirect and for some IE users who then at a later point return to the site may experience a 404 page due to new content and the fact that the redirect have been cached. My idea to solve this problem is to make a direct link instead og a redirect. But is this even possible with the xslt menu?  

 
Mikkel Ricky
Reply
This post has been marked as an answer

In the navigation xml, the Href attribute on a shortcut page points to the target page (Default.aspx?ID=4423 in your case), but @FriendlyHref points to the shortcut page itself (/Uddannelser/Fuldtid/Serviceøkonom.aspx in your case) resulting in a 301 redirect which IE may cache for too long (cf. http://agsci.psu.edu/it/how-to/topics/web/plone/other/internet-explorer-9-permanently-caches-redirects).

I'm not sure if this a bug in Dynamicweb or if it's by design, but I'll ask around at HQ to find out.

You can work around this issue by using @Href in your navigation xslt:

<a>
    <xsl:attribute name="href"><xsl:value-of select="@Href" disable-output-escaping="yes"/></xsl:attribute>
    …
</a>
 

When rendering the page Dynamicweb will automatically rewrite href="Default.aspx?ID=4423" to the friendly url /Uddannelser/Fuldtid/Serviceøkonom/Introduktion.aspx.

Best regards,
Mikkel

Votes for this answer: 1
 
Andrew Mannell
Reply

Hi Mikkel,

We have a simular problem with a shortcut on the website default page in Dynamicweb, I made a case but got not possible to change back. Would be great if you could post any outcomings from HQ as we are looking at a workaround to redirect to 307 instead by overriding the urls in the IIS.

Thanks

Andy

 

 

 

 
Mikkel Ricky
Reply

It is a bug (TFS #15169). @Href and @FriendlyHref should point to the same page on pages with internal shortcuts.

You could stick to always using @Href in your navigation xslt and let Dynamicweb automagically rewrite it according to any customized url settings.

Best regards,
Mikkel

 

 
Nikolai Kokholm
Reply

THx Mikkel this helped solve my problem :)

 

You must be logged in to post in the forum