Joomler!.net - Decided on Joomla!

Jboard is Multiple Board!

Latest Posts

Doesn't change Template Selector value when change template by URL
Avatar euge001 2014/07/22 19:05
Have a good day to everyone! Do someone knows whether it's possible to show a current template...
Re:Template Selector 1.8.3 - Only works in Firefox
Avatar Lene 2014/07/01 16:23
Hello, It looks like that is working Thank you Kind regards Lene
Re:Template Selector works only on home page
Avatar Simon 2014/06/26 15:30
Thank You very much! TS is working like a charm!
Change template with Template Selector with PHP-script?
Avatar Rogbert Larsson 2013/08/12 14:51
I am using Template Selector for Joomla 1.5. Unfortunately I cant change template with Template S...
Custom Head Tag - no subforum no JED entry
Avatar Rex Kramer 2013/01/30 00:47
Hi, it was hard to find the custom head tag module. by the way, it has no sub-forum and it is not...

Popular Posts

フォーラムオープン
Avatar Administrator 2007/11/06 23:25
フォーラムをオープンしてみました。 マナーを守ってご利用ください。 Welcome to Joomlers Forum. All posts please use English o...

Forum Stats

All times are UTC + 9 hours
Total Topics:261
Total Posts:1254

Forum Online

Total Online:114
Total Guest:114
Bottom
Home » Support » Modules » General » Template Selector change a template with a querystring?
Template Selector change a template with a querystring?
Template Selector change a template with a querystring?
Tuesday, 07 February 2012 08:33
0 votes
I need to Change the Plugin and it's Cookie handeling.
Hello there,
I used to work with template chooser 4.01.
With a litle change made in template chooser php
I good make the template change with a link and querystring like this.
index.php?mod_change_template_54=resolutie-1280px"
(_54 is the module id. in joomla.)
and "resolutie-1280px" is the name of the template.
=======================================================================
I also used a script to redirect users to their monitor width.

I would like to use template selector in the same way can any one help me?
----------------------------------------------------------------------------
DATABASE ENTERY:
id------ Template---------Cleint_id--------Home-----Title
7--------1200px-------------0--------------- 1--------1200px - Default
8--------1500px-------------0--------------- 0--------1500px - Default
----------------------------------------------------------------------------
I believe I found the right querystring: to change the template...
index.php?mod_templateselector_80=1500px&&template=1500px
Yes I did!

(80 is my module iD of the templateselecter and 1500px is the name of my template)

But now I need to customize the template selector module so that the cookie also
changes when you use the querystring .
Also did I find out that one template (1500px) switches at ones.
But the other template (1200px) (the standard one) needs to be refreshed twice to switch.

I would really like the devolper of the plugin to look for a way to hack this plugin.
So that I (we) can use this funtion.

I have now solved it bij putting some javascript insite the webpage that reads the
Template style id from the querystring like this.
index.php?mod_templateselector_80=1500px&&template=1500px&&id=8
index.php?mod_templateselector_80=1200px&&template=1200px&&id=7
But that is not pretty.
And also there is a problem with reset and switch it only works
if the initial state of de template selector is active you can make it so by doing a reset.
Than you can switch between the templates and the cookie changes also with the javascript.
You only have to reset ones after that it works oke.
But there is a other problem that it takes twice to change the 1200px (the Standard one)template.

So is there someone who can make the right changes to the plugin?
And let me know?
Jeroen Jansen
Fresh Boarder
Fresh Boarder
12
2012/02/07
Last update:Thursday, 09 February 2012 06:03
Re:Template Selector change a template with a querystring?
Thursday, 09 February 2012 07:22
0 votes
Hello every body,
Joomler has given the solution.

--------------------------------------------------
Template Selector is simple.

And support simple request.

If you use joomla1.6 or higher,

Please try "yourrequest(?or&templatedirectory=yourtemplateid".

Example with my demo.

"Beez2 - Parks Site" template
http://demo16.joomler.net/index.php?templatedirectory=114

"Atomic - Default" template
http://demo16.joomler.net/index.php?templatedirectory=3
-------------------------------------------------------
Tanks a lot Joomler!!!!
Jeroen Jansen
Fresh Boarder
Fresh Boarder
12
2012/02/07
Re:Template Selector change a template with a querystring?
Monday, 13 August 2012 07:52
0 votes
Would you specify the file to which it insert this code :
"yourrequest(?or&templatedirectory=yourtemplateid"

thank you very much
venci
Fresh Boarder
Fresh Boarder
1
2012/08/13
Re:Template Selector change a template with a querystring?
Monday, 13 August 2012 23:27
0 votes
Wenh you do not see the javascript correctly i mean in blaack background you have to go to a other article and then go back to this article then the javascript is correctly displayed.

In the backend of your joomla site in Custom Head Tag for 1.7 module you put the code below.
And activate it on all pages of your site.

Custom Head Tag for 1.7

version : 1.7.0
Copyright (C) 2007-2011 Yoshiki Kozaki(www.joomler.net) All rights reserved.
access: This e-mail address is being protected from spambots. You need JavaScript enabled to view it
link: http://www.joomler.net/
license: http://www.gnu.org/copyleft/gpl.html GNU/GPL

<script language="Javascript">
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca;
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name) {
createCookie(name,"",-1);
}
if(document.cookie.length <= 0){
alert("Cookies moeten aanstaan anders wordt de website niet correct weergeven."wink.png;
}
if(readCookie('welkom554') !== 'greetz55')
{
if (screen.width < '1220') {
document.location += "?templatedirectory=9";
}
else if(screen.width >= '1220' && screen.width < '1500') {
document.location += "?templatedirectory=7";
}
if (screen.width >= '1500') {
document.location += "?templatedirectory=8";
}
createCookie('welkom554','greetz55',0)
}
</script>
Jeroen Jansen
Fresh Boarder
Fresh Boarder
12
2012/02/07
Last update:Tuesday, 14 August 2012 19:31
Re:Template Selector change a template with a querystring?
Monday, 13 August 2012 23:46
0 votes
Or for different days of the week:

<script language="Javascript">

function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca;
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

function eraseCookie(name) {
createCookie(name,"",-1);
}

if(document.cookie.length <= 0){
alert("Cookies moeten aanstaan anders wordt de website niet correct weergeven."wink.png;
}

else{

function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++)
this = initArray.arguments;
}

var weekDayArray = new
initArray("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"wink.png;
var today = new Date();
var day = weekDayArray[today.getDay()+1];

if(readCookie('welkom773') !== 'gegroet773')
{

if (screen.width < '1600' & day == "Monday"wink.png {
document.location += "?templatedirectory=7";
}

if (screen.width < '1600' & day == "Tuesday"wink.png {
document.location += "?templatedirectory=8";
}

if (screen.width < '1600' & day == "Wednesday"wink.png {
document.location += "?templatedirectory=7";
}

if (screen.width < '1600' & day == "Thursday"wink.png {
document.location += "?templatedirectory=8";
}

if (screen.width < '1600' & day == "Friday"wink.png {
document.location += "?templatedirectory=7";
}

if (screen.width < '1600' & day == "Saturday"wink.png {
document.location += "?templatedirectory=8";
}

if (screen.width < '1600' & day == "Sunday"wink.png {
document.location += "?templatedirectory=7";
}

else if (screen.width >= '1600' && screen.width < '1900' & day == "Monday"wink.png {
document.location += "?templatedirectory=9";
}

if (screen.width >= '1600' && screen.width < '1900' & day == "Tuesday"wink.png {
document.location += "?templatedirectory=10";
}

if (screen.width >= '1600' && screen.width < '1900' & day == "Wednesday"wink.png {
document.location += "?templatedirectory=9";
}

if (screen.width >= '1600' && screen.width < '1900' & day == "Thursday"wink.png {
document.location += "?templatedirectory=10";
}

if (screen.width >= '1600' && screen.width < '1900' & day == "Friday"wink.png {
document.location += "?templatedirectory=9";
}

if (screen.width >= '1600' && screen.width < '1900' & day == "Saturday"wink.png {
document.location += "?templatedirectory=10";
}

if (screen.width >= '1600' && screen.width < '1900' & day == "Sunday"wink.png {
document.location += "?templatedirectory=9";

}

else if (screen.width >= '1900' & day == "Monday"wink.png {
document.location += "?templatedirectory=11";
}

if (screen.width >= '1900' & day == "Tuesday"wink.png {
document.location += "?templatedirectory=12";
}

if (screen.width >= '1900' & day == "Wednesday"wink.png {
document.location += "?templatedirectory=11";
}

if (screen.width >= '1900' & day == "Thursday"wink.png {
document.location += "?templatedirectory=12";
}

if (screen.width >= '1900' & day == "Friday"wink.png {
document.location += "?templatedirectory=11";
}

if (screen.width >= '1900' & day == "Saturday"wink.png {
document.location += "?templatedirectory=12";
}

if (screen.width >= '1900' & day == "Sunday"wink.png {
document.location += "?templatedirectory=11";

}

createCookie('welkom773','gegroet773',0)
}
}
</script>
Jeroen Jansen
Fresh Boarder
Fresh Boarder
12
2012/02/07
Last update:Tuesday, 14 August 2012 19:28
 
Home » Support » Modules » General » Template Selector change a template with a querystring?
joomler.net is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla!(R) name is used under a limited license from Open Source Matters in the United States and other countries.
joomler.net is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.