Comments (2)
There are two ways I can think of off the top of my head.
- 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). - 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.
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)
- Pico 3.0: Param 'date_format' from config.yml.template leads to PHP Fatal Error HOT 2
- Reverse case sensitive declaration of meta attributes is confusing HOT 5
- Twig 2.x and YAML 3.x not supported HOT 3
- Visit counter HOT 24
- Reading Time HOT 2
- Best way to add script inside <head> HOT 4
- picocms.org is down right now HOT 3
- Nice Date filter HOT 3
- pre-bundled release: Getting "HTTP ERROR 500" HOT 7
- Support for Twig extensions? HOT 3
- cookbook issue HOT 8
- [draft ] Autoload extra stuff HOT 5
- [PLUGIN] XMPP: Post to PubSub [NOT CLOSED YET] HOT 6
- Probably a wrong logical operator HOT 2
- Question: How to use page yaml-header meta-data in php for a plugin? HOT 4
- weird display of date HOT 7
- simple comment system HOT 7
- PHP pages depth & offset HOT 2
- Pico Edit says "unmaintained - archived", HOT 2
- Pico project throwing an error template. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pico.