Apraksts
This plugin adds the necessary infrastructure to add a “XML Document”-type custom post type which renders an XML document with an XSLT stylesheet in lieu of the regular post content. This can be useful in custom applications where there is a need to display XML documents from source, but you also want the regular benefits of WordPress tagging, commenting, etc. for these documents.
This plugin will not work out of the box… it is an infrastructure plugin. Additional coding (albeit minor) is necessary to get it running. See the “Installation” section for more information and sample code.
The development of this plugin is supported by MIT Global Shakespeares, where it will be used to render the full text of Shakespeare plays from TEI-XML source.
To-do
- Custom stylesheets, per-document and/or custom parameters to be passed to the XSL transform
- Search integration
Ekrānuzņēmumi
Uzstādīšana
- Make sure you have PHP5 and the PHP XSL module installed.
- Install and activate this plugin.
- Create a new custom post type with the
supports
attributexmldoc
. This custom post type will completely ignore itspost_content
, so make sure itssupports
statement does not includeeditor
. - Place your stylesheet in your current theme’s directory, named as
stylesheet.xsl
. - Create a new entity of your new post type. There will be an option to upload and choose an XML document (see screenshots). Do that, publish it, and view it, and you will see the XML document rendered with the XSLT as the content of that entry.
Here’s some sample code:
register_post_type('script',
array(
'label' => 'Scripts',
'public' => true,
'hierarchical' => false,
'supports' => array('title', 'comments', 'xmldoc')
)
);
For more information on register_post_type
and Custom Post Types, visit the Codex.
BUJ
- Your question here!
-
Our answer here!
Atsauksmes
Par šo spraudni nav atsauksmju.
Autori un izstrādātāji
“XML Documents” ir atvērtā pirmkoda programmatūra. Šo spraudni ir veidojuši šādi cilvēki.
LīdzdalībniekiTulkot “XML Documents” savā valodā.
Vai jūs interesē attīstība?
Pārlūkojiet kodu, apmeklējiet SVN krātuvi vai abonējiet attīstības žurnālu, ko izveidojis RSS.
Izmaiņu žurnāls
0.2
- A couple bugfixes for the admin interface.
0.1
- Initial public release.