I run one older webpage and have prepared reduced template for viewing on mobiles. There is a link in the template prepared to switch the "mobile mode". But how to tell the link to open the page with the second template?
Adding #cmsimple $cf['site']['template']="kastelan";# does not help. The page is still open with the default template.
Load a webpage via a link with another template.
Load a webpage via a link with another template.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Load a webpage via a link with another template.
i try when i can, and even this may be not what you mean, however, in template.htm ( in the code for the opened page )
Code: Select all
<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "http://abcd.com";
}
//-->
Re: Load a webpage via a link with another template.
Well, it's really not exactly what I need, but it is interesting too.
With newer versions of CMSimple_XH it's very simple. But the webpage was built and still runs unupgraded. ANd there shall be the config variable re-defined for this only subpage.
Have a look at http://ukastelana.eu. There is daily menu in the right column and I want to have it show on mobile as the only page. In the second template everything but this section is removed. I want a button/link to this only page to be used on mobiles e.g. http://ukastelana.eu/?mobile
With newer versions of CMSimple_XH it's very simple. But the webpage was built and still runs unupgraded. ANd there shall be the config variable re-defined for this only subpage.
Have a look at http://ukastelana.eu. There is daily menu in the right column and I want to have it show on mobile as the only page. In the second template everything but this section is removed. I want a button/link to this only page to be used on mobiles e.g. http://ukastelana.eu/?mobile
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Load a webpage via a link with another template.
Basically, you need some PHP code on the server that changes the template, some URL parameter which triggers this code, and maybe additionally a cookie so the mobile template stays after navigation. Handheld_XH offers these features, but it might not work with classic CMSimple.Tata wrote:There is a link in the template prepared to switch the "mobile mode". But how to tell the link to open the page with the second template?
The code to change the template ideally goes to cmsimple/userfuncs.php, but this is not possible for classic CMSimple, so put it into cmsimple/functions.php:
Code: Select all
if (isset($_GET['mobile_version']) && $_GET['mobile_version']) {
$cf['site']['template'] = 'NAME_OF_THE_TEMPLATE'; // customize!
$pth['folder']['template'] = $pth['folder']['templates']
. $cf['site']['template'] . '/';
$pth['file']['template'] = $pth['folder']['template'] . 'template.htm';
$pth['file']['stylesheet'] = $pth['folder']['template'] . 'stylesheet.css';
$pth['folder']['menubuttons'] = $pth['folder']['template'] . 'menu/';
$pth['folder']['templateimages'] = $pth['folder']['template'] . 'images/';
}
Christoph M. Becker – Plugins for CMSimple_XH
Re: Load a webpage via a link with another template.
Ja, super, die Seite is am CMSimple 3.2. Und mit functions.php auch läuft es. Nur mit Charset kann ich da nicht zurecht kommen. Egal ob charset im Template definiert ist.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Load a webpage via a link with another template.
Der charset sollte am besten immer vom Server per Content-Type header angegeben werden (die Angabe im HTML ist nur eine Notlösung). Wie man das bei NGinX einstellt, weiß ich nicht. Du kannst es aber auch per PHP machen:Tata wrote:Nur mit Charset kann ich da nicht zurecht kommen. Egal ob charset im Template definiert ist.
Code: Select all
header('Content-Type: text/html; charset=windows-1250', true);
Insgesamt ist es aber vermutlich das Beste, wenn Du die Site bei Gelegenheit mal auf CMSimple_XH 1.6.x aktualisierst.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Load a webpage via a link with another template.
Ich habe es schon auch local versucht, die Seite ist aber so komplex, dass ich werde es ambesten tief testen müssen, ob es alles stimmt. Dan brauche ich auch nichts lösen, weil es durch Page Reiter ganz eifach geht.
Vielen Dank.
Es haben endlich die Ferien begonnen, so werde ich wohl mehr Zeit für CMSimple_XH haben.
Vielen Dank.
Es haben endlich die Ferien begonnen, so werde ich wohl mehr Zeit für CMSimple_XH haben.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.