by
KK » Sat Jul 06, 2024 2:37 pm
Do i add gobals.php file to core or couch folder?
All templates are added to the site folder itself (and *not* in the 'couch' folder).
After placing your globals.php in the site root make sure to visit it on the front-end as super-admin to register it.
Coming to the code where you use data entered into globals.php -
Since you are using 'repeatable region', your code would need to be modified as follows -
- Code: Select all
<!-- sub-menu start-->
<ul class="sub-menu">
<cms:pages masterpage='globals.php' limit='1'>
<cms:show_repeatable 'chinese_product_menu'>
<li>
<a href="<cms:show chinese_product_link />"><cms:show chinese_product_name /></a>
</li>
</cms:show_repeatable>
</cms:pages>
</ul>
<!-- sub-menu end-->
Notice above how we are using <cms:pages> to get data from globals.php and then using <cms:show_repeatable> within it to loop through the repeatable region and output its rows.
Hope this helps.