All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: XML sitemaps outputting spanish page_url in other languages

Status Resolved
Add-on / Version Publisher 3.10
Severity
EE Version 7.3.11

Juan Carlos Celaya Dibout

Sep 04, 2023

Hi,

i noticed xml sitemap its outputting the spanish url value for en and pt-pt, only adding /en/ or /pt-pt/ but not taking the english or portuguese url title (or structure title).

Example:

Edit Entry: PrestaShop alto rendimiento | ExpressionEngine (factoriadigital.com) , if you check url title/Structure title for english is high-performance-prestashop

But in sitemap it appears like this:

https://www.factoriadigital.com/en/prestashop/rendimiento-prestashop/2023-08-29


instead of


https://www.factoriadigital.com/en/prestashop/high-performance-prestashop/2023-08-29


I tried to empty EE cache and rocket cache, even if it seems to be excluded from both but who knows, same result.

This is the code btw:

  {exp:publisher:languages}
  {exp:structure:entries orderby="edit_date" sort="desc" channel="homepage|pages" publisher_lang_id="{id}” publisher_status=“open” publisher_cache=“yes”}
  {if ! ('{page_url}’ *= ‘/landing/’)}

{site_url}{if '{short_name}’ != ‘es’}{short_name}/{/if}{page_url:replace find='{site_url}’ replace=’‘}/{edit_date format='%Y-%m-%d'}

  {/if}
  {/exp:structure:entries}
  {/exp:publisher:languages}

Don’t know if that’s structure or publisher related, and if using your sitemap plugin would solve this issue.

Regards,

#1

BoldMinded (Brian)

I’m on vacation now so my responses are slow. Are you rendering a single Sitemap with all the languages in it? If so I’d recommend a separate Sitemap for each language, or don’t use the structure tag. The structure URLs are created on page load for the current language, it can’t jump back and forth to list out URLs for different languages on the same page. The same thing would happen with the Pages module… it’s just how the site_pages array works.

#2

Juan Carlos Celaya Dibout

Comment has been marked private.

#3

BoldMinded (Brian)

Just create a Sitemap.xml file and if using language prefixed URLs it should load correctly. E.g /en/Sitemap.xml, /es/sitemap.xml, etc. I think you can tell Google about the different URLs directly through their web tools.

#4

Juan Carlos Celaya Dibout

Hi, it seems there is some weird issue, don’t know if with cache or what, but the sitemaps that have language slugs reply with wrong http headers:

Incorrect http header content-type: “text/html; charset=UTF-8” (expected: “application/xml”)

you can replicate that here: https://www.xml-sitemaps.com/validate-xml-sitemap.html

with this sitemap:

https://www.factoriadigital.com/pt-pt/xml-sitemap (error)

or this one:

https://www.factoriadigital.com/en/xml-sitemap (error)

but then:

https://www.factoriadigital.com/xml-sitemap (fine)

it seems deleting cache make it work for a second but then nope.

#5

BoldMinded (Brian)

Are you using the Sitemap module or just Publisher?

#6

Juan Carlos Celaya Dibout

only publisher, should i use the sitemap module?

#7

BoldMinded (Brian)

Publisher doesn’t set headers like that… I don’t think this is a Publisher issue. I think there is something else going on with your templates.

#8

BoldMinded (Brian)

I did a little testing with the Sitemap module and Publisher, and it appears to work with Publisher pretty well out of the box. I added a hint on the docs page about it. https://docs.boldminded.com/sitemap/docs/configuration-and-usage - You can download a free trial and give it a shot if you want.

#9

BoldMinded (Brian)

Comment has been marked private.

#10

BoldMinded (Brian)

Comment has been marked private.

Login to reply