Forum for discussing general topics related to Couch.
10 posts Page 1 of 1
Hi Guys
I'm just starting on a rebuild of a site I made a while back, things have changed and I now have the opportunity and the need to use Couch.

What I'd like to do is have each page's meta title and meta description available in Couch BUT only for the Super Admin.
Is there a way to declare a particular editable region as Super Admin ONLY?

Can it be done?

thanks

@webecho
As far as I know, there isn't a way to make a particular editable region only accessible to the super admin. You could however create a 'Globals' template which only the super admin can access. You would do this be setting the template to hidden. Nevertheless this is static, so it may not be what you envisioned.
Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Globals' executable='0' hidden='1' >
<cms:editable name='home_title' type='text' />
<cms:editable name='home_description' type='textarea' />
<cms:editable name='about_title' type='text' />
<cms:editable name='about_description' type='textarea' />
...
</cms:template>
<?php COUCH::invoke(); ?>

On each page with a meta title or description, you would retrieve the values like so:
Code: Select all
<meta name="title" content="<cms:get_custom_field 'home_title' masterpage='globals.php' />">
<meta name="description" content="<cms:get_custom_field 'home_description' masterpage='globals.php' />">
Thanks cheesypoof

Yeah that's a good way around it.

The only problem I can see is that there will be a lot of pages added through 3 different areas that work like Blogs (or cloned pages ... thank you KK, geat work).

That said, the blog sections are being run by a PR company, so even if they are no good at SEO, they should be professional enough to keep their hands off them if I tell them to.

Nice one mate, really appreciate your input on that one - could be the best solution.

@webecho
I agree, using the hidden template is the only way to get this done.

Currently no method available to set access control on individual editable regions but it seems to be a helpful thing.
I'd like to know your thoughts on this @cheesypoof and @webecho?
Hi KK
If it's something that could be done easily - personally, I'd welcome it.
I don't know how many people would want / need to use it.

To be honest, the whole reason I moved everything over to Couch was so that I could stay in control of the 'essential' SEO but still allow my Clients a certain amount of automation and not having to pay me for small and simple changes.
It just means that no-one can 'break' the SEO I've done and waste the money the business has paid me to research and analyse it.

As I said, I've no idea if this would be a useful feature for anyone else - I asked because it will save me time adding different Titles, Descriptions, Facebook Open Graph tags and the Schema.org microformats individually on every page - I can use the snippets to embed the ones that are common site-wide, then just change a few here and there on individual pages.

I wouldn't say it was essential, but it would certainly be a time saver.

Really liking the new Cloned Pages and Menu you've introduced - works beautifully and saves so much time.


@webecho
I think additional access control for editable regions can be useful. It could provide an extra layer of security for 'no_xss_check' editable regions, preventing a compromised administrator account from causing too much mischief.
OK, seems to be a useful feature.
Thank you both for the inputs. I'll try and get that in with the upcoming version.
KK
I think and access='super_admin' tag would be really good.

Thanks for considering it.

@webecho
Hey @webecho and @cheesypoof,

I gave this matter a little thought afterwards and, as it happens, there is currently a way to make this happen after all.

Once again the editable region type 'message' to the rescue (it appears 'message' was a misnomer :) )

Here is what we can do -
Create a 'group' region and then place all the editable regions that you want to be hidden from your clients within this group. For our example I'll assume the name of this group is 'my_group'.

That done, add a region of type 'message' to the template this way -
Code: Select all
<cms:editable name='my_js' type='message' dynamic='default_data'>
hide.html
</cms:editable>

We are effectively making this region dynamically execute an embedded snippet named 'hide.html' every time the admin page is loaded.
( please see viewtopic.php?f=4&t=5095 for the basic idea).

Next create this 'hide.html' file and place it in your 'couch/snippets' folder.
Place the following content in the file -
Code: Select all
<cms:if k_user_access_level lt '10' >
<script type="text/javascript">
   //<![CDATA[
   window.addEvent('domready',
      function(){
          $('f_my_group').setStyle('display', 'none');
      }
   );
   //]]>
</script>
</cms:if>

This snippet gets executed every time the edit panel is displayed. You can place any regular Couch code here.
The code we have placed does this -
it checks the access level of the logged-in user. If it is less than '10' the user is not a super-admin (http://www.couchcms.com/docs/concepts/users.html).
In which case it outputs some JavaScript that simply hides the group that holds the secret regions.
Please note that the name of our group, as we assumed, is 'my_group' and the id that Couch gives it has a 'f_' prefixed to it to make it 'f_my_group' (use Firebug to get the id if in doubt).

Till the time we support this 'hiding' facility natively, this hack should do the trick.

Please let me know if it helped.

Thanks.
Nice one KK
Too late to try it tonight, but will give it a go tomorrow.

Thanks mate, that sounds perfect.

@webecho
10 posts Page 1 of 1
cron