Forum for discussing general topics related to Couch.
8 posts Page 1 of 1
It seems that whenever you enclose an HTML page with
Code: Select all
<?php require_once('couch/cms.php' ); ?>...<?php COUCH::invoke(); ?>
, it gets added to the Admin page as a CMS managed page, even if there are no editable regions on it, which seems wrong to me.

I have a page which uses
Code: Select all
<cms:pages masterpage="news_item.php">
and that is appearing on the Admin page, even though there is nothing to edit on it. What is the best way of preventing this? I believe I can insert a
Code: Select all
<cms:template>
tag with hidden='1', which will prevent it from being seen by editors, but is there any more rigorous way of marking it as unmanaged, so that it doesn't show up even for SuperAdmin?
As far as I am aware, with the current version of couch, adding hidden='1' to the template tag is the only way to hide it from the admin page.
You could, of course, add custom CSS to the admin theme hiding the specific pages link from the sidebar, but that does not so much remove it as hide the link (Kind of like hidden='1') but for superadmins too.
Image
Thanks for that. I think it would be a smart idea for a future version of CouchCMS if it would only display on the Admin page templates which have editable regions, otherwise there doesn't seem to be much point in their being displayed there.
I like the current way, because it helps a lot in development.

Getting back to original question, there is a way to have hidden templates disappear permanently also for super-admins. To implement this, it will require a small dirty hack into Couch code in /couch/functions.php, line 3293:
if( $tpl['hidden'] ){
if( $AUTH->user->access_level < K_ACCESS_LEVEL_SUPER_ADMIN ){
continue;
}
else{
$class = "hidden-template ";
}

A small change here would hide anything hidden='1' for superadmins:
K_ACCESS_LEVEL_SUPER_ADMIN + 1


:)
Thanks, Trendoman, I'll give it a go. Out of curiosity, how does the current way help you a lot in development, as you say? I'm curious because I can't work out a use for it as it is. I'm very new to CouchCMS and there enough things in there which are obviously very well designed for me to be puzzled when I come across something which doesn't appear to be. I'm clearly not understanding something.
I'll gladly share my view on that.

Some advantages are subjective, while others can come handy in certain websites & use-cases. Every registered template has k_page_date and 'unpublish' option. So, you will be able to put a certain date for it, if that is needed in project (used somewhere in code). Second, even when there are no editables, it can be helpful to unpublish template from the site and remove it from the autogenerated menu.

Other use-cases include time-saving - seeing all couch-managed php files of the project without need to go to ftp. Some bigger projects have templates spread out in many folders/subfolders and it can be pain not to see template path. As you probably noticed, hovering over template title in sidebar reveals its name, which includes path. Clear advantage when moving projects from my server to client server. Also I register all needed templates and then see which ones still need to be updated with editables.

Johnny2R wrote: Thanks, Trendoman, I'll give it a go. Out of curiosity, how does the current way help you a lot in development, as you say? I'm curious because I can't work out a use for it as it is. I'm very new to CouchCMS and there enough things in there which are obviously very well designed for me to be puzzled when I come across something which doesn't appear to be. I'm clearly not understanding something.
The solution given here no longer works after an upgrade to CouchCMS 2.0, presumably because functions.php has substantially changed. Is there a new way of doing this for version 2.0?
LATER...I've discovered that the equivalent bit of code is now lines 328-325 of register.php, so this is now working fine again. My upgrade to version 2.0 has now been completed successfully!
8 posts Page 1 of 1

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 1 guest

cron