<p>From what I gather from your question you want some sort of sub-categorisation of your entries. </p>

<p>Such that one entry can have the URL as:
    siteUrl/section/subject-1/entry-slug</p>

<p>while another entry can have a URL as:
    siteUrl/section/subject-2/entry-slug</p>

<p>If that is what you want to achieve then you have to look into Structures instead of Channels</p>

<p>Here is the link: <a href="http://buildwithcraft.com/docs/sections-and-entries#sections" rel="nofollow">http://buildwithcraft.com/docs/sections-and-entries#sections</a></p>

<p>You can basically have multiple entries with sub-urls in the same structure section.</p>

CC BY-SA 3.0
2014-10-31T10:53:38.210Z
2014-10-31T10:53:38.210Z
Moin Qidwai
<p>As Moin suggested a Structure works very well for this. I would add that you can also define different Entry Types for the different levels and/or page types (i.e. section landing page vs. entry page vs contact page) and test for <code>entry.type</code> in your template. </p>

<pre><code>{% extends "_layout" %}

{# switch content based on Entry Type #}
{% switch entry.type %}
    {% case 'landing %}
        {# my landing page content or template include #}
    {% case 'entry' %}
        {# my entry page content or template include #}
    {% case 'contact' %}
        {# my contact page content or template include #}
{% endif %}
</code></pre>

<p>Or, if you don't want or need an actual landing page you can create 'pretend' empty entries (i.e. entries with title and slug only) for the sole purpose of generating the navigation and uri segments that your looking for. If someone clicks a link to one of the these 'empty' pages (or accesses the url directly) you can simply redirect them to the next entry in the hierarchy that actually has content.</p>

<pre><code>{% extends "_layout" %}

{# if no body content and has descendants (i.e. no landing page) 
 # redirect to first descendant with content defined #}

{% if not entry.body is defined or entry.body == "" %}
    {% set decendants = entry.descendants %}
    {% if decendants|length %}
        {% redirect decendants.first().url %}
    {% endif %}
{% endif %}

{% block content %}
    {{ entry.title }}
    {{ entry.body }}
{% endblock %}
</code></pre>

<p>If you don't want to trust 'body' being empty, you could also more explicitly define an entry type that had no fields other than title, called 'pretendSection' for example, and test for that entry type, and redirect as above.</p>

CC BY-SA 3.0
2014-11-03T11:40:32.470Z
Just to let you know, i've implemented this and it works great!  Many, many thanks to you and Moin.
Martin
CC BY-SA 3.0
2014-10-31T14:26:31.210Z
2014-10-31T14:26:31.210Z
Douglas McDonald
<p>I have a very simple site split into sections. All pages use just one template.</p>

<p>The previous site had sections such as /section/subject.  I had thought I could have all entries in just one section and then alter the URL on each entry to include a 'pretend' section /section/{slug}, but this defaults to /section-subject.</p>

<p>Is there a way to have /settings/subject/ without creating new sections?</p>

<p>Many thanks</p>

<p>Martin</p>

CC BY-SA 3.0
2014-10-31T10:28:23.327Z
It's a bit unclear how your sections are set up in your new site. When you say "include a 'pretend' section /section/{slug}, but this defaults to /section-subject", how did you do this? Did you just prepend "section/" manually to the slug of the entry? What, in your new site, determines what the "section" part of the url should be?
André Elvan
<url><sections>
Insert a url segment without creating sections
# Insert a url segment without creating sections

(Asked by: username_0 on 2014-10-31)

I have a very simple site split into sections. All pages use just one template.

The previous site had sections such as /section/subject. I had thought I could have all entries in just one section and then alter the URL on each entry to include a 'pretend' section /section/{slug}, but this defaults to /section-subject.

Is there a way to have /settings/subject/ without creating new sections?

Many thanks

username_0

**Tags:** url, sections

> **Comments:**
> **username_1**: It's a bit unclear how your sections are set up in your new site. When you say "include a 'pretend' section /section/{slug}, but this defaults to /section-subject", how did you do this? Did you just prepend "section/" manually to the slug of the entry? What, in your new site, determines what the "section" part of the url should be?  

---

## 2 answers

### Answer by username_2 on 2014-10-31. Score: 3 | Accepted answer

From what I gather from your question you want some sort of sub-categorisation of your entries.

Such that one entry can have the URL as:
siteUrl/section/subject-1/entry-slug

while another entry can have a URL as:
siteUrl/section/subject-2/entry-slug

If that is what you want to achieve then you have to look into Structures instead of Channels

Here is the link: <http://buildwithcraft.com/docs/sections-and-entries#sections>

You can basically have multiple entries with sub-urls in the same structure section.


---

### Answer by username_3 on 2014-10-31. Score: 1

As Moin suggested a Structure works very well for this. I would add that you can also define different Entry Types for the different levels and/or page types (i.e. section landing page vs. entry page vs contact page) and test for entry.type in your template. 
{% extends "_layout" %}

{# switch content based on Entry Type #}
{% switch entry.type %}
    {% case 'landing %}
        {# my landing page content or template include #}
    {% case 'entry' %}
        {# my entry page content or template include #}
    {% case 'contact' %}
        {# my contact page content or template include #}
{% endif %}

Or, if you don't want or need an actual landing page you can create 'pretend' empty entries (i.e. entries with title and slug only) for the sole purpose of generating the navigation and uri segments that your looking for. If someone clicks a link to one of the these 'empty' pages (or accesses the url directly) you can simply redirect them to the next entry in the hierarchy that actually has content.
{% extends "_layout" %}

{# if no body content and has descendants (i.e. no landing page) 
 # redirect to first descendant with content defined #}

{% if not entry.body is defined or entry.body == "" %}
    {% set decendants = entry.descendants %}
    {% if decendants|length %}
        {% redirect decendants.first().url %}
    {% endif %}
{% endif %}

{% block content %}
    {{ entry.title }}
    {{ entry.body }}
{% endblock %}

If you don't want to trust 'body' being empty, you could also more explicitly define an entry type that had no fields other than title, called 'pretendSection' for example, and test for that entry type, and redirect as above.

> **Comments:**
> **username_0**: Just to let you know, i've implemented this and it works great!  Many, many thanks to you and Moin.  

---

