Page 1 of 1

Changing menus and templates based on the page I come from..

Posted: Fri Jul 05, 2013 1:45 am
by Andrew Prior
Imagine I have a series of articles on American State capital cities...

Then imagine I have another series on the great cities of America, which will, of course, include some cities from the first list.

I can link to the state capitals which are also great cities from my great cities page using an internal page link. The problem, of course is that if you go to a state capital from the great cities page, you get the state capital's menu and template, not the great cities navigational menu.

I could solve this by duplicating pages, but that is hardly good practice!

Any ideas how one could change that menu and template on the fly; that is, recognise that the reader has clicked on the internal page link for great cities and is not browsing the state capitals? How do we set navigation based on the page a person came from rather than the page they arrive at? Out of my depth here...
Andrew

Re: Changing menus and templates based on the page I come fr

Posted: Fri Jul 05, 2013 2:15 am
by calguy1000
I don't think you want to do that. for seo and other purposes. Remembering that people not only navigate to a page, but they also bookmark it and share links. also search engines crawl your site.

If you have pages like:

Fruits (fruit template)
- Apple (page, fruit template))
- Orange (page, fruit template)
- Tomato (page, fruit template)

Vegetables (page, veggie template)
- Carrot (page, veggie template)
- Celery (page, veggie template)
- Tomato (links to the Fruits Page)

There is only one page, and one page hierarchy to the tomato page. so there will be no extra content on that page dependent on how they browsed to it. The user, or the search engine could come back to the page 3 months later, in which case the browsing information is irrelevant. And you still don't want duplicate content.

What you could do is some way of linking back to the parent(s) in some way.
i.e: This page is a 'Fruit' (links to the fruits page) and is also considered by some to be a 'Vegetable' (link to the vegetables page). which gives you the reverse navigation you may want.

Maybe a oneline content block like: 'related pages' with content like 'fruits,vegetables'. then you could use Menumanager to create a simple navigation to these pages.

The 'tomato' page would be displayed using the 'fruit' template but would provide links back to both the fruit, and vegetable parents.

Re: Changing menus and templates based on the page I come fr

Posted: Fri Jul 05, 2013 5:13 am
by Rolf
Have you tried to achieve this with a module. It looks to me similar as http://www.cmscanbesimple.org/blog/buil ... ade-simple

Re: Changing menus and templates based on the page I come fr

Posted: Fri Jul 05, 2013 10:50 am
by Andrew Prior
Thanks Calguy... some good thoughts there.