Forums / General / Redirect to an external URL from a folder
Jean-Luc Nicoulin
Monday 27 September 2004 2:51:16 am
Hello,
I am a newbee with Exponential. I would like to redirect the user to an external URL from one of the folder (directly from clicking it in the menu).
Any help would be appreciated !
Regards,
Lazaro Ferreira
Monday 27 September 2004 3:19:59 am
Hi Jean-Luc,
If I understood right, you can do it using a link object instead a folder object, EZP default menu template accept folder or link objects as menu items, so add a link object under , let's say root folder or any folder you are using as root for your menu
Lazaro
Lazaro http://www.mzbusiness.com
Wednesday 29 September 2004 9:43:23 am
Hi Lazaro,
Thanks already for your help. What I wanted to achieve was (for example) to have an "Amazon" item menu appear in my menu. When the user would click this item menu, s/he would be directly redirected to amazon.
Now, I tried your solution. The result I got was that the item doesn't appear in the menu, but in the full view of the parent node item menu, it does...
Can you help me further ?
Jean-Luc
Friday 01 October 2004 8:57:30 am
Hi,
that's intended to do that, could you send your site subtree items from root to the level on which reside the link item ?
Mark Marsiglio
Friday 01 October 2004 10:32:53 am
We accomplished this for a client who wanted certain areas of the site to be transitioned in slowly. Before the transition, the link would be in place, but it would direct users to a page on another server. After their content was ready, the link would then be switched back to the local "full" view.
To do this, we added a checkbox and URL datatype to the folder class. The check box is called "Link directly to URL" (link) and "URL to Link to" (url). If the content admin checks this box and enters a URL, the following template code sniffs that out, uses the URL location for the href instead of the content/view/full/XX. It is the switch case which looks to see if the value of the checkbox is checked, and if it is, substitutes the external URL
{section name=Folder loop=$folder_list max=1} {switch match=$Folder:item.data_map.link.content} {case match=1}<a class="footerlink" href="{$Folder:item.data_map.url.content}">{$Folder:item.name|wash}</a>{/case} {case}<a class="footerlink" href={$Folder:item.url_alias|ezurl}>{$Folder:item.name|wash}</a>{/case} {/switch} {/section}
http://www.thinkcreative.com Turning Ideas Into Strategic Solutions