Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » How?
  3. » sitemap

#1 2021-07-11 07:45:53

Gallex
Member
Registered: 2006-10-08
Posts: 1,223

sitemap

hi!

i use this code for sitemap

<txp:header value="application/xml; charset=utf-8" />
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc><txp:site_url /></loc></url>
<txp:section_list exclude="sitemap,various,test" break="">
<url><loc><txp:site_url /><txp:section />/</loc></url>
</txp:section_list>
<txp:article_custom section="meist,tooted" break="url" wraptag="" limit="9999">
<loc><txp:permlink /></loc>
<lastmod><txp:modified format="%Y-%m-%dT%H:%M:%SZ" /></lastmod>
</txp:article_custom>
</urlset>

it worked well until i upgraded site to 4.8.7.
now, site can’t be reached

what could be reason?

Offline

#2 2021-07-11 08:02:48

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

Re: sitemap

Hi,

in 4.8.5 and above, you need to set name in <txp:header />:

<txp:header name="Content-Type" value="application/xml; charset=utf-8" />

Offline

#3 2021-07-11 08:14:12

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,724
Website GitHub Twitter

Re: sitemap

Hi Gallex,

Here’s how we do it.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#4 2021-07-11 09:20:29

Gallex
Member
Registered: 2006-10-08
Posts: 1,223

Re: sitemap

etc wrote #330972:

Hi,

in 4.8.5 and above, you need to set name in <txp:header />:

<txp:header name="Content-Type" value="application/xml; charset=utf-8" />...

thank you!

Offline

#5 2021-07-11 09:23:46

Gallex
Member
Registered: 2006-10-08
Posts: 1,223

Re: sitemap

colak wrote #330976:

Hi Gallex,

Here’s how we do it.

what are the advantages of your solution?
to me it’s just too complicated…

Last edited by Gallex (2021-07-11 09:24:34)

Offline

#6 2021-07-11 14:01:42

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,724
Website GitHub Twitter

Re: sitemap

I had do add the category urls as <txp:category_list /> returns messy urls for me. Delete that part, and the rest of the syntax is very short.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

  1. Index
  2. » How?
  3. » sitemap

Board footer

Powered by FluxBB