Jump to content

Using child pages as part of parent page

Peter Troeger

Recommended Posts

Hello :)

maybe someone can help me with my problem.

I'm creating a parent page where I define things like header information, slider images, introduction-text...

The content of this parent page is generated by creating child pages.

But each child is not supposed to have it's own page/url.

I just want the children to be part of the parent page (which they are already doing).

But, I don't want the child pages to be accessible via their own url.

And I don't know how to achive this.

I have, for example, a parent page called TEAM.

I have created the child pages TEAM-MEMBER-1 and TEAM-MEMBER-1.

In the front-end page http://url.com/team is rendered fine with the contents from TEAM-MEMBER-1 and TEAM-MEMBER-1.

But the pages http://url.com/team/team-member-1 and http://url.com/team/team-member-1 are also accessible, which I don't want.

Any one know what to do?

I hope I was able to get my point across.



Link to comment
Share on other sites

Hi Peter,

There's various techniques to solve this:

  1. Don't give the template of team-member-1 (the child pages) a template file. And decide what to do when that URL is accessed
  2. Don't give 'guest' view access (in template file of the child pages) and tell PW what to do when those child pages are accessed - e.g. redirect to some URL
  3. In the template file of child pages, use $session-redirect('/some-url/') to redirect users to the parent page
  4. Etc...(aka - please search  :-) - this has been covered a lot in the forums)
Edited by kongondo
  • Like 2
Link to comment
Share on other sites

Hi kongondo,

thanks for the tips.

1. I want the content to be displayed in a certain way and am using the template file so I can just render the child pages in the parent page.

2. When I don't allow guests to view the page it is not displayed in my parent page anymore. I tried redirecting the URL via the redirect module, but it ignores it and still displays the page.

3. When doing this, I get an error for too many redirects

4. I didn't know that to search for, that is my problem :/ Any tipps, then I will do some more research.

Thanks! :)


Link to comment
Share on other sites

Aah, I see. If you need to use the template file of the child pages, have a look at this long thread. @jonathan's post may be of special interest in your case.

You do not need to use the redirect module for such a simple redirect. For such you use $session->redirect('url') like I indicated  :-). Have a read here about the session variable.

Edited by kongondo
  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...