Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
I have a site setup using the nested pages feature. I am trying to use the nested_pages tag to output the title. What I want is the title of page currently being viewed to be outputted. The line of code below worked on my local but does not when live. It outputs nothing.

I have figured out that using root='@current' is part of the menu tag and not the nested_pages tag. Removing this results in every title being outputted multiple times.

How do you restrict it to display just the results from the page currently being viewed.

Heres my code:

Code: Select all
<h1><cms:nested_pages masterpage='index.php' root='@current' depth='1' ignore_show_in_menu='1'><cms:show k_nestedpage_title /></cms:nested_pages></h1>


Thanks.
Hi Mark,

I have figured out that using root='@current' is part of the menu tag and not the nested_pages tag.

In fact, root='@current' is a part of nested_pages tag too. The 'menu' tag internally uses the 'nested_pages' tag so everything you can do with menu tag can also be done with nested_pages.

So, the code you pasted should actually work.
Please try putting in a <cms:dump /> between the nested_pages tag to see what we get. It might help.

Finally, if you merely wish to output the name of the page being visited, you can simply use the regular <cms:show k_page_title /> anywhere in the page-view ( a nested-page is a page too). Put a cms:dump in the page-view to take a look at the variables available.

Hope this helps.
Thanks
Hi,

Inserting <cms:dump /> between the nested_pages tag yields no results. If I remove the root='@current', the dump works.

I have managed to get it working but I needed to add an empty <cms:nested_pages masterpage='index.php'></cms:nested_pages> above the code I had already posted. All works fine.

I would have used the k_page_title tag but I am also using the nested pages to output a short intro paragraph relating to each title. Some of these paragraphs are defined in the pages created by the nested pages and some by another template (no executable) I had to setup due to a limitation in the clonable templates.

Its a little complicated but it seems as long as the empty nested_pages tag is in there is works. Not perfect obviously.

Any ideas why this might be happening?
Hmm.. this is intriguing. More so because the same code works fine on your local setup as well as mine.

If possible, please grant me FTP/Couch access to your server and I'd be glad to try and troubleshoot the issue.

Thanks
Just wanted to close this thread off.
Thanks to KK for helping me solve the problem. Much appreciated.
5 posts Page 1 of 1