Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

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";

kochlehrling
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

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

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1722
Total Polls:
6
Total Posts:
5933
Total Posts Today:
6
User Info:
 
Total Users:
4928
Newest User:
jcornejo
Members Online:
0
Guests Online:
108

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked