Questions tagged [structure]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
24
votes
4answers
7k views

Add home page to a structure?

I am using a structure for all of my site's pages (single pages and channel index pages). The structure settings are as follows: URL for Top-Level Entries: {slug} URL for Nested Entries: {parent.uri}...
23
votes
3answers
3k views

How can I route a specific entry in a structure section to its own template?

While setting up a site recently I wanted to route a specific entry in a structure section to its own custom template. Using a dynamic route sounded like the right option until I remembered that it ...
17
votes
1answer
1k views

How to handle top-level/index pages in structure sections?

It seems that currently if you want to avoid the main "about" page at the top of an "about" structure having a slug of /about/about/ then the approach people seem to take is to create an About page as ...
15
votes
5answers
4k views

How do you only show children of “active” parent in a Structure section's nav?

I've got a Structure section where the top level is the main menu. The submenu consists of the children of the active main menu item. This works well. For the submenu, I'm using this code: {% set ...
14
votes
2answers
2k views

Difference between categories and structures

The recent updates to categories have been great and provide a lot of flexibility. But now I find myself struggling to decide what should be a category group and what should be a structure. For ...
12
votes
1answer
2k views

Changed section from Channel to Structure, but can't re-order entries

As the title says, I changed a section from Channel to Structure, but when clicking on that section in the dashboard, the layout still looks like a Channel, and I'm not able to reorder/drag the ...
10
votes
2answers
3k views

Would you use a Structure as navigation over multiple sections (channel entries, indexes and singles)?

I'm setting up my first Craft project and I have a lot of different content. I have around 6 different Channels (News, Events, Blog, Pages, Products, Staff) and ~10 Singles. I have this idea of using ...
9
votes
1answer
3k views

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 ...
8
votes
2answers
2k views

Output children of a structure section in reverse order

How do you output the all the children of a structure in a reverse order (assuming the children are limited to max depth). Using the order parameter, Craft requires that you use a second parameter ...
7
votes
2answers
5k views

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')....
7
votes
1answer
1k views

One structure vs a structure per section?

I'm new to Craft CMS and I would appreciate some advice re the best approach to take for modelling content. I'm coming from an ExpressionEngine background, where I would typically use one pages ...
7
votes
1answer
356 views

How are the Craft docs created?

The Craft documentation on Section Types state that they themselves are created using a Structure. Can someone explain the method they used here? What I'd really like to see is the Twig code for the ...
6
votes
1answer
3k views

What is the best way to create breadcrumbs based on a structure?

How do you create breadcrumbs based on a structure? My structure: Parent Child (active) Other Child Child My url: site.com/parent/child So my breadcrumb need to be: home (url) / parent (url) / ...
6
votes
2answers
4k views

Structure - Add class if element has children

I have a structure section which I am using to create a navigation menu. It works ok and produces the list etc. I want to add a class to the li element if it has children. Current Code is: {% set ...
6
votes
1answer
675 views

Eager Loading a Structure and descendants

In looking at the the BaseElementModel:getDescendants() method and saw it checks for eager loading elements named 'descendants.' // Eager-loaded? if ($this->hasEagerLoadedElements('descendants')) {...
5
votes
1answer
8k views

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-...
5
votes
3answers
3k views

How to use a Structure including a homepage

As far as I can tell, it's mandatory to have a Single as the site index. I always use a Structure for organising my pages, and different entry types for different page templates. I intend to use a ...
5
votes
3answers
2k views

How would I list all entries regardless of section or structure?

I'm trying to build and XML site map that sorts all entries by their modification dates with the newly modified first. {% for entry in craft.entries.find() %} ignores the structures, {% for entry ...
5
votes
2answers
585 views

A Structure section with an entry to a channel index

I don't have commenting privileges yet, so couldn't comment on either of these posts (here and here) regarding an entry in a Structure section that links to a Channel index. Between the two posts ...
5
votes
2answers
95 views

How to prevent select user groups from reordering structures

I need to create a plugin that prevents select user groups from reordering a Structure content type in the Entries listing. I could quickly do this by just hiding the a.move.icon element, but I worry ...
5
votes
1answer
1k views

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 %} ...
5
votes
1answer
606 views

Set Default Entry Types for elements in a Structure Section

I have a Structure Section controlling my Nav and page contents So I have Home About Us History List item List item Services Service 1 Service 2 Service 3 In the Control Panel when I add ...
5
votes
1answer
2k views

Move entry from one structure to another with parenting

Seeing as moving entries between sections isn't supported (yet) through the Craft interface, I followed Brandon's answer for a workaround through the database. I am moving entries from one structure ...
5
votes
1answer
788 views

How flexible is tying content to a structure?

I'm trying to decide how to organize my content on a site with a few levels of hierarchical content. I'm toying with the idea of creating structures for all my top level navigation items, with a few ...
4
votes
2answers
810 views

Output structure in a <ul>

Given a structure that has, for example, three levels of content—how do I just iterate over it and create a nested <ul> reflecting the hierarchy and containing the title and slug (as a link) of ...
4
votes
2answers
2k views

How do I find the closest parent entry with an Assets field filled in?

I have a structure that goes up to 4 levels deep. Each page has a field for a 'hero' image. If a child page does not have this field filled out I would like to traverse up the structure and find the ...
4
votes
2answers
1k views

Display number based on position in structure hierarchy

I'm stuck. For a new site I need to display numbers before the main h1 title and in the submenu's. Example: 1 Home 2 About 01 history 02 strategy (active page) 03 profile etc. etc. In the active ...
4
votes
1answer
457 views

Entry Form - Multiple Entries & Entry Type & Parent

I'm building an MVP for a project, I'm using Craft and would like to: Create an experiment (/experiments/) Create multiple cages for the animals within the previous created experiment eg. 5 cages - (/...
4
votes
2answers
178 views

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 --...
4
votes
2answers
949 views

Building a website containing restaurant menus from multiple vendors — need some advice on Section hierarchy of data

Figure I'd query with the geniuses over on StackExchange as I think I've hit a roadblock in my project. I'm building a website containing menus from multiple restaurants with the vision that it could ...
4
votes
4answers
3k views

How to output siblings including the current entry?

I'm trying to output all the siblings of the current entry in a multi level structure like this: {% for sibling in entry.siblings() %} <li>{{ sibling.link }}</li> {% endfor %} This ...
4
votes
1answer
1k views

Best practice for channels and structures

I am wondering if there is a best practice around using channels and structures. When you have a single section you can link to that section by selecting the entry for it. For channels and structures ...
4
votes
1answer
748 views

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 ...
4
votes
1answer
1k views

Ordering of products?

What is the best method to organise products, and subsequently the order of these products within a group? Currently I have setup a product type of Canine. I can access each of these products via a ...
4
votes
2answers
342 views

Large, Complex Navigation

For a while I've been having difficulty handling large navigation in craft. I built this site a while ago, and if I am honest I would probably change the structure if I was doing it again, but that's ...
4
votes
2answers
451 views

Is there a way to divide an entry's data into multiple subviews with unique URLs?

I have a one-level structure where I am storing a client's projects, with the ability to reorder them by dragging the entries in the structure. Each project has been designed to have multiple ...
4
votes
2answers
2k views

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: <section class="top-bar-section"&...
4
votes
1answer
1k views

Product Categories, Structures and Channels

We are currently updating a brochure website, separating a single list of products into a series of sub-categories. Currently, we have a "single" section to display all products, and then a "channel" ...
4
votes
3answers
234 views

Is it possible to limit how many times and entry type can be used?

I've structured my site so that most of the pages are in a single structure section (easier to manage that way and it means all my pages can be outputted and organised in the navigation's {% nav %} ...
4
votes
1answer
203 views

Reusing logic to set string variables

I would like to set some variables for every entry within a section ('courses'), and then use those variables in loops that are filtering by entry types and categories. Some simplified markup: <...
4
votes
1answer
437 views

Easy way to copy sections to a new install

Is there an way way to copy sections I have in an existing site to a new website I am doing with a fresh install? E.g. To Copy the News Channel Section and all the field types Also copy the structure ...
4
votes
1answer
456 views

Add entries in bulk

Is there a way to add a whole bunch of entries at once? For example, I have a parent entry in a Structure section, and want to add a bunch of children, just setting the title on each one real quick. ...
4
votes
1answer
687 views

How do you import hierarchical data that uses the adjacency list model into Craft Structures or Categories?

Craft makes it nice and easy for us to have hierarchy in Structures or Categories. Many other popular CMS platforms support hierarchical data as well but some support it using a different data model. ...
3
votes
1answer
3k views

How does the Structure section type work?

I read the documentation but I'm still confused about the Structure sections.. What they are usually used for? What are the advantages of using it? And most important how to use them? Please can you ...
3
votes
3answers
1k views

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. ...
3
votes
1answer
3k views

URL Format of a nested structure with 3 or more layers

I have a nested Structure with 3 layers like so: Home Services Service A Sub Service A Sub Service B Service B About Us Contact Now I would like the nesting to be reflected in the URL like so: ...
3
votes
1answer
2k views

How to fetch entries from multiple sections

I have five separate sections with x number of entries each. I would like to render all the entries from all the sections on a single entry template page. Is there a way to do this ? I know we can set ...
3
votes
3answers
1k views

How do you pull out second level structure entries based on their parent?

I have a structure as follows: Parent 1 Child 1 Child 2 Child 3 Parent 2 Child 1 Child 2 Child 3 Parent 3 Child 1 Child 2 Child 3 etc... On my Child entry pages I want to pull out the other ...
3
votes
1answer
2k views

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 (...
3
votes
1answer
492 views

Help with understanding how to structurally build a sermon catalogue

I'm currently working on a website for a church and I thought that Craft would be perfect for the project and a great way to learn it. However, I'm having a hard time wrapping my head around how to ...

1
2 3 4 5 6