Unfortunately, original tag <cms:link> chokes if parameter masterpage='' not provided i.e. No masterpage, no link..
There is a solution!
All pages in CouchCMS have a unique numeric ID, assigned by database for each created page and available to us in the variable k_page_id.Therefore masterpage input from user is absolutely not required in such case since it can be taken from database.
What I did works very reliably:
1. Can get a link if masterpage is unknown, empty but id is provided => by getting masterpage from db and feeding it to original tag.
2. Original tag's param is called page_id, my mod allows a synonym id as well.
The rest of the usual parameters work as expected (refer to http://docs.couchcms.com/tags-reference/link.html ) and masterpage is required for any parameter other than 'id'.
There is a solution!
All pages in CouchCMS have a unique numeric ID, assigned by database for each created page and available to us in the variable k_page_id.Therefore masterpage input from user is absolutely not required in such case since it can be taken from database.
What I did works very reliably:
1. Can get a link if masterpage is unknown, empty but id is provided => by getting masterpage from db and feeding it to original tag.
2. Original tag's param is called page_id, my mod allows a synonym id as well.
- Code: Select all
<cms:link id='12345' />
The rest of the usual parameters work as expected (refer to http://docs.couchcms.com/tags-reference/link.html ) and masterpage is required for any parameter other than 'id'.