Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi guys i've been working in the menu maker of my project and i relize that if i clone pages from my index template all cloned pages will share the same structure and editable regions but in my case and i think in almost any project the index is totally different than the rest of the pages so i can make it display something if its page and anything else if is the list view but then how can i make page-view and list-view have different editable regions and if i can do it how to edit the index if iti is really the list view of the cloned pages maybe i'm missing something but i cant figure out how to solve this
Hey after a while i was able to accomplish the task following this post: http://www.couchcms.com/forum/viewtopic.php?f=2&t=7009 where kk gives the solution :
Code: Select all
<cms:if k_is_page>
   <!-- Page view -->
   <h1><cms:show k_page_title /></h1>
<cms:else />
   <!-- Display home page here -->
   <cms:masquerade "http://www.yoursite.php/some-page.html" />
</cms:if>

Nevertheless doing it like that i found that the URL of my site looked like http://localhost:8080/some-page/ but i want it to look cleaner, just http://localhost:8080 so i did:
Code: Select all
<cms:if k_is_page>
   <!-- Page view -->
<cms:else />
   the regular html code from my index page and tags like:
   <img src="<cms:get_custom_field "image" masterpage="home.php" />">
   to display the editable regions defined in home.php wich is the template i want for my index

</cms:if>

Dont know if is the best way but works for me so maybe this helps someone else
Hi,
Nevertheless doing it like that i found that the URL of my site looked like http://localhost:8080/some-page/ but i want it to look cleaner, just http://localhost:8080
cms:masquerade requires 'curl' extension to be enabled. If not, it falls back upon cms:redirect which is what seems to be happening in your case.
Please enable 'curl' and you'll find that the URL will not change (i.e. remain the same as the calling page).

That said, the second method used by you is equally valid. So, you can go with whichever of the two suits you.

Thanks.
3 posts Page 1 of 1