User Rating: 0 / 5

Today, we will review how to use Page Class Suffix in Joomla. If we define the Page Class Suffix in the menu parameter when we click to the page that page is displayed vary according to the Style Sheet which it was defined by Page Class Suffix inside menu parameter. For example, if we visit Gallery or Sport Leagues pages. We will see the background page will be different from the home page. We can customize any differently if required.

According to the documentation of the Page Class Suffix in Joomla. We have to edit index.php file of your current template and add the below code before Head Tag for defining some parameters required to run it.

$itemid = JRequest::getVar('Itemid');
$menu = &amp;JSite::getMenu();
$active = $menu-&gt;getItem($itemid);
$params = $menu-&gt;getParams( $active-&gt;id );
$pageclass = $params-&gt;get( 'pageclass_sfx' );
After that add the below code between head tag for defining the correct path of a new style sheet file. By the file name of style sheet is the Page Class Suffix parameter that we will set in the menu parameter.
<link rel="stylesheet" href="/templates/<?php echo $this->template ?>/css/<?php echo htmlspecialchars($pageclass) ?>.css" type="text/css"/>
Then we came to Edit Style Sheet, as we want. when everything is done. We can make the Page Class Suffix of the menu you want.
How to Use Page Class Suffix
Pin It