Questions tagged [structure]
272 questions
10
votes
1 answer
When to choose a Structure over a Channel?
Structures look interesting because you can reorder entries manually, generate breadcrumbs and visually see a hierarchy of entries. Besides this, what are the primary consideration when choosing a Structure over a Channel?
user1070143
- 1,106
- 12
- 24
8
votes
1 answer
Get children from a Structure entry
I'm new in the Craft CMS world. Today I start so build my first website with Craft.
I have a Structure with 2 Levels. Now I want so get the children from level 2. The level 1 entries are overview-pages for the content in the level 2 pages. I've…
Design Frog
- 133
- 1
- 1
- 4
7
votes
2 answers
How can I get the count of entries in a structure?
I'm using this in the root of a structure to try and get the count of entries in another part of the structure.
{% set count = craft.entries.section('hotelDetails').descendantOf('oakview-hotel').level(3).type('review').total() %}
{{ count…
user1070143
- 1,106
- 12
- 24
5
votes
1 answer
Get structure top ancestor
How can I get the top level ancestor of an entry within a structure? I've tried:
{% set rootEntry = null %}
{% for ancestor in entry.getAncestors() %}
{% set rootEntry = ancestor %}
{% endfor %}
But that only returns the most recent ancestor…
Jared Meyering
- 211
- 1
- 4
4
votes
1 answer
How do you page through entries in a structure?
I have a structure like below and need previous / next links on an entry such that they go back and forth between E, F, G and H. They shouldn't step into D or I.
I've been trying this, but I can't get it not to step into D or I.
{% set prev =…
user1070143
- 1,106
- 12
- 24
4
votes
2 answers
Output structure in a
Given a structure that has, for example, three levels of content—how do I just iterate over it and create a nested
- reflecting the hierarchy and containing the title and slug (as a link) of each entry?
The following just gives me a flat…
hamishtaplin
- 776
- 8
- 16
4
votes
2 answers
How to output a structure sub-navigation of current page
I've got a single structure menu for my entire site which consists of a title and a single related entry. I use that to output the main menu, which uses this code:
darylknight
- 3,290
- 18
- 42
4
votes
2 answers
Website structure with Craft
This is my first try at Craft, was planning on replicating a current site as practice, had a question about the sites architecture.
I have a Brands page:
Brand/Company info
-Brand product line
--individual products within that line
What would be…
fidel
- 123
- 6
3
votes
1 answer
Getting entries from different structures and level
I need to loop through the 6 latest entries from 3 different structures. The problem is, the entries are located on different levels. One of the structures has entries on level 3, and the other two has entries on level 1.
Wobee
- 328
- 2
- 9
3
votes
1 answer
3
votes
1 answer
Title of the current parent structure
I want to display the current title of the parent structure inside the child template.
How would I do that?
Parent (Title: Bla)
Child (Here I want to display Bla)
Parent (Title: Blablu)
Child (Here I want to display Blablu)
I tried something…
KSPR
- 3,786
- 2
- 29
- 52
3
votes
3 answers
How to duplicate a page within a Structure?
Most of the pages in my Craft site are contained in one big Structure. There are a couple of pages whose content needs to exist in two locations within the structure. I'm not sure how best to do this.
I could probably hack something together with a…
Phil Gyford
- 667
- 1
- 6
- 17
2
votes
1 answer
Get ancestor at a specific level?
I can grab a top/bottom level ancestor with something like entry.ancestors.first/last.title.
But, say I'm at level 6, is it possible to grab an ancestor at a particular level, like entry.ancestors.level(3).title? Or would you have to grab all the…
philzelnar
- 735
- 6
- 15
2
votes
2 answers
Duplicate a Structure "Section"
I have a Structure area where there will be 20-24 top level pages for degrees, each with similar (but different) subpages…
Masters in Accountancy
Courses by Year
Degree Requirements
…etc. x12 or so.
Masters in Business Administration
Courses by…
philzelnar
- 735
- 6
- 15
2
votes
1 answer
URL structure for structure section
This seems like it should be straight forward. I need to set-up a structure section with a parent page which uses the same section entry and same template. So the parent would have 'parent' as the slug and the children would have 'parent' as the…
Andrew
- 738
- 1
- 5
- 11