Forum for discussing general topics related to Couch.
11 posts Page 1 of 2
Thanks for the update! The nested pages options looks really promising, unfortunately I probably won't be able to try it out until the end of january. I still have some questions though:

As I understand it you have two options of "pointing":

redirect: redirect an existing page to a new place in the website's hierarchy
masquerade: implement a page into the website's hierarchy

Wouldn't it be easier if there would be just the masquerade/implement option? So that you would use the nested pages option to create the whole structure and just implement different pages like blog.php as kind of a source? It just seems that there are two different ways but just one would suffice.
I see that the redirect option might be useful for those who already have a fixed strukture within couch and don't want to change it. But if you create a new site or are willing to do things differently now, the redirect option seems kind of redundant. Of course, this is only the case if my next question is possible:

If you point to a clonable page can you use all the views in the nested one like in the cloned one? (www.yoursite.com/clonable-blog.php masqueraded in www.yoursite.com/blog/ - can I now do something like this www.yoursite.com/blog/blogentry.html or www.yoursite.com/blog/archive/ ?)
I guess this is why there is the "mark as selected for all pages below this link" option? Btw., you don't explain this in the documentation although you say you would.

And what happens if you have a clonable blog.php (www.yoursite.com/blog/ - prettyURLs of course) and create a nested page of index.php called blog (www.yoursite.com/blog/)?
Hi Klaus,

I'll try and answer all your questions -
..the redirect option seems kind of redundant. Of course, this is only the case if my next question is possible:

As you rightly pointed out, your first question is relevant only if the second question applies, which was -
If you point to a clonable page can you use all the views in the nested one like in the cloned one? (http://www.yoursite.com/clonable-blog.php masqueraded in http://www.yoursite.com/blog/ - can I now do something like this http://www.yoursite.com/blog/blogentry.html or http://www.yoursite.com/blog/archive/ ?)

Unfortunately, no - at least 'not out of the box'. Masquerade works perfectly for non-clonable templates (like e.g. 'contact.php') as these do not have any views.
So, the answer to your first question is that basically, redirect is the primary method for implementing menus. You'll find yourself using 'masquerade' only for very specific situations.

And what happens if you have a clonable blog.php (http://www.yoursite.com/blog/ - prettyURLs of course) and create a nested page of index.php called blog (http://www.yoursite.com/blog/)?

In this case, .htaccess will use the physically present page first which in this case would be the clonable 'blog.php'.

Hope this answers your queries.
Damn, and I thought all my problems fixed with masquerading cloned pages ;)... is something planned in this direction? But still a nice feature! And it keeps the admin panel a bit more compact.

Since the "customer" would now be able to add/delete pages by himself, are you thinking of implementing the maintenance mode into the admin panel? I know there have been some discussions concerning this but the end user got now quite some power over the page's structure.

And what does the "mark as selected for all pages below this link" option mean exactly? If I take the given example in the documentation:
Click on the 'View' button to visit http://www.yoursite.com/portfolio/. You'll notice that, instead of http://www.yoursite.com/portfolio/, you land up at http://www.yoursite.com/about-us/what-we-do/portfolio/.

Does it mean that if I would access http://www.yoursite.com/portfolio/somepage/ I'll land up at http://www.yoursite.com/about-us/what-we-do/portfolio/ as well?
Hi Klaus,

First of all, I owe everybody an apology. There was a slight mistake in the documentation.
The paragraph that you quoted
Click on the 'View' button to visit http://www.yoursite.com/portfolio/. You'll notice that, instead of http://www.yoursite.com/portfolio/, you land up at http://www.yoursite.com/about-us/what-we-do/portfolio/.

has the URLs reversed! It should actually read -
Click on the 'View' button to visit this nested page of ours. You'll notice that, instead of http://www.yoursite.com/about-us/what-we-do/portfolio/ (this nested 'portfolio' page's cardinal URL) , you land up at http://www.yoursite.com/portfolio/ by way of redirection.
This is because we configured the 'portfolio' nested-page to act as a pointer page to http://www.yoursite.com/portfolio/

Thank you very much for catching it. I have amended the documentation.

With this modification, perhaps the point that was troubling you will make proper sense. Please let me know.
..what does the "mark as selected for all pages below this link" option mean exactly?

This actually has to do with how a page is considered to be 'selected' (and hence marked as 'current' and 'active') in the menu.
The documentation at http://www.couchcms.com/docs/concepts/n ... maker.html has an entire paragraph (marked in yellow background) 'How the 'menu' tag recognizes a menu-item to be current requires a little explanation..'. Please have a look at that and I'm sure it will answer your query.

Damn, and I thought all my problems fixed with masquerading cloned pages ;)... is something planned in this direction?

Your comments on the feature actually made me give a second thought to it. I realize that the ability to masquerade a template 'completely' (i.e. all the views etc.) and thus for all practical purposes actually be able to put that template at any arbitrary position in the menu tree, is a powerful feature.

Implementing it will require some fundamental rewiring of Couch internals, though. I cannot promise but I'll definitely try to get this feature in.

Thanks
Hi Klaus,

As promised in my last post, I went ahead and made the modifications that you suggested in the 'masquerading' feature (please see the revised 'Masquerading' section in http://www.couchcms.com/docs/concepts/n ... maker.html).

In short - a nested-page masquerading as a separate section (e.g. portfolio or blog) now does so completely i.e. masquerades all the views of the section (page-view, list-view, home-view, folder-view, archive-view etc.). All the URLs of the masqueraded section get modified automatically without making any changes to the section at all.

With these changes implemented, I think I could answer your original question a little differently -
Wouldn't it be easier if there would be just the masquerade/implement option? So that you would use the nested pages option to create the whole structure and just implement different pages like blog.php as kind of a source? It just seems that there are two different ways but just one would suffice.

The two options serve totally different needs (albeit a little overlapping). The revised documentation (http://www.couchcms.com/docs/concepts/n ... maker.html) has a table comparing both the options. In short
Redirect - is meant primarily to create 'menus' where the menu-items simply serve to redirect the visitors to the right sections of the site.
Masquerading - is meant to virtually relocate an entire section anywhere within the site's hierarchy created using the nested-pages.
If you point to a clonable page can you use all the views in the nested one like in the cloned one? (http://www.yoursite.com/clonable-blog.php masqueraded in http://www.yoursite.com/blog/ - can I now do something like this http://www.yoursite.com/blog/blogentry.html or http://www.yoursite.com/blog/archive/ ?)

Yes. That is what has changed. In fact, now if you try to access the masqueraded section (or any part of it) using their original URLs, you'll be send back to the new URL imposed by the nested-page.

I'd appreciate if you could take the time to try out this new feature and send in your feed back.

Thanks.
Wow, that's simply awesome!! ;) Thank you very much!

Unfortunately I won't be able to really test something until around the end of the month but I'll check out the new documentation tonight.
Since I'm now trying to figure out how to improve my website's structure with the new features I gave the new masquerading option some thought. The thing that "bothers" me now is that I can only masquerade a template once. It would be really awesome if that wouldn't be the case :D.

Perhaps if there is an option to declare a template purely as some sort of "source" which can only be masqueraded but in multiple instances?

And I'm not sure if I ever need it, but is it possible to declare a template as nested AND clonable? ;)
Hi Klaus,
The thing that "bothers" me now is that I can only masquerade a template once. It would be really awesome if that wouldn't be the case

Masquerading effectively places the template being masqueraded into a new place within the site's hierarchy. This means that the URL of the template (and all its views and pages) get modified.
If, as you ask, the template was permitted to be masqueraded more than once - it will now have more than one canonical URLs. Not at all good for SEO (not to mention being confusing as well).

if there is an option to declare a template purely as some sort of "source" which can only be masqueraded but in multiple instances?

Could you please give me some concrete instances of where and how you'd want to implement this? We could work out something else other than masquerading to achieve it once it becomes clear what exactly is required. Do let me know.

but is it possible to declare a template as nested AND clonable?

Actually, a template needs to be clonable to be nestable :) Think about the various nested pages of 'index.php' forming the site tree - each of them is a cloned page which makes index.php clonable as well as supporting nesting.
KK wrote: Hi Klaus,
[...]
Could you please give me some concrete instances of where and how you'd want to implement this? We could work out something else other than masquerading to achieve it once it becomes clear what exactly is required. Do let me know.

You answered to quickly, I just wanted to edit my old post ;)... Well I'm not sure if my initial idea was well-thought-out, but this was what I wanted to do with it:
It's still the old problem of a bilingual website: in my clonable events.php I can upload flyers, pictures etc as well as enter descriptions in two different languages. My idea was now to be able to masquerade the template twice and then just display the data in the different languages on the website. This way I would shorten the process of setting up a new event (since I would only have to enter/upload pictures, files etc once - things that are language independant). And it would keep the admin panel "cleaner" since I would have only on entry for events.php instead of de/events.php and en/events.php.

but is it possible to declare a template as nested AND clonable?

Actually, a template needs to be clonable to be nestable :) Think about the various nested pages of 'index.php' forming the site tree - each of them is a cloned page which makes index.php clonable as well as supporting nesting.

Sorry, what I meant was if it's possible to create via a nested page always a clonable "blog". Every nested page of 'index.php'... eh, I guess you're right :D.
Klaus, hopefully I am understanding you correctly. One thing you could consider is using a querystring to declare the client's language. One way to implement this would be to list the available languages in html, with each linked as so: "<cms:show k_page_link />?lang=*". You would replace the * with the desired language, such as en, de, or fr. Then for each page where you have different languages available, you could use some if tags to display the correct language. Here is an example page:
Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template>
<cms:editable name='picture' type='image' />
<cms:editable name='description' label="English Description" type='text' />
<cms:editable name='description_de' label="German Description" type='text' />
<cms:editable name='description_fr' label="French Description" type='text' />
</cms:template>

<cms:set language="<cms:gpc 'lang' method='get' />" />

<cms:if language >

<!-- Other Languages Page Below -->
<img src="<cms:show picture />">
<p><cms:if language = 'de' ><cms:show description_de /></cms:if><cms:if language = 'fr' ><cms:show description_fr /></cms:if></p>

<cms:else/>

<!-- Default English Page Below -->
<img src="<cms:show picture />">
<p><cms:show description /></p>

</cms:if>
<?php COUCH::invoke(); ?>

The above assumes English is the default language. I couldn't come up with a more dynamic method of displaying the other language description, as <cms:show description_<cms:show language /> /> obviously doesn't work. Maybe KK could help you come up with one if you decide to pursue this method.
11 posts Page 1 of 2