Remove page link from navigation Trying to output navigation:


Home 
About 
Services

Sub 1
Sub 2
Sub 3 

List item
Testimonials 
Contact 
Get Quote


I'd like to remove the link to the Services page, preferably to &lt;a href"#"&gt; and if accessed through url, redirect to homepage.

Here's how I'm currently outputting nav:

        {# get menu items #}
        {% set pageItems = craft.entries.section('services').level('&lt;= 2') %}
        {# % set pageItems = craft.entries.level('&lt;= 2') %# }

        {# Output the sub menu #}
        &lt;ul&gt;
            &lt;li&gt;&lt;a href="{{ siteUrl }}"&gt;Home&lt;/a&gt;&lt;/li&gt;
            {% set entry = craft.entries.slug('about').first %}
            &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;

            {% nav page in pageItems %}
            &lt;li&gt;
                &lt;a href="{{ page.navigationUrlOverride ? page.navigationUrlOverride : page.url }}"&gt;
                    {% if page.navigationTitle %}{{ page.navigationTitle|nl2br }}{% else %}{{ page.title }}{% endif %}
                &lt;/a&gt;
                {% ifchildren %}
                &lt;div class="drop"&gt;
                    &lt;ul&gt;
                        {% children %}
                    &lt;/ul&gt;
                &lt;/div&gt;
                {% endifchildren %}
            &lt;/li&gt;
            {% endnav %}
        &lt;/ul&gt;
        &lt;ul&gt;
            {% set entry = craft.entries.slug('testimonials').first %}
                &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
            {% set entry = craft.entries.slug('contact').first %}
                &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
            {% set entry = craft.entries.slug('get-a-quote').first %}
                &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;


Any help is much appreciated. Thanks in advance.
There are two very different questions here, but I will try my best to answer them both!

The first being "How do I hide a page from the navigation?"

The simplest way I can think of for this, that is also controllable through Craft, is to create a simple "Hide from navigation" Lightswitch field, and add this to your entry types.

When looping through entries for the navigation, you can check whether the lightswitch has been checked, and if it has, don't show that entry in the nav:

{% for entry in craft.entries.section('lorem').hideFromNavigation(0) %}
    --
{% endfor %}


The second question is "How do I redirect to the homepage if someone visits /services?"

This can be achieved with the redirect tag. In your services/index.twig template file, you can simply add:

{% redirect siteUrl %}