English (United Kingdom)
Jms Multi Site, formerly joomla multisite.
Create, share multiple joomla sites in few clicks !
Message
  • EU e-Privacy Directive

    This website uses cookies to manage authentication, navigation, and other functions. By using our website, you agree that we can place these types of cookies on your device.

    View e-Privacy Directive Documents

Welcome, Guest
Please Login or Register.    Lost Password?

use the same templates(theme) with different param
(1 viewing) (1) Guest
Go to bottomPage: 123
TOPIC: use the same templates(theme) with different param
#9530
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.
bearlee
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#9534
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.
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#9535
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.
bearlee
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#9536
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
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#9542
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
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
Last Edit: 2012/03/05 10:07 By edwin2win.
The administrator has disabled public write access.
 
#9549
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.
jeanmariefavre
Fresh Boarder
Posts: 19
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 123
get the latest posts directly to your desktop
2Win, Multisite(s) are trademarks of Edwin2Win.
Joomla