Questions tagged [structure]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
3answers
1k views

How give parent in navigation-structure the active tag

So I have a two-level Navigation in a structure. What I want is to give the parent of my entry (if a parent exists) the active tag. right now I'm doing that: {% for nav_item in navigation %} <...
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 ...
1
vote
3answers
509 views

redirect on a Structure

Client has created /exhibitors but wishes it to point to /exhibitors/partners Can that be done using routes or should we be looking at htaccess rules?
1
vote
1answer
308 views

Problem with entry.hasDescendants()

So I have a Structure like that Item Subitem | inactive Subitem | inactive why is item.hasDescendants() true ? How would I do something like that the right way: <li class="{% if nav_item....
1
vote
2answers
188 views

Targeting entries in a structure

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

Performance and cache when using entry type templates and getSegment

I'm working on a site that will end up having 30-40+ structure sections which are sharing templates and will be using about 10 different entry types. (This would probably be much easier if I used ...
1
vote
1answer
502 views

Current Entry Children Count

Does anyone know if I can output the number of children the current entry (structure) has?
1
vote
2answers
424 views

How do I set a class if entry is a child of a particular parent?

I have a structure section which is three levels deep and I want to add a class when the entry has a parent id of X. I am trying something like: {% for entry in craft.entries.section('brand')....
1
vote
1answer
350 views

Outputting Navigation

I need some help with coding the navigation. This is the markup: <ul> <li class="active"><a href="#">home</a></li> <li><a href="#">about</a>&...
1
vote
1answer
650 views

Loop through fields from 'single'

I have a structure for different categories like salad, soup, main course and so on. Basically they share the same fields - but I want to be able to have dynamic singles based on those structures. For ...
4
votes
1answer
416 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 ...
3
votes
1answer
547 views

Channels within Structures?

I have a site that requires the client to reorder their entries in each 'category' manually. Obviously structures are perfect for this but where I'm running into trouble is that the entries need to ...
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: ...
4
votes
2answers
756 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 ...
8
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 ...
1
vote
1answer
274 views

How to access a structure

I'm trying to build a restaurant menu using a structure. The structure looks like that: > Menu-part 1 > Menu-item 1 > Menu-item 2 > Menu-item 3 > Menu-part 2 > Menu-item ...
2
votes
1answer
222 views

What are «Structures»?

I wonder what structures are since everybody writes about it here. But I can only finde one tiny sentence in the official docs: «Used when entries do have an inherent relationship with each other, ...
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 %} ...
2
votes
3answers
222 views

Adding description and other information to channels

This might be a little difficult to explain thoroughly and correctly, bear with me. :) The Problem The news website I'm working on has different categories based on topics, location, and "genres" (...
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 ...
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"&...
3
votes
1answer
461 views

Structure Navigation - Not returning sub nav entries

I'm trying to set up a sub nav from a Structure Section on my site. Current code is: {% set mainEntry = craft.entries.slug(craft.request.getSegment(1)).first() %} {% set subnav = craft.entries....
1
vote
1answer
1k views

What would cause an Internal Server Error on saving entry

When I try to save a new entry as a child under a Structure entry, I get the following error: Internal Server Error Object of class Craft\ElementCriteriaModel could not be converted to ...
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 ...
2
votes
1answer
274 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 ...
5
votes
1answer
577 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 ...
4
votes
1answer
432 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. ...
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 ...
2
votes
1answer
43 views

How to display a collection for admins

I'm creating a structure page for collections. What is the best way to display collections by year? Should I use tags? How can I implement that?
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 ...
23
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}...
5
votes
1answer
783 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 ...
6
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')....
15
votes
4answers
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 ...
4
votes
1answer
666 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. ...
4
votes
1answer
742 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 ...
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 ...
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 ...
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 ...

1 2 3 4
5