Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

three level #140

Open
patmo opened this issue May 12, 2015 · 10 comments
Open

three level #140

patmo opened this issue May 12, 2015 · 10 comments

Comments

@patmo
Copy link

patmo commented May 12, 2015

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

  • projet-1
  • projet-2

/project-type-2

  • projet-1
  • projet-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
Copy link

pbatts commented May 12, 2015

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
Copy link
Author

patmo commented May 12, 2015

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
Copy link
Author

patmo commented May 12, 2015

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

@patmo
Copy link
Author

patmo commented May 12, 2015

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

@patmo
Copy link
Author

patmo commented May 12, 2015

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

@pbatts
Copy link

pbatts commented May 13, 2015

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

@patmo
Copy link
Author

patmo commented May 13, 2015

Thanks

Le 13 mai 2015 à 13:16, "Paul Batts" [email protected] 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
Copy link
Author

patmo commented May 15, 2015

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
Copy link
Author

patmo commented May 17, 2015

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

@pbatts
Copy link

pbatts commented May 18, 2015

Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants