<p>Not sure, but I think the only way is to query for each locale and merge.</p>

<pre><code>{% set siteLocales = craft.i18n.getSiteLocales %}
{% set pages = [] %}
{% for locale in siteLocales %}
    {% set localePages = craft.entries.section('pages').locale(locale.getId).find() %}
    {% set pages = pages|merge(localePages) %}
{% endfor %}

{% for page in pages %}
    {{ page.title}}
{% endfor %}
</code></pre>

CC BY-SA 3.0
2015-05-01T12:20:27.727Z
Thanks Douglas. That definitely captures all the entries for all locales so I will use this method, but I am curious why the purpose of  `localeEnabled(false)`. [In the docs](http://buildwithcraft.com/docs/templating/craft.entries#localeEnabled) it suggests would displays all entries irrespective of locale.
Simon Leadbetter
CC BY-SA 3.0
2015-05-01T12:30:26.280Z
Having thought about this, I think this may be a bug. I’ll report it to P&T to see what they say.
Simon Leadbetter
CC BY-SA 3.0
2015-05-01T13:45:48.640Z
I think localeEnabled(false), means display an entry that otherwise wouldn't show because it is not localeEnabled (in settings) for that locale. I don't think it has anything to do with showing other locales.
Douglas McDonald
CC BY-SA 3.0
2015-05-01T13:56:28.240Z
Ah. That kind of makes sense. Thanks for taking the time to help with this. I’ll run with your solution.
Simon Leadbetter
CC BY-SA 3.0
2015-05-01T11:33:05.583Z
2015-05-01T11:33:05.583Z
Douglas McDonald
<p>I’m trying to build an XML sitemap that contains all entries including those in a different locale. I thought the <code>localeEnabled(false)</code> would allow entries for all locales to be displayed, however, the following doesn’t seem to work:</p>

<pre><code>{% set pages = craft.entries.section('pages').status('live').localeEnabled(false) %}
</code></pre>

<p>If is assign a locale:</p>

<pre><code>{% set pages = craft.entries.section('pages').status('live').locale('de') %}
</code></pre>

<p>then the entry is displayed.</p>

<p>I have tried using <code>.locale(null)</code> and <code>.localeEnabled(null)</code> without success.</p>

<p>Any ideas?</p>

<localization>
Display entries including all locales for XML sitemap
# Display entries including all locales for XML sitemap

(Asked by: username_0 on 2015-05-01)

I’m trying to build an XML sitemap that contains all entries including those in a different locale. I thought the localeEnabled(false) would allow entries for all locales to be displayed, however, the following doesn’t seem to work:
{% set pages = craft.entries.section('pages').status('live').localeEnabled(false) %}

If is assign a locale:
{% set pages = craft.entries.section('pages').status('live').locale('de') %}

then the entry is displayed.
I have tried using .locale(null) and .localeEnabled(null) without success.
Any ideas?

**Tags:** localization

---

## 1 answers

### Answer by username_1 on 2015-05-01. Score: 2 | Accepted answer

Not sure, but I think the only way is to query for each locale and merge.
{% set siteLocales = craft.i18n.getSiteLocales %}
{% set pages = [] %}
{% for locale in siteLocales %}
    {% set localePages = craft.entries.section('pages').locale(locale.getId).find() %}
    {% set pages = pages|merge(localePages) %}
{% endfor %}

{% for page in pages %}
    {{ page.title}}
{% endfor %}

> **Comments:**
> **username_0**: Thanks Douglas. That definitely captures all the entries for all locales so I will use this method, but I am curious why the purpose of  `localeEnabled(false)`. [In the docs](http://buildwithcraft.com/docs/templating/craft.entries#localeEnabled) it suggests would displays all entries irrespective of locale.  
> **username_0**: Having thought about this, I think this may be a bug. I’ll report it to P&T to see what they say.  
> **username_1**: I think localeEnabled(false), means display an entry that otherwise wouldn't show because it is not localeEnabled (in settings) for that locale. I don't think it has anything to do with showing other locales.  
> **username_0**: Ah. That kind of makes sense. Thanks for taking the time to help with this. I’ll run with your solution.  

---

