ADMINS ONLY TO EDIT CERTAIN FIELDS - Mar 25th, 2015


User Kenny wanted to allow Admins to edit certain fields (in his case the page titles, and the meta data description and
tag fields for his site) but not to allow user editor to do more than view those fields while editing others.

I didn’t think it could be done, but Damon Edis from Interactive Tools came to the rescue with this elegant concept.

He said:

“It sounds like you are wanting the admin user to be able to add/edit page title and metas, both keyword and
description fields in CMS Builder and have editor users only be able to see that content but not edit it.

This can be done with some creative coding. Here’s the steps:

1. Create your three fields: Page Title, Meta Keywords and Meta Descriptions
Edit these fields to make them Admin Only Access Level. When modifying the field, in the popup window, scroll to the
bottom and for Advanced Options, click show all to see this option.

2. Create a new field for your section. The Field Type will be --seperator--. Doesn't need a Field Label or Field Name.
For the Separator Type choose the HTML radio button.

By default you will see this HMTL:

<tr>
<td colspan='2'>
</td>
</tr>

Change that to this:

<?php if (userSectionAccess($GLOBALS['tableName']) >= 9): ?>
<tr>
<td> Page Title: </td>
<td><?php echo htmlencode(@$GLOBALS['RECORD']['page_title']); ?></td>
</tr>
<tr>
<td> Meta Tag: </td>
<td><?php echo htmlencode(@$GLOBALS['RECORD']['meta_tags']); ?></td>
</tr>
<tr>
<td> Meta Description: </td>
<td><?php echo htmlencode(@$GLOBALS['RECORD']['meta_description']); ?></td>
</tr>
<?php endif ?>


This first line of code is used to only displays the output Page Title, Meta Tags and Meta Description for Editor users
only. Admin users will see this data in editable text fields.

After you setup this up, log in as an Editor to test.”



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service