Serving wap pages
Serving wap pages
Hi all,
Completing my website, I have a wap site.
The thing is that wap pages must send particular MIME-types.
In my current site, I use the following line in the .htaccess
AddType text/vnd.wap.wml wml
Now I would like to do the same with the CSMSMS. The template and the DTD is no problem, it is really the server that should send back text/vnd.wap.wml instead of text/html or smthg.
Do you know how to achieve that?
Other question, I would like to use the menu manager to handle the menus. Unfortunatly I have disabled the menu presence for the wap pages so that they don't show up in the menus of the regular website. Is there a way to still use menumanger or should I only make static links? There aren't really a lot of pages so it's not really a big deal if it can't, I just want to know.
Thanks a lot.
Completing my website, I have a wap site.
The thing is that wap pages must send particular MIME-types.
In my current site, I use the following line in the .htaccess
AddType text/vnd.wap.wml wml
Now I would like to do the same with the CSMSMS. The template and the DTD is no problem, it is really the server that should send back text/vnd.wap.wml instead of text/html or smthg.
Do you know how to achieve that?
Other question, I would like to use the menu manager to handle the menus. Unfortunatly I have disabled the menu presence for the wap pages so that they don't show up in the menus of the regular website. Is there a way to still use menumanger or should I only make static links? There aren't really a lot of pages so it's not really a big deal if it can't, I just want to know.
Thanks a lot.
-
Pierre M.
Re: Serving wap pages
Hello,
do you want the same content (same site, same hierarchy of same pages) to be broadcasted to both traditionnal browsers and wap browsers ?
IIRC wap/wml groups pages by "set of screens" where HTML maps one page/request to one screen/rendering. Am i correct ? If yes, are you making "sets of 1" to replicate the same mapping ?
Then, do you have enabled pretty URLs ? Do you use a .html suffix ? an empty suffix ?
What do wap browsers accept/send in HTTP requests ? I mean :
Accept: text/vnd.wap.wml; q=1.0, text/html; q=0.2, text/*; q=0.1 ?
Can you rewrite queries according to this HTTP header ?
I need some wap uptodate info to go on this topic
On the menu hiding topic : if your wap browser understands HTML/CSS, try display: none in the divCSS with media=somewap
Pierre M.
do you want the same content (same site, same hierarchy of same pages) to be broadcasted to both traditionnal browsers and wap browsers ?
IIRC wap/wml groups pages by "set of screens" where HTML maps one page/request to one screen/rendering. Am i correct ? If yes, are you making "sets of 1" to replicate the same mapping ?
Then, do you have enabled pretty URLs ? Do you use a .html suffix ? an empty suffix ?
What do wap browsers accept/send in HTTP requests ? I mean :
Accept: text/vnd.wap.wml; q=1.0, text/html; q=0.2, text/*; q=0.1 ?
Can you rewrite queries according to this HTTP header ?
I need some wap uptodate info to go on this topic
On the menu hiding topic : if your wap browser understands HTML/CSS, try display: none in the divCSS with media=somewap
Pierre M.
Re: Serving wap pages
Hi Pierre, thanks for replying.
First no, the content is different. i want to keep it simple (
) so there is a web site and there is a wap site.
The idea is to have one instance of cmsms handling both of them.
I know CMSMS is not mulitsite yet, so it's okay if I can't use the menu manager since I only have three pages on the wap, I can build the menu myself the old-style way.
Wap browsers are supposed to accept text/vnd.wap.wml
On my own device I know I can run the regular site wihtout any problem but I would like to keep the wap part of the site close to the wap specs (or to what I currently have)
I haven't used the media type feature of the stylesheets pages because I don't know what it really does. Is there a real interpretation of the querying device ? Can CMSM really make the difference between aural, braille, embossed, handheld, print, projection,.... I have doubts about it since I don't think it has a list with all imaginable User-Agents.
Anyway I made a try to associate my wap template with the handheld css with no luck. I mean the page displays correctly - which shouldn't because firefox or IE are not supposed to read wml natively (FF can do it though with the help of a plugin).
Regarding th pretty urls, I'm not sure, but I think yes since the title is in the URL; I hope I'm right because it is important for referencement. The typical url is "http://blablabla.com/cmsms/index.php?page=wap
To summarize, my issue is really sending "text/vnd.wap.wml" as content type in the HTTP reply header.
Thanks
First no, the content is different. i want to keep it simple (
The idea is to have one instance of cmsms handling both of them.
I know CMSMS is not mulitsite yet, so it's okay if I can't use the menu manager since I only have three pages on the wap, I can build the menu myself the old-style way.
Wap browsers are supposed to accept text/vnd.wap.wml
On my own device I know I can run the regular site wihtout any problem but I would like to keep the wap part of the site close to the wap specs (or to what I currently have)
I haven't used the media type feature of the stylesheets pages because I don't know what it really does. Is there a real interpretation of the querying device ? Can CMSM really make the difference between aural, braille, embossed, handheld, print, projection,.... I have doubts about it since I don't think it has a list with all imaginable User-Agents.
Anyway I made a try to associate my wap template with the handheld css with no luck. I mean the page displays correctly - which shouldn't because firefox or IE are not supposed to read wml natively (FF can do it though with the help of a plugin).
Regarding th pretty urls, I'm not sure, but I think yes since the title is in the URL; I hope I'm right because it is important for referencement. The typical url is "http://blablabla.com/cmsms/index.php?page=wap
To summarize, my issue is really sending "text/vnd.wap.wml" as content type in the HTTP reply header.
Thanks
-
alby
Re: Serving wap pages
No, you can send all media styles but it's browser device that interpreter the correct media style (if present)wapcamer wrote: I haven't used the media type feature of the stylesheets pages because I don't know what it really does. Is there a real interpretation of the querying device ? Can CMSM really make the difference between aural, braille, embossed, handheld, print, projection,.... I have doubts about it since I don't think it has a list with all imaginable User-Agents.
See this topic and this informationwapcamer wrote: Anyway I made a try to associate my wap template with the handheld css with no luck. I mean the page displays correctly - which shouldn't because firefox or IE are not supposed to read wml natively (FF can do it though with the help of a plugin).
To summarize, my issue is really sending "text/vnd.wap.wml" as content type in the HTTP reply header.
Alby
Re: Serving wap pages
Hi Alby,
thanks for your reply.
I had come through that topic already but it doens't suit my need.
I don't want to adapt the rendering of my content according to the browser kind, it's much simpler: I just want to serve my wap pages with wml content-type in the header.
By the way, I've tried writing an UDT containing:
and the UDT at the very beginning of my wap template, but still no luck.
I guess the header must have been sent already since the content-type stays "text/html".
thanks for your reply.
I had come through that topic already but it doens't suit my need.
I don't want to adapt the rendering of my content according to the browser kind, it's much simpler: I just want to serve my wap pages with wml content-type in the header.
By the way, I've tried writing an UDT containing:
Code: Select all
header("Content-Type: text/vnd.wap.wml");I guess the header must have been sent already since the content-type stays "text/html".
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Serving wap pages
Try this:
Create A UDT with this code in iit:
and call this UDT from the very top of your template.
in index.php the content type is sent out just before the html is.... and after the smarty is processed, so this should work.
Create A UDT with this code in iit:
Code: Select all
global $gCms;
$gCms->variables['content-type'] = 'text/vnd.wap.wml';in index.php the content type is sent out just before the html is.... and after the smarty is processed, so this should work.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Serving wap pages
Thank you Calguy,
you roxxx, that did (almost) it !!!
The content-type sent in the HTTP reply is :
Content-Type: text/vnd.wap.wml; charset=UTF-8
That's why I wanted...
However, it seems the "; charset=UTF-8" string is messing up with IE and even FF.
Do you know a way not to add that at the end of the Content-Type line ?
you roxxx, that did (almost) it !!!
The content-type sent in the HTTP reply is :
Content-Type: text/vnd.wap.wml; charset=UTF-8
That's why I wanted...
However, it seems the "; charset=UTF-8" string is messing up with IE and even FF.
Do you know a way not to add that at the end of the Content-Type line ?
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Serving wap pages
You could just hardcode the line in index.php (there's only one header call, it's easy to find).
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Serving wap pages
Pocket Explorer doesn't like either the charset string in the cotent-type.
I might follow your advice and delete the line in index.php (even though I'd rather avoid it for maintenance purpose) if you can garantee me there is no incidence on the web pages for regular browsers.
Anyway thank you very much for the help.
I might follow your advice and delete the line in index.php (even though I'd rather avoid it for maintenance purpose) if you can garantee me there is no incidence on the web pages for regular browsers.
Anyway thank you very much for the help.
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Serving wap pages
Quite honestly I think that that line in index.php should be a bit smartyer.
if the template encoding isn't set, it shouldn't output any charset stuff.... I'll think about adding that to the 1.2 list.
if the template encoding isn't set, it shouldn't output any charset stuff.... I'll think about adding that to the 1.2 list.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Serving wap pages
index.php line:288
The one line test keeps code shorter, but indeed it may be a little bit more precise.
I would do something like:
and drop the default 'get_encoding()'
but I'm not a php expert.
Still, I have looked everywhere, I haven't been able to find where to define one template's encoding.
Is it possible to define the encodeing separately per template?
Will there be a 1.2 release before the so long awaited 2.0 ?
Code: Select all
header("Content-Type: " . $gCms->variables['content-type'] . "; charset=" . (isset($pageinfo->template_encoding) && $pageinfo->template_encoding != ''?$pageinfo->template_encoding:get_encoding()));I would do something like:
Code: Select all
$encoding='';
if (isset($pageinfo->template_encoding) && $pageinfo->template_encoding != '')
$encoding="; charset=" . $pageinfo->template_encoding;
header("Content-Type: " . $gCms->variables['content-type'] . $encoding);
but I'm not a php expert.
Still, I have looked everywhere, I haven't been able to find where to define one template's encoding.
Is it possible to define the encodeing separately per template?
Will there be a 1.2 release before the so long awaited 2.0 ?
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Serving wap pages
There 'Used to be' a place where you could define an encoding per template.... it's not around anymore
and yes, there will be a 1.2 release, but it'll be THE LAST feature feature release in the 1.x series
and the 2.0 series will probably break backward compatibility.
and yes, there will be a 1.2 release, but it'll be THE LAST feature feature release in the 1.x series
and the 2.0 series will probably break backward compatibility.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Serving wap pages
Such a shame, it breaks the great modularity of CMSMS, which made me choose this CMS.There 'Used to be'
Maybe you know a way to hack direclty the db to modify the charset by hand (actually simply deleting it should be enough with the test !='' )
Otherwise, I might consider keeping my static wap site, which is not a very big issue.
Good to know. In this case, I will not wait for the 2.0 release for my website. I wanted it for multilingual stuff but since I could come up with a solution I'm happy with, it's not worth waiting then.the 2.0 series will probably break backward compatibility
Last edited by wapcamer on Sun Sep 09, 2007 12:07 am, edited 1 time in total.

