Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Hi. Am a complete noob to couch, and am enjoying what I'm seeing so far but just trying to work out how to achieve a couple of features I'm trying to implement.

I'm planning on having pages for products within product groups by using the nested pages feature, so I can build up a hierarchy and use masquerading to get my structure there. I'm not doing this as a cloned template, because I want the template to be different for the different product ranges / products, rather than one consistent template between the products.

What I then am planning on having is a news page which would be a normal cloned template, with text / a lightbox style gallery, but also want to have a list of "related products" on the page which can be set. So news item 1 which is about someone using product A and product B, would have links / thumbnails to product A / product B shown.

I'm looking at the "relationships" feature at the moment, but as far as I can tell, this is only allowing you to set a relationship to a cloned page. However as my products are just a nested page, not a cloned page, I'm not sure if this will work.

Is there a way to have a field which is essentially an arbitrary list of other pages available on the website which I can link to, or is there a way I can swap things around so that it'll be treated as a cloned page correctly but with different templates?

Thanks in advance!
So, when you're showing the page for "Product A", you'll also want to display at the bottom of the page a list of "related products" - which may or may not be of the same template as the current product being displayed. Is that correct?

If this is the case, you can certainly do this in Couch. Start by asking yourself what is the criteria you're going to use to display these products in the "Product A" page. How are these products related to "Product A"?

If you're going to display, for instance, products that have a similar price, then just search for that across all your product templates, and display it. If you're going to display the products most recently updated, then there is no real 'relation' between the current product and the ones being displayed - simply do a search across all templates for the most recently updated items. Define clearly what the search should be, and then you'll be able to more easily see how to do it in Couch.

I hope this helps!
Thanks for the reply!

So, when you're showing the page for "Product A", you'll also want to display at the bottom of the page a list of "related products"


It's the news pages in which I want to be able to specify related products, and it's something where I pick them manually, rather than it being an automatic thing. So when we have on our website a news story where someone's used Product X and Y on a certain job, then I want to be able to have, in the admin side, something where I can select product X and product Y in a list, and then use this in a list.

I could possibly try a repeated element on the news pages, but ideally I want an editable field of type "link" or something like that where I can pick another existing page on the website to link to.

Related products *between* product pages aren't as much of an issue, as that I'll pretty much manually tailor to fit the design. Maybe a "everything in a certain level" list, but I imagine I can work that one on my own!

EDIT: I think after poking around on my own, I've managed to suss it out.

However as my products are just a nested page, not a cloned page, I'm not sure if this will work.
Of course this isn't true. Nested pages are an extension of cloned pages, so actually when you add a editable relationship to the news page, then you get a list of any pages and page pointers which are in the nested page structure.

So that seems to work now!

EDIT 2: So the related_pages tag shows up a link from the news pages to the product pages okay. But sticking a reverse_related_pages from the pointer pages, back to the news pages doesn't seem to work. Putting the code in the products.php file (either in home view or a page view) where it's not a pointed page is okay and shows up a link list. As soon as it goes into a pointed page though, the page context doesn't load as it's a redirect, rather than an actual page (e.g. when I do a dump_all, things like parent id's, next_nestedpage, prev_nestedpage and the k_page_folder* flags don't appear)

I then thought it may be because I only had the links in my nested list set to redirect rather than masquerade as per http://www.couchcms.com/docs/concepts/n ... maker.html, but then I realised that I've only setup the nested links for the products.php page and deeper, and not for the index.php which it says it needs.

Any ideas what I should try next? Do I just have to enable nested pages on the whole site? Or is there a magic way to get them to play ball?
As a slightly related additional question to the above, at the moment, I have the individual target pages (one for each product) showing up separately in the list on the left. Is there any way to group these together under a single collapsible menu item at all to keep the menu tidy for those editing? Something like specifying a group as part of the order in the cms:template tag?
Hi Wol :)

The way related-pages are displayed in the admin-panel is rather coarse for now. A bland long list of pages is, I'm afraid, all that it is available.

Things are slated to change in the near future, though, to show up related-pages in two panels - the left would allow filtering/searching the target pages while the right panel would show the selected pages. Apart from a better UX it would also be a scalable solution when dealing with a huge number of pages.
5 posts Page 1 of 1