Hi,

today I discovered, that it is also possible to relate one page to several others in the same template. For example, a dress can have additional colors.

Suppose, your template with dresses is clonable and used with couchcart. Every product, of course, has a price and some other settings, like available/on sale/new etc.

It is comfortable then to add pictures of the dress in all available colors. And establish relation between the 'main dress' and 'siblings' (differently colored ones).

Technique is described as reverse_relation editable. It is available on forum. However, now we establish the setup in one template and it's working too!

Paste this code to existing clonable template.
Code: Select all
<cms:editable label = "Other colors'"         name="rev_relation_<cms:show k_template_id />"
                desc = "View and add colors"
                type = 'reverse_relation'
                masterpage = 'dresses.php'
                anchor_text = 'View'
                field = "relation_<cms:show k_template_id />"
                />
  <!--establish relations within template-->
  <cms:editable label = "<br>Relation with '<cms:show k_template_title />'"   name = "relation_<cms:show k_template_id />"
                desc = "Main dress for this color"
                type = 'relation'
                masterpage = "<cms:show k_template_name />"
                has='one'
                no_gui = '0'
                />

To conclude, change 'dresses.php' to the real template name and you are set.

If I had played with it before, I might had done very differently the eCommerce website with main product and its color variations. Main dresses without variations can be listed easily. Only show pages, which are not related to any other. That's it.