Redirection

Author Message

John Smith

Friday 31 October 2008 1:40:09 am

Hi there,

Need help in achieving the following requirement in ezpublish 4.0.0

Folder 1
|-> Sub Folder 1
|-> Sub Folder 2
Folder2
|-> Sub Folder 3

When user clicks Folder 1, the system takes the user to Sub Folder1....I know there is one extension named as "redirect" along with some template code it is easy to achieve what I am looking for, but I think as a eZpublish professional license holder I can't use that extension.....

There must be some another easy way to achieve.. What about Url translator? I tried but without any look.

Please help...

Cheers.

Gaetano Giunta

Friday 31 October 2008 7:13:06 am

I do not know about specific requirements about the redirection: does it have to be done externally (eg http 301 or 302) or internally? Is it ok to keep the "Folder1" url displayed?

You could achieve this sub-display in many ways using templates:

A - use a template for folder 1 that does an html-redirect to subfolder1

B - add a view parameter to the url used for folder1:
.../folder1/(display)/SubFolder1
then in the template for folder 1 you check if node child SubFolder1 exists, and if it does, you do a {node_view_gui} on it

Principal Consultant International Business
Member of the Community Project Board

John Smith

Friday 31 October 2008 3:27:21 pm

Hi Giunta,

Thank for your kind help. I am quite interested in option B, where you suggested to add a view parameter to the url used for folder1...

Can you please describe in bit more detail..

Thanks once again, Much appreciated....

John Smith

Saturday 01 November 2008 3:34:12 am

Template code is working fine as suggested by you, means when I click Folder1, it is going to SubFolder1 but in the menu SubFolder1 is not getting selected.

I have not added any view parameter anywhere. Dont know how to make the SubFolder1 selected in the menu. Can you please explain bit more about adding a view parameter to the url for folder1. Is it going in the template generating the menu?

Cheers,

John Smith

Saturday 01 November 2008 4:52:56 am

Got a solution on the following url, all sorted.. neat and clean solution.

http://ez.no/developer/forum/setup_design/direct_link_to_another_node_in_menu/re_direct_link_to_another_node_in_menu__1

Holger Marx

Monday 29 December 2008 8:43:15 am

Another possibility is to use .htaccess file for redirecting.

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:27:09
Script start
Timing: Jan 18 2025 18:27:09
Module start 'layout'
Timing: Jan 18 2025 18:27:09
Module start 'content'
Timing: Jan 18 2025 18:27:10
Module end 'content'
Timing: Jan 18 2025 18:27:10
Script end

Main resources:

Total runtime0.7960 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 587.7813152.6094
Module start 'layout' 0.00490.0025 740.390639.3984
Module start 'content' 0.00730.7870 779.7891599.2031
Module end 'content' 0.79430.0017 1,378.992212.2031
Script end 0.7960  1,391.1953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3999160.0002
Check MTime0.00130.1634160.0001
Mysql Total
Database connection0.00070.088910.0007
Mysqli_queries0.741693.1593680.0109
Looping result0.00070.0853660.0000
Template Total0.766796.320.3833
Template load0.00220.278620.0011
Template processing0.764596.036120.3822
Template load and register function0.00010.014010.0001
states
state_id_array0.00110.142410.0011
state_identifier_array0.00130.164320.0007
Override
Cache load0.00180.2307360.0001
Sytem overhead
Fetch class attribute can translate value0.00040.055830.0001
Fetch class attribute name0.00100.129870.0001
XML
Image XML parsing0.00070.090630.0002
class_abstraction
Instantiating content class attribute0.00000.001570.0000
General
dbfile0.00080.0943160.0000
String conversion0.00000.000940.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs