Answers.Body: <p>I think I might have found a solution, although it might not be very elegant :/</p>
  
  <p>So, i'm basically looking to see if a category field has content and then taking out the anchor in the template.</p>
  
  <pre><code>{% if category.practiceIntroText|length %}
      &lt;a href="{{ category.url }}"&gt;
  {% endif %}
  {{ category.title }}
  {% if category.practiceIntroText|length %}
      &lt;/a&gt;
  {% endif %}
  </code></pre>
  
  <p>Same code but making use of the ternary operator:</p>
  
  <pre><code>{% set catWithContent = category.practiceIntroText|length %}
  
  {{ catWithContent ? '&lt;a href="' ~ category.url ~ '"&gt;' }}
  {{ category.title }}
  {{ catWithContent ? '&lt;/a&gt;' }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-04T12:32:49.443Z
Answers.Text: I think this is a good solution. Added a code variant that makes use of the ternary operator.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-04T11:15:55.367Z
Answers.LastActivityDate: 2015-09-04T12:31:26.637Z
Answers.LastEditDate: 2015-09-04T12:31:26.637Z
Answers.UserDisplayName: Martin
Body: <p>So my client has thrown a curve ball!  I've set-up a list of categories for the types of work they cover.  However, they DON'T want all of the categories to actually link to an entry.  In other words, they don't have content for some of the category pages, they would still like to SHOW the category on the front end but not have it clickable.</p>
  
  <p>So, some category links are clickable, others not :/</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks</p>
  
  <p>Martin</p>
  
Tags: <categories>
Title: Have some categories NOT linked to a category entry
ThreadText: # Have some categories NOT linked to a category entry
  
  (Asked by: username_0 on 2015-09-04)
  
  So my client has thrown a curve ball! I've set-up a list of categories for the types of work they cover. However, they DON'T want all of the categories to actually link to an entry. In other words, they don't have content for some of the category pages, they would still like to SHOW the category on the front end but not have it clickable.
  
  So, some category links are clickable, others not :/
  
  Any ideas?
  
  Thanks
  
  username_0
  
  **Tags:** categories
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-09-04. Score: 2
  
  I think I might have found a solution, although it might not be very elegant :/
  
  So, i'm basically looking to see if a category field has content and then taking out the anchor in the template.
  
  ```
  {% if category.practiceIntroText|length %}
      <a href="{{ category.url }}">
  {% endif %}
  {{ category.title }}
  {% if category.practiceIntroText|length %}
      </a>
  {% endif %}
  
  ```
  
  Same code but making use of the ternary operator:
  
  ```
  {% set catWithContent = category.practiceIntroText|length %}
  
  {{ catWithContent ? '<a href="' ~ category.url ~ '">' }}
  {{ category.title }}
  {{ catWithContent ? '</a>' }}
  
  ```
  
  > **Comments:**
  > **username_1**: I think this is a good solution. Added a code variant that makes use of the ternary operator.  
  
  ---
  
  