kolber / stacey

Cheap & easy content management
http://staceyapp.com
MIT License
1.04k stars 132 forks source link

three level #140

Open patmo opened 9 years ago

patmo commented 9 years ago

Hello i build a project with three level : /content /project-type-1

/project-type-2

I would like to add class which is in my project-type-1 .yml to display each projet-1, projet-2...

and I don't know (and don't find...) how to call this

Thanks for your help

pbatts commented 9 years ago

Hello, It is not completely clear what you are trying to do or what you have tried. Also, I noticed that some of the information contained in the notification email (email notifying me of this post) contains information (code) that is not included here. Please use the 'Preview' tab before posting your question to be sure the information is being displayed properly.

You can not have 'project' folders outside the 'content' folder. All content must be in the 'content' folder.

patmo commented 9 years ago

In fact all my projects are in the content folder and in each project i have sub-projects. I make what i want works like that : {% for page in page.root %} {% if page.children %} {% for page in page.children %} {% if page.children %} {% for child in page.children %}

article class="page.categorie" a class="project-url" href="{{ child.url }}" /article

{% endfor %} {% endif %} {% endfor %} {% endif %} {% endfor %}

It works but I think the code is not very nice... What is the best way to do that ?

patmo commented 9 years ago

I began to use Stacey since yesterday... I used to build website just with html/css or with drupal...

patmo commented 9 years ago

there is a way to make the page-sibling parse the page in multiple folder ?

patmo commented 9 years ago

or maybe a way to make a loop with page.slibing ?

pbatts commented 9 years ago

Hello, Examples of looping with page.sibling can be found in templates > partials > next-page.html and previous-page.html

patmo commented 9 years ago

Thanks

Le 13 mai 2015 à 13:16, "Paul Batts" notifications@github.com a écrit :

Hello, Examples of looping with page.sibling can be found in templates > partials > next-page.html and previous-page.html

— Reply to this email directly or view it on GitHub.

patmo commented 9 years ago

I can't find this in next-page and previous-page.html. I just hide the next link page on the last page and the previous on the first page but what i would like to do is to make the next link on the last page go to the first (and previous on first go to last). How can I write "if page.is_last go to first" ? Thanks

patmo commented 9 years ago

I find a solution : update twig version (to the last in date), and use page.siblings|first and page.siblings|last.

pbatts commented 9 years ago

Thanks for sharing.