<p>Got it...</p>

<pre><code>{% set crawledEntries = craft.entries({
    relatedTo: { sourceElement: crawlSites, field: "entryCrawler" },
    order: "sortOrder"
}) %}

{% set otherLocales = craft.i18n.getSiteLocaleIds()|without(craft.locale) %}

{% for entry in crawledEntries %}
    Disallow: /{{ entry.uri }}
    {% for locale in otherLocales %}
        {% set entryL = craft.entries.id(entry.id).locale(locale).first() %}

        {% if entryL %}
            Disallow: /{{locale}}/{{ entryL.uri }}
        {% endif %}
    {% endfor %}
{% endfor %}
</code></pre>

CC BY-SA 3.0
2017-02-22T13:41:45.883Z
2017-02-22T17:31:11.643Z
2017-02-22T17:31:11.643Z
Mvrcel Boer
<p>For the <code>robot.txt</code> file, I want to get every URI from the entries for every language. Right now it just gets the URI from one language.</p>

<pre><code>{% set crawledEntries = craft.entries({
    relatedTo: { sourceElement: crawlSites, field: "entryCrawler" },
    order: "sortOrder"
}) %}

{% for entry in crawledEntries %}
    Disallow: /{{ entry.uri }}
{% endfor %}
</code></pre>

<p>This now loops just through one locale.</p>

<url><language>
Get every slug from entry for each language
# Get every slug from entry for each language

(Asked by: username_0 on 2017-02-22)

For the robot.txt file, I want to get every URI from the entries for every language. Right now it just gets the URI from one language.
{% set crawledEntries = craft.entries({
    relatedTo: { sourceElement: crawlSites, field: "entryCrawler" },
    order: "sortOrder"
}) %}

{% for entry in crawledEntries %}
    Disallow: /{{ entry.uri }}
{% endfor %}

This now loops just through one locale.

**Tags:** url, language


---

## 1 answers

### Answer by username_0 on 2017-02-22. Score: 1

Got it...
{% set crawledEntries = craft.entries({
    relatedTo: { sourceElement: crawlSites, field: "entryCrawler" },
    order: "sortOrder"
}) %}

{% set otherLocales = craft.i18n.getSiteLocaleIds()|without(craft.locale) %}

{% for entry in crawledEntries %}
    Disallow: /{{ entry.uri }}
    {% for locale in otherLocales %}
        {% set entryL = craft.entries.id(entry.id).locale(locale).first() %}

        {% if entryL %}
            Disallow: /{{locale}}/{{ entryL.uri }}
        {% endif %}
    {% endfor %}
{% endfor %}


---

