Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#11 2021-01-13 15:15:31
- colak
- Admin
- From: Cyprus
- Registered: 2004-11-20
- Posts: 8,451
- Website
Re: [SOLVED] site data in XML
Is the https://kenovoeesti.ee/tooted/aeda-ja-garaazi/ page an article or a category? The reason I am asking is because it finishes with /
which implies that it is not an article. It is good to know if aeda-ja-garaazi
is a category and if tooted
is a section.
Also…
- Are the images loaded via
article_image
? - In case it is a category, Do you expect the data of the tables to be included in the xml?
Last edited by colak (2021-01-13 15:58:12)
Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.
Offline
#12 2021-01-14 09:15:42
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,178
Re: [SOLVED] site data in XML
colak wrote #328155:
It is good to know if
aeda-ja-garaazi
is a category and iftooted
is a section.
you are absolutely correct – aeda-ja-garaazi
is a category and tooted
is a section.
- Are the images loaded via
article_image
?
yes
- In case it is a category, Do you expect the data of the tables to be included in the xml?
yes
Offline
#13 2021-01-14 16:45:55
- colak
- Admin
- From: Cyprus
- Registered: 2004-11-20
- Posts: 8,451
- Website
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.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.
Offline
#14 2021-01-14 19:11:20
- colak
- Admin
- From: Cyprus
- Registered: 2004-11-20
- Posts: 8,451
- Website
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.org | hblack.net | State Machines | NeMe @ github
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,178
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
#16 2021-01-15 15:09:24
- colak
- Admin
- From: Cyprus
- Registered: 2004-11-20
- Posts: 8,451
- Website
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.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.
Offline