MENU

Add maintenance information to the frontend for the content editor

  Previous article Next article  

When browsing the website, it isn't always clear for a content editor where the page content is stored/generated... In the Content Manager? Or in a (third party) module. In some cases - like CGBlog - the CGActionBar module will be the best solution, but it doesn't work for all third party modules and situations.

This method will show a red help text box in the frontend what will guide the editor in the Admin area. Ohw, and of course it will only be visible when the editor is logged in the Admin area.

  How to use

Create a User Defined Tag (UDT) named 'MaintenanceInfo' and use the content:

$loggedin = get_userid(FALSE);
$list = '';

if ( ($loggedin > 0) && (isset($params)) )
{
  foreach ( $params as $name => $value ) { $list = $list . "$name > $value, "; }
  echo '<p style="background:#f00;color:#fff;padding:10px;">Change this text in: ' . substr($list, 0, -2) . '.</p>';
}

In this demo I also added a Font Awesome icon:

$loggedin = get_userid(FALSE);
$list = '';

if ( ($loggedin > 0) && (isset($params)) )
{
  foreach ( $params as $name => $value ) { $list = $list . "$name > $value, "; }
  echo '<p style="background:#f00;color:#fff;padding:10px;"><i class="fas fa-edit"></i> Change this text in: ' . substr($list, 0, -2) . '.</p>';
}

In the (module) templates you can now call this UDT and add as much Parameter - Value pairs as you wish. In example:

{MaintenanceInfo Param1='Value1' Param2='Value2' Param2='Value3'}

It will show in the frontend, only when the editor is logged in into the Admin panel:

Change this text in: Param1 > Value1, Param2 > Value2, Param3 > Value3.


  Working example

1 - Core::Generic template

Add to the bottom of the Core::Generic template (HTML Block) in the Design Manager:

{MaintenanceInfo Menu='Layout' Module='Design Manager' Tab='Templates' Name='Your_Template'}

When looking at the detail information, it will show:

Change this text in: Menu > Layout, Module > Design Manager, Tab > Templates, Name > Your_Template.


2 - CustomGS module

You use the CustomGS module to maintain the website name, address, city, telephone number, etc.
At the contact page you call these values to show them.
Add below the content:

{MaintenanceInfo Menu='Content' Module='CustomGS' Tab='Address'}

It will show in the frontend, only when the editor is logged in into the Admin panel:

Change this text in: Menu > Content, Module > CustomGS, Tab > Address.


3 - Company Directory module

Add to the bottom of the detail template of the Company Directory module

{MaintenanceInfo Menu='Content' Module='Company Directory' Company=$entry->company_name}

When looking at the detail information, it will show:

Change this text in: Menu > Content, Module > Company Directory, Company > Company Name.


4 - Products module

Add to the bottom of the detail template of the Products module

{MaintenanceInfo Menu='Content' Module='Product Manager' Item=$entry->product_name}

When looking at the detail information, it will show:

Change this text in: Menu > Content, Module > Product Manager, Item > Product Name.


5 - LISE module

Add to the bottom of the detail template of the LISE[instance] module

{MaintenanceInfo Menu='Content' Module='LISE[instance]'}

When looking at the detail information, it will show:

Change this text in: Menu > Content, Module > LISE[instance].


Buy Me A Coffee


  Comment Form

ReviewManager

Click here to open the form

ReviewManager

  0 Comments

No comments yet...

Buy Me A Coffee

CMS Made Simple - Tutorials, Tips and Tricks - CMSMS

Add maintenance information to the frontend for the content editor

  Article optimized for CMSMS 2.x

  Author:
  Last updated: 04-08-2019
  Comments: 0
  http://cms.ms/sXTi


Buy Me A Coffee




Advertisement


Ads help me to help you! Thanks!

Ads help me to help you! Buy products from these advertisers!