Re:use the same templates(theme) with different param 12 Years, 9 Months ago
|
Karma: 1
|
If I want to read a css from {site_id}_params.ini
what should I do for the index.php
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/<?php echo $this->params->get('colorVariation'); ?>.css" type="text/css" />
this is the default rhuk_milkyway theme's color variation.
|
|
|
|
|
Re:use the same templates(theme) with different param 12 Years, 9 Months ago
|
Karma: 54
|
Yes you have to use
<?php echo $this->params->get('colorVariation'); ?>
to get the "Color Variation".
You will read the parameters of the current website.
The "params" is filled with the value of the current slave site. So it reads inside joomla the appropriates params_{site_id}.ini file.
|
|
|
|
|
Re:use the same templates(theme) with different param 12 Years, 9 Months ago
|
Karma: 1
|
Thank you edwin2win!
I used the default rhuk_milkyway theme with the <?php echo $this->params->get('colorVariation'); ?> to get the "Color Variation".
But my slave site still read the params.ini not params_{site_id}.ini.
This problem is not in administrator template params.ini, but in the fronend template.
|
|
|
|
|
Re:use the same templates(theme) with different param 12 Years, 9 Months ago
|
Karma: 1
|
Hi Edwin,
That's exactly what I'm doing. $text_color = $this->params->get('text_color');
However, its reading the params.ini which belongs to the master site and NOT reading from its own params_{site_id}.ini which gets created in the master templates directory when editing the params in the slave site. So I have a params file for EACH slave site in the templates/my-template/ folder but they are not reading from the params_{site_id}.ini.
Why is that?
|
|
buddyq
Expert Boarder
Posts: 106
|
|
|
Re:use the same templates(theme) with different param 12 Years, 9 Months ago
|
Karma: 54
|
Perhaps there is a plugin or a specific template framework that overwrite the value or you didn't install the JMS patches (that does not seems to be the case).
If you are a developper, you can verify that the
libraries/joomla/document/html/html.php
file read the correct params.ini file.
This is the place in joomla framework where the params.ini file is read.
You will see that when you are in a slave site, this read the "params_{site_id}.ini" file and when this is NOT a slave site, this read the original "params.ini" file.
So if you are effectivelly on a slave site, you should read the appropriate file.
In joomla 2.5, the parameters can be read from the DB #__template_styles
|
|
|
Last Edit: 2012/03/05 10:07 By edwin2win.
|
|
Re:use the same templates(theme) with different param 12 Years, 9 Months ago
|
Karma: 1
|
Hi,
I also wanted to change the template and other things depending on the website, and after various trials and errors, some programming, I found that the chameleon component very handy indeed. I maintain many sites with the same installation but with different templates, or variations of the templates, even within a single slave site but with different directory prefixes. Chameleon is really cool for that. I got the commercial version which allow you to define rules in the admin, but there should be also a free version. I really happy with the commercial version since I can see very easily all the rules installed without going to see the code. I'm very happy with this component as this is definitively a good match with jms.
Hope this help.
p.s. This is not advertizement, but just experience of a happy user.
|
|
|
|
|
|