Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hi all I'm new to CouchCMS and I'm finding it absolutely fantastic I'm struggling with cms:link though

so if i have a link like so
Code: Select all
<a href='faultcodes.php'  class="btn btn-info">View all Fault Codes</a>


it works and links to the correct page if however i add the cms:link like so

Code: Select all
<a href="<cms:link 'faultcodes.php' />"  class="btn btn-info">View all Fault Codes</a>


the it takes me to http://192.168.1.103/mediawiki/website/en-gb/index.php essentially just reloading the current page

thanks for you help

kind regards
tim
Hi Tim,

Your code is correct.
The <cms:link> tag returns empty if the specified masterpage (i.e. template) is not found as registered with Couch (and an empty link leads to the current page - which seems to be happening in your case).

So, please verify that 'faultcodes.php' is indeed registered as a Couch template.
An easy way to check this is by taking a look at the admin-panel sidebar - all registered templates are listed here, by default.

If the template in question is not found in the sidebar, you'll have to properly register it first (by adding the two PHP lines and visiting the template as super-admin, as demonstrated in the tutorial).

If, however, the template can be seen in the sidebar, then perhaps its name (as understood by Couch) is not simply 'faultcodes.php'. It could something like. e.g. 'test/faultcodes.php' etc. if the template does not reside directly in the site's root.
You can hover over your mouse cursor on its sidebar entry and a popup will show you the correct name.

Hope this helps.
perfect thankyou

it was that couch view was en/faultcodes.php as they reside in sub folders

Many thanks
tim
3 posts Page 1 of 1
cron