Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
good afternoon! I wonder if I am trying to do something not do-able?

I have a non-cloneable template - news.php and a cloneable template news-items.php. news.php has a few editable fields of its own and I can list the news from news-items.php.

However I'm wondering if it's possible to use cms:archives to have sub-navigation on news.php to list the cloneable news-items.php by year? I have previously done this but only where I have been using a single cloneable template.

I think I will have to recreate news.php as a cloneable page (scrapping news-items.php) and go down that route. Please could you confirm this. Thanks!
Hi,

The cms:archives tag supports the 'masterpage' parameter so, theoretically, you can use this tag in 'news.php' and yet list entries from 'news-items.php'.
However, the links outputted by the tag will point back to news-items.php, which I suppose is not what you desire (I think you'd want then to link to news.php).

While we can hack around this problem, I really don't think this is worth all the hassle (we'll need to keep track of the GET variables passed through querystring etc. Basically duplicating functionality that is already provided by Couch)

The most natural way in Couch would be to use a single template for both listing and showing single pages.
In your case, this would be the news.php template (any editable regions unique to the home-view can go into a global template).

Instead of scrapping news-list.php and recreating everything with news.php, I suggest you rename news-list.php to news.php.

CAUTION: Renaming a template without losing data will require direct manipulation of the database.
The procedure is very simple though (you might want to take a backup of the database in any case) -


This is the procedure -
1. Delete the physical template 'news.php' from the disk. Access admin-panel and it will prompt you to remove the template's entry from Couch. Do so.
2. Access the database (using phpMyAdmin or any other DB manager that you have) and browse the 'couch_templates' table.
Each of the template that the site consists of will have a record for itself in this table.
We'll be interested only in the 'name' column. Find the record displaying 'news-list.php' in the 'name' column and change the value of the name from 'news-list.php' to 'news.php'.
3. Rename the physical template from 'news-list.php' to 'news.php'.
Coming back to the admin-panel you should see that news.php now shows all the cloned pages.

Hope this helps.
Thanks for your advice - and very clear instructions, much appreciated. All sorted and functioning as expected :)
You are welcome :)
4 posts Page 1 of 1
cron