-
AuthorPosts
-
zekazeka Friend
zekazeka
- Join date:
- November 2012
- Posts:
- 8
- Downloads:
- 0
- Uploads:
- 1
- Thanked:
- 2 times in 1 posts
December 17, 2012 at 5:49 pm #183177Hi devs and community.
For now i have next problems/questions:I want to assign page class suffix to body tag ( for me its more flexible) for that i made these modification in default.php file in my template.
[PHP]<?php
$menu = JSite::getMenu()->getActive();
$pageclass = ”;if (is_object($menu))
$pageclass = $menu->params->get(‘pageclass_sfx’);
?>[/PHP]and get value
[PHP]<?php echo $pageclass ? htmlspecialchars($pageclass) : ‘default’; ?>[/PHP]
Code work perfectyly, but in template manager i get this error :
The layout cannot be loaded. There might be some errors in the layout file.
also i was trying to transfer it to “blocks” level, but got the same error.
So first question: how can i achieve what i want?
Next question:
[PHP]<html lang=”ru”>[/PHP]How can i dynamicly change language tag if i cant run custom php code in template file?
Next question:
How can i override libraries/joomla/document/html/renderer/message.php. through jat3v3?Many tnx for your work!
griiettner Friendgriiettner
- Join date:
- November 2008
- Posts:
- 18
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 2
- Thanked:
- 20 times in 6 posts
December 17, 2012 at 6:58 pm #476542Hello,
The answer for your first question can be found here
http://www.joomlart.com/forums/topic/change-body-tag-class-if-on-home-page/
For the second question you can find here
http://www.joomlart.com/forums/topic/change-dynamically-the-language-code/The third question, unfortunately I don’t have answer for it… But I think the best way to get around any library issue, is to create a plugin that would render before the function you want to override…
Regards…
1 user says Thank You to griiettner for this useful post
zekazeka Friendzekazeka
- Join date:
- November 2012
- Posts:
- 8
- Downloads:
- 0
- Uploads:
- 1
- Thanked:
- 2 times in 1 posts
December 19, 2012 at 8:38 pm #476824Here the solution:
[PHP]<?php
$app = JFactory::getApplication();
$menu = $app->getMenu(); //Calling getMenu function from library
$active = $menu->getActive();
$pageclass_sfx = ”;
$params = $menu->getParams( $active->id );
$class = $params->get( ‘pageclass_sfx’ );if ($menu->getActive() == $menu->getDefault()) : //If the page you are viewing is home add the following line
echo ‘<body id=”homepage”>’;else: //If not home page add the following line
echo ‘<body id=”‘.$class.'”>’;
endif; ?>[/PHP]1 user says Thank You to zekazeka for this useful post
-
AuthorPosts
This topic contains 3 replies, has 2 voices, and was last updated by zekazeka 11 years, 11 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum