How to hide {{ entry.title }} on a {structure} page but show it on a {structure}/{category-slug} page Here's the breakdown:

» structure with two categories. Each category has +10 entries. 

» Template is structure / index.html and _entryview.html 

I'd like to show two links and a description of both categories on the /structure/ URL. 

However...

On the /structure/index/ page, I'd like to show the entries for each category — all using the same index template. 

So far I can pull the {category.title}s and the {entry.title} ... but it's the same on both pages (structure/ and structure/category)

{% set categories = craft.categories.group('fellowsCat') %}

 &lt;ul&gt;
  {% nav category in craft.categories
    .group('fellowsCat')
    .limit(11)
    %}
    &lt;li&gt;
      &lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;
      {% ifchildren %}
        &lt;ul&gt;
          {% children %}
        &lt;/ul&gt;
      {% endifchildren %}
    &lt;/li&gt;
  {% endnav %}
&lt;/ul&gt; 

&lt;ul&gt;

{% set entries = craft.entries({
  section:  'fellows',
  relatedTo:  craft.categories('fellowsCat'),
})
%}


{# ___________________________
this is where things fall apart. 
If I'm on /structure/ I don't want to see entries. 
If I'm on /structure/category, I do. 
_____________________________
#}


{% if craft.categories is not null %}

  {% for entry in entries %}
    &lt;li&gt;  &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
  {% endfor %}
  &lt;/ul&gt;

{% else %}
nothing to see
{% endif %}


I suspect there's something with the {% if craft.categories is not null %} line that would do the job, but I can't figure it out.
Figured it out. 

    {% set categories = craft.categories.group('fellowsCat') %}

 &lt;ul&gt;
  {% nav category in craft.categories
    .group('fellowsCat')
    %}
    &lt;li&gt;
      &lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;
      {% ifchildren %}
        &lt;ul&gt;
          {% children %}
        &lt;/ul&gt;
      {% endifchildren %}
    &lt;/li&gt;
  {% endnav %}
&lt;/ul&gt; 

&lt;ul&gt;


{# --- this is the key line here ---#}
{% if category is defined %}

{% set entries = craft.entries({
  relatedTo:  category,

})
%}

{% if craft.entries.relatedTo(category) %} 


      {% for entry in entries %}
        &lt;li&gt;  &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
      {% endfor %}
      &lt;/ul&gt;

     {% else %} 
    nothing to see
     {% endif %} 
     {% endif %}