Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi KK,

I have two clonable templates 1 and 2 and I want to call some pages based on a condition.

I have template 1 in which i want to call some pages from template 2 which satisfy the following condition:

Code: Select all
<cms:pages masterpage='template2' custom_field='custom_field_of_template 2=k_page_title' ></cms:pages>


Here, the k_page_title is the field from template 1.

I hope you understand what i'm trying to ask. Please help.
Hi Richie :)

Yes, I do understand what you are trying to ask.
I think the following should do it -
Code: Select all
<cms:pages masterpage='template2.php' custom_field="custom_field_of_template_2=<cms:show k_page_title />" >
    ...
</cms:pages>

The important point in the code above is the use of double-quotes with the 'custom_field' parameter. It causes the code enclosed within it to be evaluated by Couch before using it.

So, assuming the code is placed in a page-view of template1, the <cms:show k_page_title /> will evaluate to the title of the current page of template1.

Hope it helps.
Thanks KK! Works like a charm :D

one more thing, how do i combine two custom field queries while using this ? i tried the pipe and it didn't work.

edit: figured it out :)
3 posts Page 1 of 1