Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
hi there, I usually keep things as simple as possible with my navigation and templates and have used dynamic folders for sub-navigation. This time I decided to use nested pages for the About section of the site as I wanted the pretty URLs to be:

www.abc.com/about/general-information/
www.abc.com/about/history/
www.abc.com/about/testimonials/

i.e. no .html suffixes

as it looks more consistent than suddenly coming across .html pages

The first 2 links can share a template but the testimonials page is listing the cloned pages of another template called testimonials_repository.php and showing a photo in the right hand column.

I had thought that redirects or masquerades would allow me to get what I was after. But redirects would give me www.abc.com/testimonials/ (i.e. losing the about/) and masquerades is for use with index.php

I will probably put in a check for the page ID and if it's the testimonials page I'll do the listing and photo and the client will have to ignore all the other parts of the template showing up in the Admin Panel.

I wonder if this is the best solution?
@potato,
you can try using the following on the testimonials page
Code: Select all
<cms:masquerade "http://www.abc.com/testimonials/" />

Does it help? Do let me know.
thanks KK - I'll give this a try next year and let you know. Meanwhile Happy New Year to you, @cheesypoof and all other Couchies!
Happy New Year to you too!
See you next year :)
hello - I'm not entirely sure what
Code: Select all
<cms:masquerade "http://www.abc.com/testimonials/" />
is intended to do. Or where to put it ... I was hoping to get the URL of www.abc.com/about/testimonials/

Do you mean that I need to create a separate template for testimonials? And not use the clone of about.php?

Sorry to be a bit slow on the uptake here ...

Also, I am working on locahost without pretty urls enabled - so would I be able to get it working in this environment anyway?
I'm not entirely sure what
Code:
<cms:masquerade "http://www.abc.com/testimonials/" />
is intended to do. Or where to put it ..

Best way to find that out would be trying it out first-hand.
Please place the following statement verbatim anywhere in your 'about.php' template
Code: Select all
<cms:masquerade "http://www.couchcms.com/" />

If 'curl' module is enabled on your server (which is invariable the case on hosted servers - your's is a local stack so you might need to enable curl), you'll find that although the URL shown by the browser remains pointing to about.php you actually see http://www.couchcms.com getting displayed.

That should explain the 'masquerade' part :)

Coming to your specific problem - you wish to make http://www.yoursite.com/about/testimonials/ point to a separate template http://www.yoursite.com/testimonials.php.

To do so, place the following in the page-view of about.php
Code: Select all
<cms:if k_page_name='testimonials'>
   <cms:masquerade "<cms:link 'testimonials.php' />" />
</cms:if>

This should display testimonials.php although the URL shows /about/testimonials/

Hope this helps.
thanks so much for your help - all working front end as expected.

Only thing now is that in the Admin Panel I have Testimonials as a nested page of about.php AND a stand alone template. I wonder if there's a way round this?

I may be better off putting a check for Testimonials in the about.php template after all?
As you know, @potato, our the admin-panel for now supports very limited customization.
I can't think of any way to hide the nested-page.
Perhaps you could just explain to the client the (peculiar) setup?
thanks for your help, I've got a much clearer understanding of masquerades/nested pages now. In this case I went with putting a comment for the client into the about.php template re the testimonials and didn't do the masquerade.

Looking forward to the new Admin Panel (whenever that may be ;) )
9 posts Page 1 of 1