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:
    {% nav link in…
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

I try to add element to structure, and I want to add to this element parent ID

Form code: