Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2021-01-13 10:56:06
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,315
[SOLVED] site data in XML
my client website has products page. now he wants all the data in that product page (each product has title, description and images) as XML file. how i get this?
Offline
Offline
#3 2021-01-13 12:05:18
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,315
Re: [SOLVED] site data in XML
Offline
Re: [SOLVED] site data in XML
First create a XML form type in Advanced options/Custom form template types:
[xml]
mediatype="text/xml"
title="XML"Then create a XML form (say products) like
<?xml version = "1.0"?>
<products>
<txp:article_custom>
<product>
   <title><txp:title /></title>
   <description><txp:meta_description format="" /></description>
   ...
</product>
</txp:article_custom>
</products>You should be able to access it via ?f=products now.
Offline
#5 2021-01-13 13:13:05
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,315
Re: [SOLVED] site data in XML
<?xml version = “1.0”?>
<products>
<txp:article_custom>
<product> <title><txp:title /></title> <description><txp:meta_description format=”“ /></description> …
by the product description I meant – text inside the body. is it correct then:
<title><txp:title /></title>
   <description><txp:body /></description>but images?
Offline
Re: [SOLVED] site data in XML
… I’m so curious Oleg. And now: if the question was how to import?
Last edited by Pat64 (2021-01-13 13:15:00)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Offline
#8 2021-01-13 13:48:42
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,315
Re: [SOLVED] site data in XML
etc wrote #328146:
Then create a XML form (say
products) like
<?xml version = "1.0"?>...You should be able to access it via
?f=productsnow.
oleg, this is not at all what i would like. i would like to export this page as XML. 
your solution produces this 
some page titles and one multiplied page description
Offline
Re: [SOLVED] site data in XML
Gallex wrote #328150:
some page titles and one multiplied page description
What do you want — I had no idea of how meta_description tag works :-) Try with <txp:body /> or
<txp:custom_field name="description" />And probably replace article_custom with article to filter by section.
Offline
Re: [SOLVED] site data in XML
@etc: Ok. With the help of a plugin (I thought you do it with some native TXP magic inside) :D
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
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  | hblack.art | EMAP | A Sea change | Toolkit of Care
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,315
Re: [SOLVED] site data in XML
colak wrote #328155:
It is good to know if
aeda-ja-garaaziis a category and iftootedis 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

