back to Modules

Custom Content

Contents


The Custom Content Project Page


Frequently Asked Questions

  • Add Custom Content logic into the Menu Manager templates
http://forum.cmsmadesimple.org/index.php/topic,46284.0.html


Module Help

Documentation from the developer

  • A brief introduction to setting up and configuring FEU, Selfreg, and CustomContent
http://calguy1000.com/uploads/1/Hiding_Private_Content_in_CMS_Made_Simple-pdf.html


Code Examples

You will find some code examples here you can use to secure the page content of a website. This code should be placed in templates or in Global Content Blocks with the WYSIWYG editor set off. You can't use this code directly in the WYSIWYG editor, because it will be deleted by the editor.

Basic template

{if $ccuser->loggedin()}
         {content}
{else}
         <p>The page content is only allowed for registered users. Please Login first!</p>
         {cms_module module="Frontendusers"}        
{/if}

Basic template, using the default Extra1 field

In this example the default Extra1 field is used. You can fill in the name or names of a FrontEndUser group, divided by commas. For instance: group1,group2,group3

{page_attr key='extra1' assign='extra1'}

{if ($ccuser->memberof($extra1) and $ccuser->loggedin()) or $extra1 == ''}
          {content}
{else}
          <p>The page content is only allowed for registered users. Please Login first!</p>
          {cms_module module="Frontendusers"}
{/if}
  • Information how to change the name of the Extra1 field in de page editor of the admin
http://calguy1000.com/Blogs/6/60/customizing-module-strings-and-admin-templates.html

Extended template, triggered by prefix (secure_) in the page url

A regular user is allowed to visit pages with a normal page alias like index.php?page=contact. But pages with a prefix like index.php?page=secure_pictures are only visible when a user is logged in, and is a member of a specific FEU group.

If you don't want secured pages show up in the search results of the Search Engines, add this into the Head section of the template:

{if $page_alias|lower|substr:0:7 != "secure_"}
<meta name="robots" content="index,follow" />
{else}
<meta name="robots" content="noindex,nofollow" />
{/if}

Show the secured menu buttons only when the user is logged in, and is a member of a specific FEU group:

{if $ccuser->loggedin() && $ccuser->memberof('Registered Users')}
        {menu template='accessible_simple_navigation.tpl'}
{else}
        {menu template='accessible_simple_navigation.tpl' excludeprefix="secure_"}
{/if}

Show the secured content only when the user is logged in, else show a login form:

{content assign=contentdump} {* assign content to var, to prefend double content tag *}

{if $page_alias|lower|substr:0:7 != "secure_"}
         <p>Public content</p>
         {$contentdump}
{else}
         {if $ccuser->loggedin() && $ccuser->memberof('Registered Users')}
                 <p>Secure content</p>
                 {$contentdump}
         {else}
                 <p>The page content is only allowed for registered users. Please Login first!</p>
                 {cms_module module="Frontendusers"}
         {/if}
{/if}

User Handbook/Admin Panel/Extensions/Custom Content

From CMSMS

Arvixe - A CMSMS Partner