You are here:  » On the Go site change

Support Forum



On the Go site change

Submitted by sbedigital on Tue, 2012-05-22 18:49 in

Hello Dave,

Just looking use to your script to power some my hosting customer domain parking pages. I am thinking of creating several templates to match various themes. What I am thinikng is appending theme name to the template folder i.e html.blue, html.red etc..

Now the tricky bit is how can I make some sort of page element, could be a dropdow box, or button or a plain text link... that when user clicks it, it changes the template folder whatever the link was pointed to.

For example, I have three text link at the top of my home page, just under the search form.

<a href="#">RED</a> | <a href="#">BLUE</a> | <a href="#">ORANGE</a>

so simple usage is, if you click on RED link contents in html.red folder shown, if you click on BLUE only contents in html.blue folder is shown and so on...

I just wonder whether it would be possible to pass the "theme" variable in URL itself i.e www.xyz.com/index.php?theme=red and then somewhere in the config.php file create a variable called $theme = html.whatever color is append to the theme tag in URL. And lastle changing all the reference to normal html to $theme variable.

Do you this is workable solution or do your have something more simpler even if it is NON PHP i.e JAVA etc.

Noor

Submitted by support on Wed, 2012-05-23 08:35

Hello Noor,

Sure you could do something like the way the feed directory can be set, by creating a new config variable e.g.

  $config_htmlDirectory = "html/";

(where html/ is your default theme)

Then throughout the script, replace each call to the HTML files e.g.

  require("html/header.php");

...with:

  require($config_htmlDirectory."header.php");

Then all you need to do is override $config_htmlDirectory, e.g. at the top of the script:

  if (isset($_GET["theme"])) $config_htmlDirectory = "html.".$_GET["theme"]."/";

Hope this points you in the right direction...

Cheers,
David.
--
PriceTapestry.com