GithubHelp home page GithubHelp logo

Update Documentation about pico HOT 2 CLOSED

quma avatar quma commented on August 17, 2024
Update Documentation

from pico.

Comments (2)

jasonrobb avatar jasonrobb commented on August 17, 2024

There are two ways I can think of off the top of my head.

  1. You could hard-code your navigation onto the page. Go to /themes/default/index.html and start writing your HTML right before the {{ content }} tag on line 20 (I think).
  2. You could put your navigation in a separate file called nav.html, save it in the /themes/default/ folder.

Then, in /themes/default/index.html on line 19 (after the body tag and before the {{ content }} tag) write: {% include 'nav.html' %}.

If you want to make your navigation dynamic, you'll have to read the Twig manual to figure that out: http://twig.sensiolabs.org/documentation

Good luck!

from pico.

everslick avatar everslick commented on August 17, 2024

insert something like this in your theme index.html:

   <header id="header">
     <div class="inner">
         <h1><a href="{{ base_url }}">{{ site_title }}</a></h1>

         {% set delim = config.menu_delimiter|default('|') %}
         {% set menu_headers = [] %}

         {% for page in pages %}
            {% set title = page.title|split(delim) %}
            {% if (title|length == 2) and (title[0] not in menu_headers) %}
               {% set menu_headers = menu_headers|merge([title[0]]) %}
            {% endif %}
         {% endfor %}

         <div class="right">
            <ul id="TopMenu">
               {% for menu_header in menu_headers %}
                  <li>
                     <a href="#">{{ menu_header }}</a>
                     <ul class="noJS">
                        {% for page in pages %}
                           {% set menu_item = page.title|split(delim) %}
                           {% if (menu_item|length == 2) and (menu_item[0] == menu_header) %}
                              <li><a href="{{ page.url }}">{{ menu_item[1] }}</a></li>
                           {% endif %}
                        {% endfor %}
                     </ul>
                  </li>
               {% endfor %}

               {% for page in pages %}
                  {% set menu_item = page.title|split(delim) %}
                  {% if (menu_item|length == 1) and (page.title != '') %}
                     <li><a href="{{ page.url }}">{{ page.title }}</a></li>
                  {% endif %}
               {% endfor %}
            </ul>
         </div>

      </div>
   </header>

Now you can prefix the Title: in your pages with a menu i.e. Nice Menu|Original Tile for Page

Default delimiter is "|", can be overridden in config.php

I used this here: 1541.org

best regards...
clemens

from pico.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.