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

I have run into a small issue which i hope you can help me with.

I have created a very simple blog and i have named the page blog-item, list view.

I would like to rename the item to Blog.

When testing local i get a duplicate in the admin panel.

Example:

Old page: blog-item.php
New Page: blog.php

How does one go about renaming the page and updating the admin with the new edited name?

Kind Regards
Alex
Hi Alex,

Simply renaming a template, as you have found out, makes Couch think you are adding a new template.

The right way to rename a template involves manipulating the database directly.
The process is pretty simple so nothing to worry about (although I strongly advice you to please take a database backup before manipulating it).

I'll list the procedure below but before that let us delete the spurious blog.php - simply rename it back to blog-list.php. Now in admin panel when you visit blog.php you'll see the message that the 'template is missing'. Remove the template from the panel too.

OK, so now we only have the blog-list.php to contend with.

Use phpMyAdmin (or any other database manager at your disposal) to browse the database being used by Couch.
1. Find the 'couch_templates' table. You'll find that it has an entry each for every template comprising your site.
2. Find the row for 'blog-list.php' and rename it to 'blog.php'.
3. Finally, now rename the physical PHP file from 'blog-list.php' to 'blog.php'.

And that should be it.
Hope this helps. Do let us know.

Thanks.
KK wrote: Hi Alex,

Simply renaming a template, as you have found out, makes Couch think you are adding a new template.

The right way to rename a template involves manipulating the database directly.
The process is pretty simple so nothing to worry about (although I strongly advice you to please take a database backup before manipulating it).

I'll list the procedure below but before that let us delete the spurious blog.php - simply rename it back to blog-list.php. Now in admin panel when you visit blog.php you'll see the message that the 'template is missing'. Remove the template from the panel too.

OK, so now we only have the blog-list.php to contend with.

Use phpMyAdmin (or any other database manager at your disposal) to browse the database being used by Couch.
1. Find the 'couch_templates' table. You'll find that it has an entry each for every template comprising your site.
2. Find the row for 'blog-list.php' and rename it to 'blog.php'.
3. Finally, now rename the physical PHP file from 'blog-list.php' to 'blog.php'.

And that should be it.
Hope this helps. Do let us know.

Thanks.


Hi KK,

You know I was thinking that would be the way to do it, im so sorry to waste your time.

Thank you very much :)

Regards
Alex
Hi KK,

I have applied what you said and i get the following error:
Code: Select all
Error: masterpage: "blog-item.php" not found.


What is causing it to look for blog-item.php?

Regards
Alex
You must have something like a pages tag still looking for blog-item.php. It should be safe to find/replace blog-item.php with blog.php.
Hi

It was in my snippets, thanks again for the amazing support :)

Regards
Alex
6 posts Page 1 of 1