Thanks.
Taking the example of the page named 'the-audrey-dl-invitation' -
it is actually a cloned page of 'a5-traditional.php' template.
It's URL is
After you enable prettyURLs the link will become
So basically your putting '.php' after the name will not work (and ergo the 404 error).
So the problem at hand boils down to how to generate the right link to a page given only the page-name.
If all the target pages belong to the same template (i.e. a5-traditional.php), the solution is easy.
Let the client enter only the page_name in the link field (page_name is what you see right below the 'title' in admin-panel) - just copy/paste whatever is seen in the target page. Add nothing to it.
Now on the front-end we can get the link by doing this -
As you can see, we use cms:link tag to get the URL (http://www.couchcms.com/docs/tags-reference/link.html).
We are assuming all the pages belong to 'a5-traditional.php' template so we can hard code the template's name.
If, however, the pages belong to several templates things will get complicated as we need to know the template's name as well. In such case it'd be better to paste in the full URL of the target page (i.e. http://www.yoursite.com/a5-traditional.php?p=35) and the cms:link tag won't be needed.
Do let us know how it goes.
Thanks
Taking the example of the page named 'the-audrey-dl-invitation' -
it is actually a cloned page of 'a5-traditional.php' template.
It's URL is
http://www.yoursite.com/a5-traditional.php?p=35
After you enable prettyURLs the link will become
http://www.yoursite.com/a5-traditional/the-audrey-dl-invitation.html
So basically your putting '.php' after the name will not work (and ergo the 404 error).
So the problem at hand boils down to how to generate the right link to a page given only the page-name.
If all the target pages belong to the same template (i.e. a5-traditional.php), the solution is easy.
Let the client enter only the page_name in the link field (page_name is what you see right below the 'title' in admin-panel) - just copy/paste whatever is seen in the target page. Add nothing to it.
Now on the front-end we can get the link by doing this -
- Code: Select all
<a href="<cms:link masterpage='a5-traditional.php' page=pagelink />" >..</a>
As you can see, we use cms:link tag to get the URL (http://www.couchcms.com/docs/tags-reference/link.html).
We are assuming all the pages belong to 'a5-traditional.php' template so we can hard code the template's name.
If, however, the pages belong to several templates things will get complicated as we need to know the template's name as well. In such case it'd be better to paste in the full URL of the target page (i.e. http://www.yoursite.com/a5-traditional.php?p=35) and the cms:link tag won't be needed.
Do let us know how it goes.
Thanks
