Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
@KK, is there a way to access either global variable or system variable k_selected_limit within child tags?

Code: Select all
<cms:set limit_list = "20" scope='global' />
<cms:config_list_view limit=limit_list >

        <cms:script>
         // limit: <cms:show limit_list /> ?
        </cms:script>

</cms:config_list_view>
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
@trendoman, as you know, all code within <cms:config_list_view> is executed in the context of the admin-panel (and not the front-end template where it is defined) - so, in your example, when <cms:script> executes, it will try to look for a variable named 'limit_list' in the admin-panel - where it will not be found.

Unfortunately, the 'k_selected_limit' variable is not yet set when <cms:script> executes so that is not accessible either.

Which leaves us with the only option of directly querying the database (which is where the configuration set using <cms:config_list_view> is saved). If you take a look at 'couch/edit-pages.php', you'll find this happening in 'list_action()'. You can create a custom tag that duplicates that operation and returns back the value of 'limit' found.

Let me know if you happen to need any help with the process.
2 posts Page 1 of 1
cron