Problems, need help? Have a tip or advice? Post it here.
13 posts Page 1 of 2
How can I get all the cloned pages, which has a certain title?

Something like this?
Code: Select all
<cms:pages masterpage='template.php' page_title='the title'></cms:pages>


-Thanks in advance
Would page_name do the job for you?

Code: Select all
<cms:pages masterpage='template.php' page_name='the-title'></cms:pages>
potato wrote: Would page_name do the job for you?

Code: Select all
<cms:pages masterpage='template.php' page_name='the-title'></cms:pages>

Nop, Im afraid I need the actual title. I want to get all the pages having a specific title but different names obviously.
of course ...

How about putting an IF within the cms:pages tag
Code: Select all
<cms:pages masterpage='template.php'>

<cms:if k_page_title eq 'the title' >

.............

</cms:if>

</cms:pages>


May not be the most efficient - but I am guessing that unless you have 1,000s of pages it will be OK.
Hi all :)

A few days back, I ran into a use-case that necessitated fetching pages by titles.
And, to my horror, I realized that cms:pages tag has no provision for doing so :shock:

I am surprised that I missed implementing it in the first place (although all the indexes are in place in the database - so definitely I was preparing for it) but am even more surprised that it took four years before anyone actually asked for such a thing :)
Perhaps that is because, as @potato suggested, usually 'page_name' suffices for the same search.

Anyway, I'll fix this in the code-base now for the coming versions of Couch.

@mercurial, if this issue is vital for your project, would you want me to code up a temporary fix for you?
Please let me know.
KK wrote: @mercurial, if this issue is vital for your project, would you want me to code up a temporary fix for you?
Please let me know.

I could let it auto_title and change all references of title to a new field instead, but if its not too much trouble, It'd be great if you could indeed provide a fix, esp if you would anyway need to write the code for future versions of couch.

-Thanks
Not a problem @mercurial.
Which version of Couch is your site on? 1.4 or 1.4.5RC?
KK wrote: Not a problem @mercurial.
Which version of Couch is your site on? 1.4 or 1.4.5RC?


Code: Select all
CouchCMS - Simple Open-Source Content Management v1.4 (build 20140117)


-Thanks
It's not so obvious task, the solution should be reGisteR reliable (or not?) and UTF-8 based for non-english languages, so personally I prefer @potato's solution or use page_name, because it makes lowercased '-' separated titles that are more reliable..
potato wrote: May not be the most efficient - but I am guessing that unless you have 1,000s of pages it will be OK.

Unfortunately, I happen to have 1000s of pages, so waiting for @KK 's temporary fix instead.
13 posts Page 1 of 2