Question

Photo of Don Smallman

0

Home Page Sub Items

Is it possible to add 5 sub-menu items to the home page?  I changed the variable to 5, but it did not change anything.

  • Photo of Don Smallman

    1

    Yeah, I'm not sure either.  It was weird.  Yes we are on Arvixe, but no site issues at the moment.  I just deleted that page and started over.

    I was able to change the number of sub-Ads though.  I went to the wwwroot\Themes\StarkRock\Assets\Liquid folder and edited the _AdList.liquid file.  I changed col-md-3 to col-md-2 and Modulo:4 to Modulo:5. 

    Apparently, you can NOT have 5 boxes for Sub-Ads.  The number of boxes has to be able to divide into 12, since in reality there are 12 boxes across.  col-md-3 is like the divisor.  When set to 3 (or 12/3) we get 4 boxes, when I changed it to 2, I got 6 boxes etc...

  • Photo of Trey Hendon III

    0

    I think you have to update the PageNav.lava in your template to match the number of levels you want to dislay.  You'll need to use "Debug mode" to get all the child, grandchild, etc names.

  • Photo of Don Smallman

    0

    Thanks Trey.

    Not sure I understand though.

  • Photo of Trey Hendon III

    0

    Try using this Lava to expose all the levels:

     

    {% if Page.DisplayChildPages == 'true' and Page.Pages != empty %}

        <ul class="nav navbar-nav">

            {% for childPage in Page.Pages %}

                {% if childPage.Current == 'true' %}

                <li class="active">

                {% else %}

                <li>

                {% endif %}

                    <a href="{{ childPage.Url }}">{{ childPage.Title }}</a>

                    {% if Page.DisplayChildPages == 'true' and Page.Pages != empty %}

                        <ul class="nav navbar-nav-1">

                        {% for childPage in childPage.Pages %}

                            {% if childPage.Current == 'true' %}

                            <li class="active">

                            {% else %}

                            <li>

                            {% endif %}

                            <a href="{{ childPage.Url }}">{{ childPage.Title }}</a>

                            {% if Page.DisplayChildPages == 'true' and Page.Pages != empty %}

                                <ul class="nav navbar-nav-2">

                                {% for childPage in childPage.Pages %}

                                    {% if childPage.Current == 'true' %}

                                    <li class="active">

                                    {% else %}

                                    <li>

                                    {% endif %}

                                    <a href="{{ childPage.Url }}">{{ childPage.Title }}</a>

                                    {% if Page.DisplayChildPages == 'true' and Page.Pages != empty %}

                                    <ul class="nav navbar-nav-3">

                                    {% for childPage in childPage.Pages %}

                                        {% if childPage.Current == 'true' %}

                                        <li class="active">

                                        {% else %}

                                        <li>

                                        {% endif %}

                                        <a href="{{ childPage.Url }}">{{ childPage.Title }}</a>

                                        {% if Page.DisplayChildPages == 'true' and Page.Pages != empty %}

                                            <ul class="nav navbar-nav-4">

                                            {% for childPage in childPage.Pages %}

                                                {% if childPage.Current == 'true' %}

                                                <li class="active">

                                                {% else %}

                                                <li>

                                                {% endif %}

                                                <a href="{{ childPage.Url }}">{{ childPage.Title }}</a>

                                                </li>

                                            {% endfor %}

                                            </ul>

                                        {% endif %}

                                        </li>

                                    {% endfor %}

                                    </ul>

                                    {% endif %}

                                    </li>

                                {% endfor %}

                                </ul>

                            {% endif %}

                            </li>

                        {% endfor %}

                        </ul>

                    {% endif %}

                </li>

            {% endfor %}

        </ul>

    {% endif %}

  • Photo of Don Smallman

    0

    Thanks Trey, where would i use the script?  sorry, not a developer or programmer.

  • Photo of Trey Hendon III

    0

    Hey Don,

    Sorry!  In the Block Settings, there should be a setting named Template.  In my install the value is:  {% include '~~/Assets/Lava/PageNav.lava' %}

    I would copy/paste whatever your current setting details are into a text file and save that, just in case.  Next, from what I understand, you should be able to replace that entire value with the code I shared previously.

    I will say that when I tested the code on my site, the sub-pages are not setup to be styled or anything, so it's not going to look correct unless you know how to make the hover menus.

    Thanks,
    Trey

     

  • Photo of Don Smallman

    0

    OK  Thank you!

    It is weird that we can easily change the value from 3 to 4 and it works.  I guess 5 is prob not in the norm.

  • Photo of Don Smallman

    0

    Trey the script didnt work.  When I pasted it in the blocks when away.  After waiting a bit and refreshing several times, I pasted the current script back in and not the page does not load and I cant get back to the settings or see the blocks at all.

  • Photo of Trey Hendon III

    0

    Hey Don,

    I just repeated these steps in my sandbox and it works, so I'm not sure what happened.

    By chance, are you using Arvixe?  I've been getting some emails from them saying they're having some DDOS attacks over the last 24 hours.

    -Trey

  • Photo of Trey Hendon III

    0

    Oh, I was not referring to Ads in my answer above.  I thought you were wanting to add Menu Items to the Nav menu.  So sorry!  The Liquid I posted above came from the PageNav.lava file.

  • Photo of Don Smallman

    0

    LOL  Guess I should have said Homepage - Sub-Ads.  Anyway it is all back to normal now.