Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
A client wants to re-organise the structure of 2 sections of their website built using Couch.

Current organistion:

Resources (top level page)
Resources / Articles
Resources / Tips
Resources / Factsheets
Resources / Protocols


Certification (Top Level)
Certification / Calculation Worksheets
Certification / Certificates of Analysis
Certification / Datsheets
Certification / MSDS
Certification / Test Kit Instructions
Certification / Order Forms & Labels


New Structure:
Articles (Top Level)
Articles / Tips

Resources (Top Level)
Resources / Factsheets
Resources / Calculation Worksheets
Resources / Certificates of Analysis
Resources / Datsheets
Resources / MSDS
Resources / Test Kit Instructions
Resources / Order Forms & Labels
Resources / Protocols

I'm happy with what I have to do regarding the 301 redirects I will need to put in place.
KK - the 301 redirects will have to go after all the standard Couch redirects - am I correct?

What I'm looking for advice on is how to 'move' the posts to a different section.
I can rename Resources to Articles
and then rename Certification to Resources
That covers most of it.

How do I 'move' the posts in:
(old) Resources / Factsheets
(old) Resources / Protocols

to
(new) Resources / Factsheets
(new) Resources / Protocols


Has anyone done this before?

KK - is this possible?


I hope I've explained myself clearly, shout if you need further clarification.

Thanks guys



webecho

Hi Dan,

Renaming templates will involve some manipulation to the database too for avoiding data loss.
Please see my reply in the following thread for details -
viewtopic.php?f=4&t=7232

Do let me know if anything is unclear.
Make sure to take a phpmyadmin database backup before making any changes and you should be safe.

OK, so with that you'll change 'Resources' into 'Articles' and 'Certification' into 'Resources'.
However, this will move *all* pages into the new template name. We cannot selectively choose which pages will be moved.

So, you'll end up with -
Articles (top level page)
Articles / Articles
Articles / Tips
Articles / Factsheets
Articles / Protocols

Resources (Top Level)
Resources / Calculation Worksheets
Resources / Certificates of Analysis
Resources / Datsheets
Resources / MSDS
Resources / Test Kit Instructions
Resources / Order Forms & Labels

That would leave the following at the wrong location -
Articles / Articles
Articles / Factsheets
Articles / Protocols

You'll have to manually recreate these sections (along with all the pages) within the new template deleting them from the original location, I am afraid.

If the number of pages is high, you may want to look at the CSV importer (viewtopic.php?f=5&t=8803) to get this migration done.

In our case, we do not need a CSV file since the data is available as Couch pages. Adapt the code to use <cms:pages> instead to loop through the left out pages in 'articles' and recreating them in 'resources'. Once that is done, delete the now duplicated pages from articles.

Hope it helps.

Thanks KK
Yeah I figured i would need to recreate the posts that were moved to a different 'category'.
I wasn't aware that renaming the templates could cause problems, so thanks for the heads up.

Most of the ones I need to recreate would work with a simple copy and paste, I'm being paid hourly :) and I did warn the client that this might be the case, so aside from a bit of boring work, it's all ok.

My biggest concern was / is the SEO, but I think with the right 301's I can cover that with 'almost' no detriment to their rankings (or at least, no detriment for more than a week or two while Google works it out).


As always mate, thank you for you quick and detailed advice.

Much appreciated


webecho

You are always welcome :)

I missed replying to one other question you had -
KK - the 301 redirects will have to go after all the standard Couch redirects - am I correct?

I am marking out the location where you can place the new redirects -
...
#If your site begins with 'www', uncomment the following two lines
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

#custom redirects

#end custom redirects


#DO NOT EDIT BELOW THIS
...

Hope it helps.

Glad you mentioned it - I thought my custom ones would come after the Couch ones

Thanks :)


webecho
5 posts Page 1 of 1