Skip to main content
8 votes
Accepted

Entry Form - Multiple Entries & Entry Type & Parent

A little bit late but here it is. Go to https://pluginfactory.io/ and create a plugin, you need at least 1 Controller but you can leave the Name value blank to create a controller with the same Name ...
Robin Schambach's user avatar
4 votes
Accepted

How to manage different templates for a structure

Your approach looks good to me. There are different ways you can make it happen: If you set up your structure in the CP you can decide how many levels you want to allow for that structure. (By ...
Wolfram Gehring's user avatar
4 votes
Accepted

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

yes you can! You may search for a slug craft.entries.slug('slug-of-first-parent'), select the first result .one(), and then the children by .getChildren(). Now you can proceed as you already did and ...
Luke's user avatar
  • 531
3 votes

How can I create a family tree hierarchy in Craft?

I can't think of an easy and clean way to visualize this kind of structure in a default list. So if you want to be able to display the structure from your diagram dynamically you'll have much work to ...
Robin Schambach's user avatar
3 votes
Accepted

Parent are not set anymore after saveElement()

You need to use newParentId: $navigationItem = new Entry(); $navigationItem->typeId = 4; $navigationItem->sectionId = $navigationSection->id; $navigationItem->title = $entry->title; $...
Oli's user avatar
  • 7,515
3 votes
Accepted

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

After a long search and lots of trial and error, I've found the perfect solution! This is how I created a dynamic structure navigation : parent/child (2 levels deep) with class="active" on the parent ...
mateostabio's user avatar
3 votes
Accepted

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

To get different URL Format for parent & child pages, you need to go to the CP structure settings and edit the Entry URI Format. This is how your URI should look like: {% if level == 1 %}features/...
mateostabio's user avatar
2 votes

Structure Entry Item's Parent

For very simple use cases, I've created a plugin that adds some validation to enforce this type of hierarchy: https://github.com/jordanlev/craft-EnforceDualHierarchy If you'd like to see better / ...
Jordan Lev's user avatar
2 votes

How do I remove segment 1 in my URL AND get the parent URI?

Edit your section‘s settings (Settings > Sections > [Section Name]), and delete the static/ from the Entry URI Format.
Brandon Kelly's user avatar
2 votes

Getting ancestors for manually set parent in template

After much help and direction form @RobinSchambach (much appreciated). I have resolved this as follows; {% set currentPage = craft.entries.section('pages').slug('archive').first() %} {% set ...
Terry Upton's user avatar
  • 1,894
2 votes

Getting ancestors for manually set parent in template

As @Robin Schambach said, you need to loop through the ancestors. {% set parent = craft.entries.section('pages').slug('phone-directory') %} {% for ancestor in parent.getAncestors() %} {{ ancestor....
Simon Kuran's user avatar
  • 3,015
1 vote
Accepted

How would you show a specific entry 'and' its children

Try merging like this {% set parent = craft.entries.section('pages').id(8) %} {% set entries = craft.entries.section('pages').descendantOf(8).limit(1) %} {% set entries = parent|merge(entries) %} {...
CreateSean's user avatar
  • 1,983
1 vote

How can I create a family tree hierarchy in Craft?

Create a regular channel where the entries have a relationship to the parent and not the child. That means that each child can have any number of parents and each parent can be related to as many ...
foamcow's user avatar
  • 2,029
1 vote

List both parent entry and its child entry

This is the corrected Twig code. I simply added {{ entry.title }} as an <li> item. This nav appears only on the page that I needed entry.title displaying. {% set navList = (entry.level == 2) ? ...
Steve Davies's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible