Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hello,

I have a problem, i want to move my couch directory but when i did it, it duplicates my template.

My site is a one-page with two directory: /fr/index.php and /en/index.php

My couch directory is in the /fr/couch/... I didn't know there will be 2 language in the site when i installed couch.

I want to move it like this:
couch/fr/index.php / couch/en/index.php

And when i make this, it duplicated my template (there is 2 same template). And i can't delete it. Look at the attached file, the two template are exactly the same but i have only one file with couch activated.

What can I do?

Best regards,

Haymoz Jonathan

ps: Sorry for my bad english :D

Attachments

Salut Haymoz et bienvenue sur notre site :)

In Couch, the 'name' of a template is actually its physical path relative to the site root (which is the parent of 'couch' folder).

So, for example, if a folder structure is as follows -
Code: Select all
www
   |_test
      |_couch
      |_fr
         |_index.php
      |_index.php

the root is considered to be 'test' (and not 'www') and the names of the two templates are 'index.php' and 'fr/index.php' (see how they are relative to 'test' which is the parent folder of 'couch' and hence is seen as the site root).

Now with that understood, consider what happens if
1. we move any of the templates to other folder or
2. move the 'couch' folder itself

In both the cases above, the paths (and hence the names) of the templates will change.

Problem is, when the name of a template changes, Couch has no way of knowing that it is the same template that was previously registered. Since the names are different Couch thinks you are registering a new template and creates a new entry.

Which is what is happening in your case.
If you hover your mouse on the two entries in the sidebar you'll see the 'names' (i.e. the paths) of the two templates and both will be different.

OK, so that raises the question as to how do we change the paths of existing templates?
Ideally you shouldn't do this once a template is registered.
If it must be done, then it'd require manipulating the database directly. You'll find details in this thread - viewtopic.php?p=9880#p9880

In your case, since it is a single page site, I think the best way would be to delete all templates altogether and starting afresh.

Hope this helps.
Thank you :)
3 posts Page 1 of 1