Home  Extras  MODx Add-Ons  FirstChildRedirect

FirstChildRedirect



Votes: 7
Tags: Menu, snippet, taxonomy, folder
Submitted: May 21, 2009
Released: May 21, 2009
Downloads: 126
License: GPLv3


FirstChildRedirect 2.2-beta1 | Author: splittingred

Works with the following Version(s): Revolution-2.0.0-beta1

Redirect the page to the first child element.


Download


Description

Use FirstChildRedirect to redirect users to the first document in a folder (based on menuindex sort order) when they access a folder document within MODx.

If no children are found for the specified document, FirstChildRedirect will redirect users to the site start page, though this behavior can easily be modified in the snippet code: just look for $modx->config'site_start' and replace it with another config value ( e.g. $modx->config'error_page' ) or a specific document id.

Instructions

Install via Package Managment.




Sub-Packages



Previous Releases


1.1

Forums Support Thread Votes: 13
Tags: Menu, snippet, taxonomy, folder
Submitted: Jul 21, 2006
Released: Jul 21, 2006
Downloads: 1961
License: Public Domain
Package Website


FirstChildRedirect 1.1 | Author: opengeek

Works with the following Version(s):

This snippet was created to have MODx folders emulate the behavior of traditional folders in a web site by redirecting to the first child page it contains.


Download


Description

Use FirstChildRedirect to redirect users to the first document in a folder (based on menuindex sort order) when they access a folder document within MODx.

If no children are found for the specified document, FirstChildRedirect will redirect users to the site start page, though this behavior can easily be modified in the snippet code: just look for $modx->config'site_start' and replace it with another config value ( e.g. $modx->config'error_page' ) or a specific document id.

Instructions

Create a new snippet called FirstChildRedirect and copy and paste the contents of the snippet.FirstChildRedirect.tpl file into it. Save the snippet and you are ready to use it.

You can place the snippet in any content of a MODx document specified as a folder (i.e. has children) to redirect to the first child:


FirstChildRedirect

or for cached folders, use...

!FirstChildRedirect!


You can optionally have it redirect to the first child of another document by specifying the parameter docid...

FirstChildRedirect &docid=`12`
UpdatesMakes the docid parameter optional and defaults to the current page.



1.0

Forums Support Thread Votes: 13
Tags: Menu, snippet, taxonomy, folder
Submitted: Jul 20, 2006
Released: Jul 20, 2006
Downloads: 478
License: Public Domain
Package Website


FirstChildRedirect 1.0 | Author: opengeek

Works with the following Version(s):

This version has been marked as deprecated. Please use a newer version.

This snippet was created to have MODx folders emulate the behavior of traditional folders in a web site by redirecting to the first child page it contains.


Download


Description

Use FirstChildRedirect to redirect users to the first document in a folder (based on menuindex sort order) when they access a folder document within MODx.

If no children are found for the specified document, FirstChildRedirect will redirect users to the site start page, though this behavior can easily be modified in the snippet code: just look for $modx->config'site_start' and replace it with another config value ( e.g. $modx->config'error_page' ) or a specific document id.

Instructions

Create a new snippet called FirstChildRedirect and copy and paste the contents of the snippet.FirstChildRedirect.tpl file into it. Save the snippet and you are ready to use it.

You can place the snippet in any content of a MODx document specified as a folder (i.e. has children) to redirect to the first child:


FirstChildRedirect

or for cached folders, use...

!FirstChildRedirect!


You can optionally have it redirect to the first child of another document by specifying the parameter docid...

FirstChildRedirect? &docid=`12`




Comments

Please login to comment.

Close ]


 
 
 

Contact Us | Team Blog | FAQ | Site Credits

© 2005-2009 the MODx CMS project. All rights reserved. Privacy Policy | Terms of Service