Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » ChameleonLite
- » Randomized Template by own variable.
Randomized Template by own variable.
Randomized Template by own variable.
Hey out there. I'm trie to get this Thing working:
I Have 10 Difrent Templates witch should be randomized chaged. So I Setted up this small script below, but it wasn't working.
What I'm doing wrong?
$zufall = mt_rand(1,10);
if ( $zufall == 1 )
return "Walkerbau1_1";
if ( $zufall == 2 )
return "Walkerbau1_2";
if ( $zufall == 3 )
return "Walkerbau1_3";
if ( $zufall == 4 )
return "Walkerbau1_4";
if ( $zufall == 5 )
return "Walkerbau1_5";
if ( $zufall == 6 )
return "Walkerbau1_6";
if ( $zufall == 7 )
return "Walkerbau1_7";
if ( $zufall == 8 )
return "Walkerbau1_8";
if ( $zufall == 9 )
return "Walkerbau1_9";
if ( $zufall == 10 )
return "Walkerbau1_10";
Re: Randomized Template by own variable.
Hi kochlehrling,
at first glance I'd say that the code looks fine.
The main issue is sometimes with the capitalisation of the template names.
I'd suggest starting off by using the following rule (just this 1 single line) to see if you can get the entire site to use the new template:
return "Walkerbau1_1";
As long as the rule is enabled, and no other form controls have been changed in the rule, then this should change your entire site to the Walkerbau1_1 template.
If it doesn't, try with a lower-case "w". I think from memory that this name has to match the name of the folder that the template is sitting in, not the name of the template in the XML file, if this is different.
The list of template names on the right hand side of the MetaTemplate rule editor should indicate the name of the folder, if it's different from the display name of the template.
Also, are you able to set Walkerbau1_1 as the default template using the normal Joomla mechanism, and does that work properly?
Hope that helps,
please write back if you continue to have problems with it,
Stephen
- Index
- » Chameleon / ChameleonLite
- » ChameleonLite
- » Randomized Template by own variable.
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5943
- Total Posts Today:
- 1
- User Info:
- Total Users:
- 7638
- Newest User:
- moner86658
- Members Online:
- 1
- Guests Online:
- 149
- Online:
- moner86658
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked