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,185
[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
#2 2021-01-13 12:02:11
- etc
- Developer
- Registered: 2010-11-11
- Posts: 4,076
- Website
Offline
#3 2021-01-13 12:05:18
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,185
Re: [SOLVED] site data in XML
Offline
#4 2021-01-13 12:18:06
- etc
- Developer
- Registered: 2010-11-11
- Posts: 4,076
- Website
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,185
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
#6 2021-01-13 13:13:05
- Pat64
- Plugin Author
- From: France
- Registered: 2005-12-12
- Posts: 1,453
- Website
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
#7 2021-01-13 13:18:35
- etc
- Developer
- Registered: 2010-11-11
- Posts: 4,076
- Website
Offline
#8 2021-01-13 13:48:42
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,185
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=products
now.
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
#9 2021-01-13 14:06:30
- etc
- Developer
- Registered: 2010-11-11
- Posts: 4,076
- Website
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
#10 2021-01-13 14:13:36
- Pat64
- Plugin Author
- From: France
- Registered: 2005-12-12
- Posts: 1,453
- Website
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