Redirect to an external URL from a folder

Author Message

Jean-Luc Nicoulin

Monday 27 September 2004 2:51:16 am

Hello,

I am a newbee with eZpublish. 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,

Jean-Luc Nicoulin

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

Jean-Luc Nicoulin

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 ?

Regards,

Jean-Luc

Lazaro Ferreira

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 ?

Lazaro
http://www.mzbusiness.com

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 18:41:52
Script start
Timing: Jan 18 2025 18:41:52
Module start 'layout'
Timing: Jan 18 2025 18:41:52
Module start 'content'
Timing: Jan 18 2025 18:41:53
Module end 'content'
Timing: Jan 18 2025 18:41:53
Script end

Main resources:

Total runtime0.5473 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.1719152.6406
Module start 'layout' 0.00560.0030 741.812539.4766
Module start 'content' 0.00860.5373 781.2891588.6094
Module end 'content' 0.54590.0014 1,369.898412.1250
Script end 0.5472  1,382.0234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.5848160.0002
Check MTime0.00130.2385160.0001
Mysql Total
Database connection0.00090.159910.0009
Mysqli_queries0.497890.9525650.0077
Looping result0.00060.1166630.0000
Template Total0.517594.620.2587
Template load0.00190.353020.0010
Template processing0.515594.197220.2578
Template load and register function0.00020.033310.0002
states
state_id_array0.00100.185810.0010
state_identifier_array0.00070.119820.0003
Override
Cache load0.00160.2969270.0001
Sytem overhead
Fetch class attribute can translate value0.00050.095230.0002
Fetch class attribute name0.00090.170360.0002
XML
Image XML parsing0.00060.109830.0002
class_abstraction
Instantiating content class attribute0.00000.001660.0000
General
dbfile0.00070.1272150.0000
String conversion0.00000.001840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs