KimP Posted September 26, 2014 Share Posted September 26, 2014 Hi, Topic is a bit misleading but didn’t know how to describe it in 1 sentence. Say i have a page which represents an event. This event is hosted at different moments in time. For every time it’s hosted, i’d like te have a new page, with the event itself as parent. EventTime 1 Time 2 Time 3 Etc. This would generate urls like /event/time_1, /event/time_2 and so on. Because most content on the page is the same (can differ a bit but not much), google probably sees it as duplicate content, so i set canonical tags in the header of every subpage witch point to /event. So far so good. But now, when you go to the /event page i’d like to show the content of the next upcoming time (say, Time 2). I could solve this with a redirect to /event/time_2, but the seo guys prefer i keep at /event. Any suggestions on how to achieve this? I overriding $this->page and $page as first lines in my template doesn’t feel like the right way Grz, Kim Link to comment Share on other sites More sharing options...
sforsman Posted September 26, 2014 Share Posted September 26, 2014 Hello, Your question is answered here: http://wiki.processwire.com/index.php/Including_a_page_in_another_page 2 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted September 26, 2014 Share Posted September 26, 2014 (edited) Maybe you could put this code in the Event template file: $page->children("sort=-created")->get()->render(); ...or something like that. Have not tested it )) Of course you should handle cases when there are no children. Edited September 26, 2014 by Ivan Gretsky 1 Link to comment Share on other sites More sharing options...
KimP Posted September 26, 2014 Author Share Posted September 26, 2014 Very nice! Thx. Should have searched better before asking Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now