Questions tagged [children]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
29 views

Change the URL of nav child entry conditionally

I want to change the URL of a li from a nav menu conditionally (using a custom field where the user sets the URL), but I don't see how to use conditionals with {% ifchildren %}? {% nav entry in ...
2
votes
1answer
43 views

Show only children relative to current page

I have this structure section: 1.0 Nav point level 1 1.1 Nav point level 2 1.2 Nav point level 2 1.3 Nav point level 2 2.0 Nav Point level 1 3.0 Nav Point level 1 I want to show only top level ...
1
vote
1answer
396 views

Craft CMS Structure: How can I display parent and child items on an active parent page?

I'm currently setting up a Structure nav and am trying to set it up so that child pages only display if; 1) The child page itself (or it's sibling) is currently active 2) The parent page of that ...
1
vote
1answer
306 views

How can I display second level children only from a specific parent structure item?

I'm trying to display a list of child structure links, but only from a specific parent. The template I'm working on isn't for the parent in question so I don't think I can use 'entry.' My structure ...
0
votes
1answer
32 views

Craft 2, child dropdown, database

I am running Craft 2 CMS for one website. Its in Norwegian for our client. Its about SKI School. Where Parents reserves sport dates for there children. In database there are parents profile with ...
1
vote
2answers
114 views

How do I create a structure side navigation that will show active parent list-item and active child list-item

A bit of a background on the project. I have a features structure section, that has 2 levels: Parent features & Child features. {% set features = craft.entries.section('features').all() %} My ...
1
vote
1answer
328 views

How do I get different URL Format with parent/child structures & how do I display different templates?

I need to create a features structure section for a website that will have parent features and child features. Q1: How do I get different URL Format for parent & child pages? I need the parent ...
2
votes
1answer
138 views

Get category children

I would like to select just the children of any given main category (eg. Accessories, Stomps in the picture), regardless of segments in my URL. I've been trying to understand why the code below won't ...
2
votes
2answers
515 views

How do I hide children of a disabled parent in a nav?

So I've got a {% nav %} I'm trying to create with the following code: {% nav page in craft.entries.section('pages') %} <li> <a href="{{ page.url }}">{{ page.title }}</a> ...
1
vote
2answers
233 views

How can I create a family tree hierarchy in Craft?

I'm struggling to think of a way to create a family tree hierarchy in Craft. I've tried using categories and structures, but run into the problem of needing child nodes to have two parent nodes. I....
2
votes
1answer
535 views

Eager-Loading child elements in a multi-level structure section

I have a structure that looks like this: Experiment ( Level 1) Cages (Level 2) Animals (Level 3) Measurement (Level 4) I am outputting this information into some inline JSON like so: {% set mice =...
1
vote
1answer
258 views

Counting included child blocks in the Neo plugin

In the Neo plugin, I've made a block that has the option to add 3 child blocks underneath it. This is the code from the parent block: {% extends 'neo/default' %} {% block blockContent %} <...
1
vote
1answer
565 views

List both parent entry and its child entry

I am trying to display a list of entries. Specifically the parent entry and it's children's entry. I started off using this: {% nav page in craft.entries.section('forms').isChildOf.slug('applicant-...
3
votes
1answer
104 views

How to target Sub-Category of Sub-Category

I have 2 Main Groups of Categories, which themselves have Sub-Categories. The Categories you see have checkboxes to filter entries below. One Sub-Group has also Children (With Material/ Without ...
1
vote
3answers
133 views

Newly added child entries not showing on listing/parent page straight away

I am running into an odd issue where creating new child entries does not bust the cache of the parent page(s) that lists them. This is the structure I am working with: I am displaying the Course ...
2
votes
1answer
433 views

How to get first child URL within Craft/Twig Nav tags

I have a navigation structure as follows: {% set page = entry ?? category ?? null %} <ul class="nav menu--main"> {% nav entry in entries %} <li class="menu__item{% if page and ...
1
vote
2answers
2k views

Check if child entries exists

I'm pulling in entries which are the descendant of the current entry id. This is an example of my structure: Your Adventure > Honeymoon > A trip entry. The below code is being used on the Honeymoon ...
3
votes
1answer
398 views

Exclude certain entries and its children from navigation

I need to split up a navigaton tree. So I try to exclude certain pages from a structure based navigation tree PLUS their children automatically, but don’t seem to get it. {% nav page in craft.entries....
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 ...
0
votes
1answer
67 views

Display children's order numbers

I thought this was going to be easy; showing the order number of children against their parent, but the only answer I can find is in this thread and I'm unsure how to implement this into my code. {%...
2
votes
1answer
600 views

How can I get an entry's child category, and not the parent category?

I have a category page that lists all of the entries related to that category. And then I want to display the selected child category for the entry... in brief like so: Entry Title 1 Entry 1's Child-...
0
votes
0answers
126 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)
2
votes
1answer
3k views

Get children of specific parent

This one seems deceptively simple, but I am struggling. My home page is a single, and in that template I want to retrieve the children of a specific entry in a structure, then loop through them. ...
1
vote
1answer
646 views

How to list an entries selected nested categories?

I have a entry field populated by categories. The number of categories an entry can have is unlimited and the categories are set up as nested categories i.e. first level ---second level ------third ...
3
votes
1answer
27 views

Remove the anchor in nav loop based on another field conditional

I'm using this solution to output the children within a current structure entry. Unfortunately I need to take out the anchor on some entries that don't yet have content, but still include the (...
1
vote
1answer
192 views

Showing/Hiding children of a Structure based on categories

I'm a newbie, so please excuse this if its a super simple question. I have a structure set up like so: • Parent Section 1 - Child 1A (category: pro-users) - Child 1B (category: pro-users) - ...
1
vote
1answer
2k views

Show only children of current page in submenu

I have checked the official documentation and also these pages: How do you only show children of "active" parent in a Structure section's nav? How to output a structure sub-navigation ...
2
votes
4answers
810 views

Structure Entry Item's Parent

I need to create a hierarchy that looks something to the effect of parent 1 parent 1 child 1 parent 1 child 2 parent 1 child 3 parent 2 parent 2 child 1 parent 2 child 2 parent 2 child 3 and so ...
3
votes
2answers
256 views

Output number of children in a structure

In my template I'm displaying all entries of a structure: ('areas').level(1) using a loop. I would also like to display the number of children entries in each of the 'areas'. Like: "Area 1, 4 ...
3
votes
1answer
152 views

How do I render specific child entries of a structure based on url segment

For simplicity, I'm building a site for a restaurant. The "Menu" page has the following url(s): mysite.com/food/appetizers mysite.com/food/sandwiches food is a structure. It contains every entree ...
2
votes
1answer
185 views

Monthly Calendar || Month View

So I have /calendar and linking previous/next months on that template. The previous/next month urls are /calendar/2015-08 and /calendar/2015-08. I have this custom route setup: On my /calendar/2015-...
1
vote
2answers
259 views

Complex Navigation

I need to output different HTML for children of navigation. When i use {% set entries = craft.entries.section('pages') %} <ul id="nav"> {% nav entry in entries %} <li class="...
2
votes
2answers
2k views

Show parent and it's children as a nav

Newbie here with hopefully a simple question... I have a structure as per the image below where I want to only show the parent item and it's children on their pages. I want to exclude the other ...
2
votes
1answer
466 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 ...
4
votes
2answers
429 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
1k 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 ...
1
vote
1answer
494 views

Current Entry Children Count

Does anyone know if I can output the number of children the current entry (structure) has?
2
votes
1answer
82 views

Is there a way to prevent uploading assets into a parent level folder?

Say that I have a folder structure like this: /images /products /employee-photos /user-photos /advertising Is there a way that I could define the single asset source of /images while only ...