<p><a href="http://buildwithcraft.com/docs/templating/sectionmodel" rel="nofollow">Sections</a> do not have URLs, so <code>section.getUrl</code> will not return anything for you. </p>

<p>If you are trying to get an index page of all the entries in a section that has a URI, try slicing off the last segment of the entry's URL, and make sure you have an index.html template in that section's template folder. Take a look at the <a href="http://buildwithcraft.com/docs/templating-overview" rel="nofollow">templating documentation</a> for more information on this. </p>

<p>For the tags, make sure you call  <code>{% for tag in craft.tags.relatedTo(entry) %}</code> instead of <code>{% for tag in craft.tags.relatedTo(entries) %}</code> to get the tags related to the entry you are currently focused on in the for loop.</p>

<p>Hope this helps!</p>

CC BY-SA 3.0
2015-02-16T17:20:12.607Z
Thank you Aberkie :) I saw somewhere that sections don't have URLs, but I think didn't catch it. Tags works as it should!
Dominik Krulak
CC BY-SA 3.0
2015-02-16T20:12:10.520Z
To "slicing off the last segment of the entry's URL". Do you mean, to get rid off a {slug}, so only section's URL left? How do you propose to do that? I've searched documentation, but I didn't see anything like that.
Dominik Krulak
CC BY-SA 3.0
2015-02-15T22:34:49.810Z
2015-02-15T22:34:49.810Z
Aaron Berkowitz
<p>I'm trying to loop through entries in specific sections and output Entry's:
    - URL
    - Title
    - Type
    - Asset's image
    - asset's URL
    - Section's name
    - Section's URL
    - Tag's name
    - Tag's URL</p>

<p>So far I came to this with <strong>having difficulties with section's URL</strong> and <strong>tags</strong> that belongs to relative entry.</p>

<pre><code>        {% set entries = craft.entries.section(['worldTechnology','worldTravel']) %}
        {% for entry in entries %}
        &lt;div class="uk-width-medium-1-3"&gt;
        &lt;div class="uk-panel uk-panel-box uk-panel-box-primary"&gt;
                &lt;div class="uk-panel-teaser"&gt;
                    &lt;a href="{{ entry.url }}"&gt;
                    &lt;img class="uk-margin-bottom" src="http://cdni.wired.co.uk/1920x1280/k_n/London_5.jpg" alt=""&gt;
                    &lt;h3 class="uk-h3 uk-text-center uk-margin-top uk-panel-header"&gt;{{ entry.title}}&lt;/h3&gt;
                    &lt;/a&gt;
                &lt;/div&gt;
                &lt;div class="uk-text-center"&gt;
                    &lt;em&gt;in&lt;/em&gt;
                    &lt;span class="uk-margin-small-left"&gt;&lt;a href="{{ section.getUrl }}"&gt;{{ entry.section.name }}&lt;/a&gt;&lt;/span&gt;
                    &lt;span class="uk-margin-small-left"&gt;{{ entry.getType.name }}&lt;/span&gt;
                    &lt;ul class="uk-breadcrumb"&gt;
                        {% for tag in craft.tags.relatedTo(entries) %}
                        &lt;li&gt;
                            &lt;a href="" class="uk-badge uk-badge-tag uk-badge-clean"&gt;
                            &lt;i class="uk-icon-circle-thin uk-margin-small-right"&gt;&lt;/i&gt;
                            {{ tag.title }}
                            &lt;/a&gt;
                        &lt;/li&gt;
                        {% else %}
                        &lt;li&gt;
                            No tags found
                        &lt;/li&gt;
                    {% endfor %}
                    &lt;/ul&gt;
                &lt;/div&gt;
        &lt;/div&gt;
        &lt;/div&gt;
        {% endfor %}
</code></pre>

<p>I'm working on it only in evenings and I'm starting to like Craft and Twig. Hopefully some of you guys, will advice me or give me some direction to go after.</p>

<p>Thanks for viewing it.</p>

<tags><sections>
Output section and tag name with URL in entry loop
# Output section and tag name with URL in entry loop

(Asked by: username_0 on 2015-02-15)

I'm trying to loop through entries in specific sections and output Entry's:
    - URL
    - Title
    - Type
    - Asset's image
    - asset's URL
    - Section's name
    - Section's URL
    - Tag's name
    - Tag's URL
So far I came to this with having difficulties with section's URL and tags that belongs to relative entry.
        {% set entries = craft.entries.section(['worldTechnology','worldTravel']) %}
        {% for entry in entries %}
        
        
                
                    
                    
                    {{ entry.title}}
                    
                
                
                    in
                    {{ entry.section.name }}
                    {{ entry.getType.name }}
                    
                        {% for tag in craft.tags.relatedTo(entries) %}
                        
                            
                            
                            {{ tag.title }}
                            
                        
                        {% else %}
                        
                            No tags found
                        
                    {% endfor %}
                    
                
        
        
        {% endfor %}

I'm working on it only in evenings and I'm starting to like Craft and Twig. Hopefully some of you guys, will advice me or give me some direction to go after.
Thanks for viewing it.

**Tags:** tags, sections


---

## 1 answers

### Answer by username_1 on 2015-02-15. Score: 2 | Accepted answer

[Sections](http://buildwithcraft.com/docs/templating/sectionmodel) do not have URLs, so `section.getUrl` will not return anything for you.

If you are trying to get an index page of all the entries in a section that has a URI, try slicing off the last segment of the entry's URL, and make sure you have an index.html template in that section's template folder. Take a look at the [templating documentation](http://buildwithcraft.com/docs/templating-overview) for more information on this.

For the tags, make sure you call `{% for tag in craft.tags.relatedTo(entry) %}` instead of `{% for tag in craft.tags.relatedTo(entries) %}` to get the tags related to the entry you are currently focused on in the for loop.

Hope this helps!

> **Comments:**
> **username_0**: Thank you Aberkie :) I saw somewhere that sections don't have URLs, but I think didn't catch it. Tags works as it should!  
> **username_0**: To "slicing off the last segment of the entry's URL". Do you mean, to get rid off a {slug}, so only section's URL left? How do you propose to do that? I've searched documentation, but I didn't see anything like that.  

---

