Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Why can't you create children to a redirector page by default in SS3 ?


Reply


5 Posts   527 Views

Avatar
stallain

Community Member, 61 Posts

3 July 2012 at 11:40pm

Hi,

Line 28 of RedirectorPage.php in SS3 :

static $allowed_children = array();

I've been able to change this behaviour by using a custom class.
But out of curiousity : why isn't adding children to a redirector page allowed by default ?

Avatar
Willr

Forum Moderator, 5513 Posts

5 July 2012 at 7:08pm

Likely someone figured no one would even need to create children of redirectors! I'd say removing it won't break anything and keeps the behaviour more consistent.

Avatar
stallain

Community Member, 61 Posts

5 July 2012 at 8:01pm

Thanks for your answer Will.
Let's consider this kind of site tree :

Page 1 (level 1)
Page 2 (level 1)
-------Page3 (level 2)
-------Page 4 (level 2)
-------Page 5 (level 2)
Page 6 (level 1)

I want Page 3 to be displayed when somebody clicks on "Page 2" in the top-level menu.
Do you mean that redirecting Page 2 to Page 3 is the wrong way to achieve this ?

Stan

Avatar
Willr

Forum Moderator, 5513 Posts

5 July 2012 at 8:08pm

Do you mean that redirecting Page 2 to Page 3 is the wrong way to achieve this ?

No, I said it's the right way to do it and that whoever changed it was wrong. Submit the fix as a pull request (you can edit the file directly through github if learning git is too hard).

Avatar
stallain

Community Member, 61 Posts

5 July 2012 at 9:26pm

Thanks, and sorry for my misunderstanding.