Forums / General / Redirection

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.