Forums / General / Redirect to an external URL from a folder

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

eZ debug

Timing: Jan 19 2025 04:22:38
Script start
Timing: Jan 19 2025 04:22:38
Module start 'content'
Timing: Jan 19 2025 04:22:39
Module end 'content'
Timing: Jan 19 2025 04:22:39
Script end

Main resources:

Total runtime0.8870 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 590.2109180.8203
Module start 'content' 0.00650.7006 771.0313593.7031
Module end 'content' 0.70710.1798 1,364.7344337.3750
Script end 0.8869  1,702.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00470.5252210.0002
Check MTime0.00170.1916210.0001
Mysql Total
Database connection0.00070.074210.0007
Mysqli_queries0.798990.06372020.0040
Looping result0.00260.29852000.0000
Template Total0.850595.920.4253
Template load0.00290.328020.0015
Template processing0.847695.557820.4238
Template load and register function0.00020.017410.0002
states
state_id_array0.00090.106810.0009
state_identifier_array0.00100.115720.0005
Override
Cache load0.00240.2761270.0001
Sytem overhead
Fetch class attribute can translate value0.00170.189040.0004
Fetch class attribute name0.00140.153360.0002
XML
Image XML parsing0.00100.114240.0003
class_abstraction
Instantiating content class attribute0.00010.011160.0000
General
dbfile0.00430.4865260.0002
String conversion0.00000.002330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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