Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
I'm not sure if this has been addressed before - apologies if so, I can't find an answer.

Is there a reason why we shouldn't activate shortcodes routinely for all templates - in case the client wishes to use an email shortcode for example? Is there an impact on performance? I was wondering whether to set up the option for a client to 'switch on' shortcodes for a template in the Admin Panel - but if it makes no difference then I'll simply activate them anyway within the template using the <cms:do_shortcodes> tag. I would wrap the whole page in the opening and closing shortcode tags.

But since the tag exists in the first place I assume there may well be a reason why shortcodes should only be 'activated' if they are needed?
There could, potentially, be tens of editable regions and not all are likely to contain shortcodes as input (typically it is the main richtext editable region).

Processing shortcodes entails searching through the inputted text for any shortcode that might be present in it - it may not be a perceptible performance hit but nevertheless would be wasteful if we make Couch search through all editable regions (of which only one or few are going to contain shortcodes).

Therefore it is prudent to explicitly indicate precisely which editable region is likely to contain shortcodes.
if your usecase dictates that the shortcodes might be present in any of the editable regions, then by all means go ahead and do as you planned.

Hope this answers your query.
2 posts Page 1 of 1