Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
How can I serve all articles in a certain section as xhtml+xml?
Howdy!
I’m working on a site that uses Prince XML to generate PDFs from articles posted to a certain hidden section. This works fine as long as the XHTML is valid, but when I use MathML, Prince doesn’t recognize the additional XML tags. I know that Textpattern serves pages as text/html, which is best for most purposes, but I’m thinking Prince requires xhtml+xml to understand the MathML tags. I tried posting this at the very top of my page
template:
<txp:php>header('Content-type: application/xhtml+xml');</txp:php>
…but it doesn’t seem to have changed the output. Any recommendations?
Edit: FYI, Prince can process the same documents if I save them as XML; that’s why I thought serving the section as xhtml+xml might work.
Last edited by johnstephens (2010-01-05 22:10:46)
Offline
Re: How can I serve all articles in a certain section as xhtml+xml?
rah_external_output Outputs external content-type snippets where you set the content type.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: How can I serve all articles in a certain section as xhtml+xml?
Thanks, Matt. I thought of that, as I use that plugin for other parts of the site, but I don’t know how to get individual article output from rah_external_output without making an “external output” for each and every article ID, which isn’t feasible. Am I missing something?
Offline
Re: How can I serve all articles in a certain section as xhtml+xml?
Have you seen this?
Offline
Re: How can I serve all articles in a certain section as xhtml+xml?
Brilliant! Thank you, Zanza!
I had seen that plugin, but I totally forgot about it.
Offline
#6 2010-01-06 10:47:35
- Aalandriel
- New Member
- From: Denmark
- Registered: 2009-12-27
- Posts: 7
Re: How can I serve all articles in a certain section as xhtml+xml?
For rah_external_output I’ve found that if you can send the ID through a link kinda like:
www.yoursite.com/?rah_external_output=outputform&id=<txp:article_custom id=”“>
then you can grab the id with php and use that to get the articles you need.
Offline
Re: How can I serve all articles in a certain section as xhtml+xml?
johnstephens wrote:
<txp:php>header('Content-type: application/xhtml+xml');</txp:php>
…but it doesn’t seem to have changed the output. Any recommendations?
——-
No that does not work properly.
Let us have a look to the two different urls (This are my old experiments on a static page with Content Negotiation).
http://web-sniffer.net/?url=http://applikationssoftware.de/impressum.html
and
http://web-sniffer.net/?url=http://applikationssoftware.de/impressum.xhtml
The fist version is an html file and the Websniffers protocls the Content-Type: text/html. The second version is an xhtml-file and websniffer protocols the value application/xhtml+xml.
I’ve just put the string <txp:php>header(‘Content-type: application/xhtml+xml’);</txp:php> in the “seitenvorlage” named default and the Content-Type of my textpattern page does not change.
So the snippet does not work!
Best regards
Wolfgang
Last edited by Wolfgang (2010-01-06 12:35:11)
Offline