<p>The url's are always bound to entries. And with your current code, you're getting all <strong>entries</strong> in the 'contact' section, not the section itself. </p>

<p>But if this is a single, what you want is the url of the entry in the 'contact' section. Try this:</p>

<pre><code>{% set contactPage = craft.entries.section('contact').first() %}
{{ contactPage.getUrl() }}
</code></pre>

CC BY-SA 3.0
2014-09-25T12:45:41.530Z
2014-09-25T12:45:41.530Z
André Elvan
<p>Is it possible to output the path to a given section?</p>

<p>I'm using this to define the section model for the contact page (a single):</p>

<pre><code>{% set contactPage = craft.entries.section('contact') %}
</code></pre>

<p>But then, there doesn't seem to be a way to get the url from this model (according to <a href="http://buildwithcraft.com/docs/templating/sectionmodel" rel="noreferrer">section model page</a> on the Craft website.</p>

<p>It seems this information does exist as on the backend there's a link to the Contact page next to the link to edit the section.</p>

<p>Many thanks.</p>

<url><sections><templating>
Output URL to section
# Output URL to section

(Asked by: username_0 on 2014-09-25)

Is it possible to output the path to a given section?
I'm using this to define the section model for the contact page (a single):
{% set contactPage = craft.entries.section('contact') %}

But then, there doesn't seem to be a way to get the url from this model (according to section model page on the Craft website.
It seems this information does exist as on the backend there's a link to the Contact page next to the link to edit the section.
Many thanks.

**Tags:** url, sections, templating


---

## 1 answers

### Answer by username_1 on 2014-09-25. Score: 6 | Accepted answer

The url's are always bound to entries. And with your current code, you're getting all entries in the 'contact' section, not the section itself. 
But if this is a single, what you want is the url of the entry in the 'contact' section. Try this:
{% set contactPage = craft.entries.section('contact').first() %}
{{ contactPage.getUrl() }}


---

