Advertisement

Change template via url param

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Locked
User avatar
juanparati
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 123
Joined: Thu Nov 08, 2007 6:00 pm
Location: Aarhus (Denmark)

Change template via url param

Post by juanparati » Mon Dec 15, 2008 1:47 pm

Is possible change a template/theme via url param?

For example something like:
http://myjoomla/index.php?setTemplate=ja-purity
From the code to the reality!

Advertisement
User avatar
juanparati
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 123
Joined: Thu Nov 08, 2007 6:00 pm
Location: Aarhus (Denmark)

Re: Change template via url param

Post by juanparati » Mon Dec 15, 2008 2:15 pm

I have discover it!!???

Sometimes I am very lazy, sorry for monopolize this thread.

I have discover the param template:

For change a template directly from a url you can use:

http://myjoomla/index.php?template=ja-purity

With this param you (I) can change a template via url in joomla.

This trick is very useful for make a Wordpress/Drupal/etc template integration.

For example I want share the header (with the joomla menus) and the footer in a wordpress.

I can create two differente themes, "my-header" and "my-footer" theme. After in my wordpress theme I included a readfile('http://myjoomla/index.php?template=my-header') in the header and readfile('http://myjoomla/index.php?template=my-footer') in the footer.

Nice trick!
From the code to the reality!

theret
Joomla! Intern
Joomla! Intern
Posts: 71
Joined: Mon Aug 18, 2008 11:09 pm

Re: Change template via url param

Post by theret » Wed Feb 04, 2009 11:28 pm

Wow so simple.

You've changed my life! I've been looking all day for a solution.

Thanks

ANDiTKO
Joomla! Apprentice
Joomla! Apprentice
Posts: 33
Joined: Fri Jan 19, 2007 1:39 am

Re: Change template via url param

Post by ANDiTKO » Tue Jun 02, 2009 10:07 am

Yes it works but it dosent remember the template.Each time you click a link it goes back to the default template.Did anybody managed to save the tamplate choosed from the URL?In a cookie or something...

User avatar
juanparati
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 123
Joined: Thu Nov 08, 2007 6:00 pm
Location: Aarhus (Denmark)

Re: Change template via url param

Post by juanparati » Tue Jun 02, 2009 2:46 pm

If you want change a template permanently perhaps this can help you:

http://forum.joomla.org/viewtopic.php?f=428&t=377667 :pop
From the code to the reality!

ANDiTKO
Joomla! Apprentice
Joomla! Apprentice
Posts: 33
Joined: Fri Jan 19, 2007 1:39 am

Re: Change template via url param

Post by ANDiTKO » Tue Jun 02, 2009 9:18 pm

Thank you!i will try it tommorow

rocker2344
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Tue Feb 17, 2009 6:46 pm

Re: Change template via url param

Post by rocker2344 » Sat Jun 13, 2009 11:50 pm

this is pretty close to my interest
what i am looking for is a line of code that i can put in my main template
like if url = yoursite.com/index.php&comcomponet=forum use template forum.css
that is wat i would like to see
so i dont have to use css2switch and can make template packs to give to my friends

User avatar
juanparati
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 123
Joined: Thu Nov 08, 2007 6:00 pm
Location: Aarhus (Denmark)

Re: Change template via url param

Post by juanparati » Thu Jun 18, 2009 7:06 pm

From the code to the reality!

rafacosta
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Apr 21, 2009 9:16 pm

Re: Change template via url param

Post by rafacosta » Mon Jun 22, 2009 5:28 pm

This is perfect for the problem I am having!!! Thanks!

Ward123
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Jun 18, 2008 3:17 pm

Re: Change template via url param

Post by Ward123 » Thu Apr 07, 2011 5:13 pm

I found this old post when I was looking for a solution to setting a template via the url parameter, my problem was that when someone entered my site via the url link that set the template it looked fine until they clicked on a link and then it switched back to the default template... Thought I would share what I found so maybe it will save someone else some time. I thought about hiring a Joomla expert but then I I found this nice component called MetaTemplate Pro that worked great. I was able to solve my problem of persistent urls. :)

Bpatra
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Sep 22, 2011 9:48 am
Location: Pune
Contact:

Re: Change template via url param

Post by Bpatra » Thu Sep 22, 2011 3:14 pm

Perfect. This saved ton's of my efforts. I am revamping my old site and was looking for a solution to setting a template via the url parameter. This thread just came as a life saving for me.

Advertisement

Locked

Return to “Templates for Joomla! 1.5”