Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [SOLVED] site data in XML
Further to Oleg’s suggestion can try the code below? If the data is in the excerpt
, just change body
to excerpt
. You may need to read about the possibilities of including html in xml. Check this intro from wikipedia.
<?xml version = "1.0"?>
<products>
<txp:article_custom section="tooted" category="aeda-ja-garaazi" limit="999">
<product>
<title><txp:title /></title>
<image><txp:article_image /></image>
<description><txp:body /></description>
</product>
</txp:article_custom>
</products>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] site data in XML
ps. If you do not require an ‘embedded’ image, <image><txp:article_image /></image>
should be replaced with
<image>
<txp:variable name="ai"><txp:custom_field name="article_image" /></txp:variable>
<txp:images id='<txp:variable name="ai" />'>
<txp:site_url />images/<txp:variable name="ai" /><txp:image_info type="ext" />
</txp:images>
</image>
Remember to delete the line-breaks to allow for a better xml presentation.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#15 2021-01-15 13:56:53
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,289
Re: [SOLVED] site data in XML
colak wrote #328168:
Further to Oleg’s suggestion can try the code below? If the data is in the
excerpt
, just changebody
toexcerpt
. You may need to read about the possibilities of including html in xml. Check this intro from wikipedia.
<?xml version = "1.0"?>...
looks perfect to me!
huge thank you colak and oleg!
Last edited by Gallex (2021-01-15 14:07:48)
Offline
Re: [SOLVED] site data in XML
You may want to change <?xml version = "1.0"?>
to <?xml version="1.0" encoding="UTF-8"?>
as you are not using only Latin characters.
And it validates too:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline