Detecting module generated pages in WHMCS Templates

Sometimes simply generating pages using the WHMCS Pages module is not enough, you may want to alter the templates layout, or display additional content within the template on generated pages.

To do so the module defines a smarty variable which you can use to check if it is a WHMCS Pages module generated page.

The variable in question is called whmcs_pages, and can be used in the template like so: {$whmcs_pages}.

When on a generated page this variable will be defined and will have a value of true.

This can then be used to alter html markup within templates like so:


{if $whmcs_pages eq 'true'}
<!-- make your html changes, or display additional content -->
{else}
<!-- do something different -->
{/if}

This method uses the smarty conditional statement methods and more details of how to use them can be found here: Smarty Conditional Statements

Was this answer helpful?

 Print this Article

Also Read

The required .htaccess module for SEO urls could not be found, it is possible this function may still exists/work but to be sure please contacting your host ERROR

On some servers, the pages module will not be able to add the .htaccess rewrite rules...

.Htaccess settings required for addon module SEO URL's

The WHMCS Pages addon module requires a little configuration of your web server if it is to use...

Migrating custom templates from pre 1.5.2 to new structure

Pre version 1.5.2 the content for the page was evaluated by smarty to replace template variables...

Viewing the RSS Feed

As of V1.5.0 the pages module now creates an RSS feed of all the pages created.This Feed is added...

Managing Templates

The WHMCS Pages module uses its own custom template files. These are inserted in between the...