Questions tagged [structure]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
24
votes
4answers
8k 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
4k 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 ...
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 ...
6
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 ...
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 ...
2
votes
2answers
2k views

Channel index page linked in a structure

I come from expression engine and what I want to do is the following: I have a channel filled with entries. All I want to do is to list all these entries on a page. However, I don't want to link ...
15
votes
5answers
5k 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 ...
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 ...
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 ...
4
votes
1answer
219 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: <...
2
votes
2answers
2k views

Navigation, Structure, Usage, WOES!

As some of you may have seen I've been asking on here and on Slack regarding the best way to go about creating a navigation on a site. As yet, nothing I have tried is working and any code that I've ...
3
votes
1answer
652 views

Linking to channel via structure section

I apologize for opening up a whole new question for this topic since it's been discussed a few times now, however I don't have enough rep yet to comment on the existing questions. Regarding the ...
4
votes
1answer
513 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
1answer
2k 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" ...
3
votes
1answer
508 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 ...
2
votes
1answer
678 views

Setting User field type from a front end form

I am moving a site from EE to Craft and trying to figure out the best Craft approach to something I did with lots of php and url parameters in EE. The overview: the site is a Family Counseling Clinic....
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 ...
4
votes
1answer
762 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
2answers
3k 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"&...
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
858 views

Are categories the best way to organize Commerce product filters?

The Commerce site I'm working on (my first Craft project) will have a product listing page with filters. These will function as you would expect, but clicking a filter name will link to another ...
7
votes
2answers
6k 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')....
4
votes
2answers
469 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 ...
2
votes
1answer
1k views

Creating a related content subpage to a channel entry?

For a project I'm working on I have set up several channels that are related to each other. What the setup comes down to is the following: Channels: Projects |- News relations (news is a channel and ...
7
votes
1answer
373 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
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: ...
2
votes
2answers
1k views

Nested Entries in Craft 3

In Craft 2 there used to be a Nested Entries field, but this is not available in Craft 3. I know I can do {parent.uri}/{slug} in the Entry URI Format field, but if I want it to be appended by ...
2
votes
1answer
1k views

How to manage different templates for a structure

i am trying to figure out the right way to display elements on a page. Its about a website for a fashion designer. There will be parent elements like : Parent X Parent Y both of those elements use ...
1
vote
1answer
297 views

dynamic urls for channel/structure that's linked to the main structure

I'm trying to create dynamic urls for a channel or structure section that depend upon the url structure of a different structure (or the first entry in that structure). For example, if the main ...
2
votes
1answer
536 views

How to search children with relatedTo param

My templates that referenced entry.children or entry.getChildren() have started throwing deprecation notices: Calling getChildren() to fetch an element’s target relations has been deprecated. Use ...
2
votes
1answer
278 views

Hundreds or thousands of posts in a structured channel?

I'm looking to create a very simple website where a user can add items to their own personal feed over time. So by default it's date ordered, but you maintain the ability to sort the order a little ...
2
votes
1answer
318 views

Can I use a structure without slugs?

I'm making a portfolio website, where the url's look like "projects/project-name". There is also an overview page with all the projects that is under "projects" on itself. I'm using a Structure for ...
1
vote
1answer
64 views

Simple Product Listing Pages by Category Slug

I'm new to Craft and I'm trying to create very basic product listing pages based on Categories and I'm not sure where to start. First, it doesn't look to me like you can create separate templates for ...
1
vote
1answer
36 views

Structure Navigation with 3 possible Link Types using Nav tag

I'd like to build a Structure that can be used to output the main site navigation; each "entry" in the Structure would have three custom fields (types): Category, Entries, URL This question ...
1
vote
2answers
195 views

Targeting entries in a structure

In a structure like the following: Offices US Albuquerque [offices] Boston Chicago Denver ...
0
votes
0answers
142 views

Structure entry connected to multiple parent entries

Is there a way to connect one structure entry to multiple structure entries? Like: (wonderfully drawn image represents the connection of Food Festival to both structure entries)