Support Forums

Support Offline : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Helix 3 Page class suffix

Featured Lock Resolved Issue
Hi Guys,

I've noticed that just like in the case of Helix 2, Helix 3 still lacks the support for Joomla's core page class suffix. If I add a class to the menu item under "Page Display" -> "Page Class" it won't get added to the body. In Helix 2 I used to solve this by adding this code before the <head> tag:
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu()->getActive();
$pageclass = '';

if (is_object($menu))
$pageclass = $menu->params->get('pageclass_sfx');
?>


And by replacing this code after the </head>:
<body <?php echo $this->helix->bodyClass('bg hfeed clearfix'); ?>>


With this code:
<?php $pageclass = ($pageclass) ? htmlspecialchars($pageclass) : 'default'; ?>
<body <?php echo $this->helix->bodyClass("bg hfeed clearfix $pageclass"); ?>>


I've added the first lines to Helix 3 index.php right before the <head> and I've managed to add the class suffix to the body but I've lost sticky-header and layout-fluid classes. See attached image.

Can you please help with this?
It's very important to me as I'm sure for others as well.

Guy.

Attachments (1)

  • class_suffix.jpg
    class_suffix.jpg 428.1 KB

9 Answers

Guy Walder

More than a month ago #Permalink
I guess your WYSIWYG here didn't manage the code so well :D
First code:
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu()->getActive();
$pageclass = '';

if (is_object($menu))
$pageclass = $menu->params->get('pageclass_sfx');
?>

Second code:
<body <?php echo $this->helix->bodyClass('bg hfeed clearfix'); ?>>

Third code:
<?php $pageclass = ($pageclass) ? htmlspecialchars($pageclass) : 'default'; ?>
<body <?php echo $this->helix->bodyClass("bg hfeed clearfix $pageclass";); ?>>

Guy Walder

More than a month ago #Permalink
WTF
See attached code images.

Attachments (3)

  • 1.jpg
    1.jpg 11.1 KB
  • 2.jpg
    2.jpg 4.7 KB
  • 3.jpg
    3.jpg 10.1 KB

Guy Walder

More than a month ago #Permalink
Nothing? No one uses page class suffix this days???

Guy Walder

More than a month ago #Permalink
Hi,

Any chance to get your help with this?
I would REALLY like to use page class suffix.

Tnx.

pepperstreet

More than a month ago #Permalink
Guy Walder wrote:
Helix 3 still lacks the support for Joomla's core page class suffix. If I add a class to the menu item under "Page Display" -> "Page Class" it won't get added to the body... It's very important to me as I'm sure for others as well.


Confirmed! Why is it still missing? This topic is from 8th June. :o :(

Attachments (2)

  • backend_menu_parameter.png
    backend_menu_parameter.png 35.6 KB
  • frontend_body_classes.png
    frontend_body_classes.png 20.4 KB

Guy Walder

More than a month ago #Permalink
Dear Joomshaper support team,

Any chance to get a solution for this? Pleas.

andis13

More than a month ago #Permalink
Same problem for me to. It looks like a general Helix3 framework error, but not for Dear Support. Dear Support sais: it's not a bug it's a feature :(

KE Comm

More than a month ago #Permalink
Add this code to your index.php:

<?php
$app = JFactory::getApplication();
$menu = $app->getMenu()->getActive();
$pageclass = '';

if (is_object($menu))
$pageclass = $menu->params->get('pageclass_sfx');
?>


and change your body tag from:

 <body class="<?php echo $this->helix3->bodyClass($body_classes); ?> off-canvas-menu-init">


to


 <body class="<?php echo $this->helix3->bodyClass($body_classes); ?> off-canvas-menu-init <?php echo $pageclass ? htmlspecialchars($pageclass) : 'default'; ?>">


Documentation:
https://docs.joomla.org/Using_the_Page_Class_Suffix_in_Template_Code

pepperstreet

More than a month ago #Permalink
@KE Comm
Thanks for your contribution.

@Joomshaper
BTW, there was a related PR on github.

Sorry, I have to repeat myself: This is a Joomla core feature. Please, make use of it.
Yes, I am aware of your body class "itemid-XXX", which allows to target a specific page.
I have also noticed the template style parameter "Variation" in one of your monthly releases...
But why re-inventing the wheel, when Joomla comes with a build-in PageClassSuffix parameter?! ;)


There are no replies made for this post yet.
Be one of the first to reply to this post!

Leaderboard (30 days)

Sifat

Sifat

Total Accepted Answers: 103
Paul Frankowski

Paul Frankowski

Total Accepted Answers: 92
Toufiq

Toufiq

Total Accepted Answers: 91
Sohan

Sohan

Total Accepted Answers: 3
Rifat Wahid Alif

Rifat Wahid Alif

Total Accepted Answers: 2

115

Templates

295602

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us