Important announcements from CouchCMS team
237 posts Page 24 of 24
Previous 1 ... 20, 21, 22, 23, 24 Next
Hi,
I'm trying to add the k_up_down field to the manage folders area of a particular template.

so far i've created a content_list_inner_folders__folder_shop-php.html which targets the particular template, but i cannot figure out how to add the k_up_down field selectively and get it to work.

I've tried adding it to the defaults in edit-folders.php:
Code: Select all
       function _default_list_fields(){
            global $FUNCS;
            $arr_fields = array();

            // other fields removed for brevity

            $arr_fields['k_up_down'] =
                array(
                    'weight'=>'40',
                    'header'=>' ',
                    'class'=>'up-down',
                    'content'=>"<cms:render 'list_updown' />",
                    'sortable'=>'0',
                    'sort_name'=>'weight',
                    'listener'=>array( 'pages_list_post_action', array($this, '_updown_handler') ),
                );

            // other fields removed for brevity

            return $arr_fields;

Which adds the column (but to all templates). But does not function.
Which led to investigating the _updown_handler, which doesn't exists in KFoldersAdmin class.

So,

1 - is it possible at all?
2 - can the field be added selectively (per template) in some way?
3 - if i have a go at the handler any pointers?

thanks to all and any :)
Hi there. I try to customize list screen. Is there anyway to show image on list screen? I tried some way but It shows only source of image :((
@gokmenbekar, please share what you have tried so far.
I wanted to select an icon for a template, so had to find the openiconic website. Then wrote this function that shows all icons on page with code to copy-paste — <cms:call 'show-icons' /> and now it's much faster to explore the exact collection available from Couch. :)

Attachments

Nice utility function, @trendoman :)
I am doing some coding and needed to remind myself the order of execution of various 'theme' parts. I logged the printout and think it could be useful for others in this topic. In short, the <cms:html> block is the first, with individual and custom cms:fields in config_form_view are always the last to run dynamic content.

order-of-execution-in-page-save.png
order-of-execution-in-page-save.png (26.21 KiB) Viewed 68452 times


And a tip for stopping the 'Edit' page after submit and to avoid redirect after clicking 'Save'. In theme snippet content_form.html there is this line: <cms:if k_redirect_link>, it can be changed to code -
Code: Select all
<cms:if k__is_superadmin && "<cms:gpc 'debug' />"><cms:set my_permission_revoked = '1' /></cms:if>
<cms:if k_redirect_link && "<cms:not my_permission_revoked />">
...

Instead of variable k__is_superadmin (which is a custom variable in my theme), just use k_user_access_level eq '10'. With that done, if query string parameter &debug=1 exists in URL and you are logged in as Super-admin, the admin-panel page-saving will not redirect (but fields will be saved), so will allow you to review posted values from fields.
Good for debugging and tinkering with theme on a constant basis.
See how late I am to the party. Some of these customizations are very neat ... although I am losing grip as whether there perhaps is a better way in a newer version.

Is there a way to delete or retract a post, please?
Previous 1 ... 20, 21, 22, 23, 24 Next
237 posts Page 24 of 24