Answers.Body: <p>Expanding a little bit more on <a href="https://craftcms.stackexchange.com/users/4554/dustin-c">Dustin C</a> <a href="https://craftcms.stackexchange.com/a/16180/7855">solution</a>. </p>
  
  <p>It is possible to get the <a href="https://docs.craftcms.com/v3/config/config-settings.html#siteurl" rel="nofollow noreferrer">siteURL</a> instead of hard coding it:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;a href="{{ siteUrl }}{{ entry.section.name|kebab }}"&gt;{{ entry.section }}&lt;/a&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-19T02:57:26.873Z
Answers.LastActivityDate: 2019-11-19T02:57:26.873Z
Answers.UserDisplayName: Alex Ljamin
Answers.Body: <p>Here's what I did. You'll need to set <code>sectionId</code> first.</p>
  
  <p><code>{% set thing = craft.sections.getSectionById(sectionId) %}</code>
  <code>{{thing.getUrlFormat()|split('/')[0]}}</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-19T01:25:23.160Z
Answers.Text: In the newest version of Craft `getSectionById` query should be expanded with `craft.app.sections.getSectionById(sectionId)`
Answers.UserDisplayName: Alex Ljamin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-12T22:28:58.240Z
Answers.LastActivityDate: 2015-06-12T22:28:58.240Z
Answers.UserDisplayName: Brandon Fredericksen
Answers.Body: <p>I know this is a year old, but I was scratching around trying to find a solution to this, and I came up with this.</p>
  
  <p>Try the kebab modifier.</p>
  
  <pre><code>&lt;a href="http://example.com/{{ entry.section|kebab }}"&gt;{{ entry.section }}&lt;/a&gt;
  </code></pre>
  
  <p>The kebab case makes it possible to convert your section titles to usable links -- at least they did in my case.</p>
  
  <p>Hope this helps someone in the future.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-03T00:08:19.850Z
Answers.LastActivityDate: 2016-08-03T00:08:19.850Z
Answers.UserDisplayName: Dustin C
Answers.Body: <p>Currently there is no method to get the link to the section's index page. However, if you try to visit <a href="http://domain.com/sectionhandle/" rel="nofollow">http://domain.com/sectionhandle/</a>, it will will try to load a template named index.html inside a folder named after your sectionhandle.</p>
  
  <p>In your example:</p>
  
  <pre><code>http://domain.com/places/ -&gt; templates/**places/index.html
  </code></pre>
  
  <p>I think that you can easily make that assumption and use that in a link. It's not elegant, and it doesn't take into account locales, but.. It's the only way at the moment, I think.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-01T12:14:11.197Z
Answers.Text: The issue is that the URL and the sectionHandle don't necessarily correspond so it's not a reliable way of doing it.
Answers.UserDisplayName: hamishtaplin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-01T12:28:18.770Z
Answers.Text: That is true. What about getting the url format through getUrlFormat(), and then get the first segment via the split('/') filter?
Answers.UserDisplayName: Fred Carlsen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-01T14:02:15.253Z
Answers.Text: Yes, that is the approach I have been taking so far.
Answers.UserDisplayName: hamishtaplin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-01T14:58:54.667Z
Answers.Text: You could also create a separate structure for your index pages, which would allow you to specify an exact url.
Answers.UserDisplayName: Douglas McDonald
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-01T15:19:57.940Z
Answers.Text: Or create routes to the index pages. It would be nice to just be able to define an index page within the section configuration though. Something like, "<checkbox> this section has an index page". And "Index page URL format" for each locale.
Answers.UserDisplayName: Douglas McDonald
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-01T10:50:34.557Z
Answers.LastActivityDate: 2014-10-01T10:50:34.557Z
Answers.UserDisplayName: Fred Carlsen
Body: <p>Similar to this question: <a href="https://craftcms.stackexchange.com/questions/2743/output-url-to-section">Output URL to section</a></p>
  
  <p>Let's say we have a section with handle 'places' which defines its URL format as 'places/{slug}'—how do I get the link to the 'places' index page? The question above goes via the entries in that section but that just gets the url of the first entry in that section.</p>
  
Tags: <sections>
Title: Get the URL of a section?
ThreadText: # Get the URL of a section?
  
  (Asked by: username_0 on 2014-10-01)
  
  Similar to this question: [Output URL to section](https://craftcms.stackexchange.com/questions/2743/output-url-to-section)
  
  Let's say we have a section with handle 'places' which defines its URL format as 'places/{slug}'—how do I get the link to the 'places' index page? The question above goes via the entries in that section but that just gets the url of the first entry in that section.
  
  **Tags:** sections
  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_1 on 2019-11-19. Score: 3
  
  Expanding a little bit more on [username_3](https://craftcms.stackexchange.com/users/4554/username_3) [solution](https://craftcms.stackexchange.com/a/16180/7855).
  
  It is possible to get the [siteURL](https://docs.craftcms.com/v3/config/config-settings.html#siteurl) instead of hard coding it:
  
  ```php
  <a href="{{ siteUrl }}{{ entry.section.name|kebab }}">{{ entry.section }}</a>
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2015-06-12. Score: 3
  
  Here's what I did. You'll need to set `sectionId` first.
  
  `{% set thing = craft.sections.getSectionById(sectionId) %}`
  `{{thing.getUrlFormat()|split('/')[0]}}`
  
  > **Comments:**
  > **username_1**: In the newest version of Craft `getSectionById` query should be expanded with `craft.app.sections.getSectionById(sectionId)`  
  
  ---
  
  ### Answer by username_3 on 2016-08-03. Score: 2
  
  I know this is a year old, but I was scratching around trying to find a solution to this, and I came up with this.
  
  Try the kebab modifier.
  
  ```
  <a href="http://example.com/{{ entry.section|kebab }}">{{ entry.section }}</a>
  
  ```
  
  The kebab case makes it possible to convert your section titles to usable links -- at least they did in my case.
  
  Hope this helps someone in the future.
  
  
  ---
  
  ### Answer by username_4 on 2014-10-01. Score: 1
  
  Currently there is no method to get the link to the section's index page. However, if you try to visit <http://domain.com/sectionhandle/>, it will will try to load a template named index.html inside a folder named after your sectionhandle.
  
  In your example:
  
  ```
  http://domain.com/places/ -> templates/**places/index.html
  
  ```
  
  I think that you can easily make that assumption and use that in a link. It's not elegant, and it doesn't take into account locales, but.. It's the only way at the moment, I think.
  
  > **Comments:**
  > **username_0**: The issue is that the URL and the sectionHandle don't necessarily correspond so it's not a reliable way of doing it.  
  > **username_4**: That is true. What about getting the url format through getUrlFormat(), and then get the first segment via the split('/') filter?  
  > **username_0**: Yes, that is the approach I have been taking so far.  
  > **username_5**: You could also create a separate structure for your index pages, which would allow you to specify an exact url.  
  > **username_5**: Or create routes to the index pages. It would be nice to just be able to define an index page within the section configuration though. Something like, "<checkbox> this section has an index page". And "Index page URL format" for each locale.  
  
  ---
  
  