SSbits - Home page
Site by Carbon Crayon
Submit a Post >

Snippets - Little bits of code to make you happy

Automatically Redirect to the first Child Page without a Redirector Page

This is a little snipped i've been using to redirect a custom page to it's first child. It extends the init method of the Controller. This has proven useful in cases where the client wants to re-sort the child pages and doesn't want to mess around the configuration of a redirector page.

function  init() {

  • Bart van Irsel
    03/10/2011 2:25pm (6 years ago)

    Hi ekersten,

    Thanks for this tip, i use a ChildRedirectorPage for this which also links directly to the firstchild when $Link is used in the temaplte system.
    I placed it here, maybe more people will like it:

  • vani
    04/10/2011 5:16pm (6 years ago)

    oh thank you very much for the code have been searching for a long time found it here finally<a href="http//">iphone 5 spcifications</a>

  • vani
    04/10/2011 5:17pm (6 years ago)

    oh thank you very much for the code have been searching for a long time found it here finally<a href="">iphone 5 specifications</a>

  • moloko_man
    04/10/2011 5:22pm (6 years ago)

    If you have hidden children pages, and you want to forward to them you will need to use:

  • Nick Jacobs
    06/11/2011 9:32pm (6 years ago)

    Great tip!.... I'd do a test on this so that it only redirects if the current page has no content...something like this (not tested):



  • Adil Aliyev
    28/01/2012 9:47pm (5 years ago)

    Useful in practice. Thanks.

Post a comment ...

You cannot post comments until you have logged in. Login Here.


Site of the Month

Find SSbits on

Top Contributers

Rank Avatar Name
1 article image Aram Balakjian
2 article image wfacewomens
3 article image Daniel Hensby
4 article image Marcus Dalgren
5 article image ryduhartchas
6 article image Hamish Campbell
7 article image Ty Barho
8 article image Martijn van Nieuwenhoven
9 article image Darren-Lee
10 article image Roman Schmid

View full leaderboard