People who code: we want your input. Take the Survey
3

You're nearly there! You are missing the part that fetches the entries related to your category. With your current set up, you would need to do: {# Get the requested category slug from the URL #} {% set requestedSlug = craft.app.request.segments|last %} {# Fetch the category with that slug #} {% set category = craft.categories() .slug(requestedSlug|...


3

You need to use newParentId: $navigationItem = new Entry(); $navigationItem->typeId = 4; $navigationItem->sectionId = $navigationSection->id; $navigationItem->title = $entry->title; $navigationItem->newParentId = $herbsNavigationEntry->id; $navigationItem->setFieldValue('navLink', '/tags/' . $entry->slug); if (!Craft::$app->...


2

The only way to do this is to create multiple entry types for your structure section. Each entry type has its own field layout (can have different fields from the other entry types in that section). Sadly, it's not possible to restrict entry types to a particular level in a structure – i.e. if you create "Landing Page" and "Sub Page" ...


2

I am doing something similar in using a Structure for the main navigation. Below is what I have. Hope it helps! {% set menu = craft.entries.section('navMain').all() %} <ul> {% nav link in menu %} <li> {% if link.menuEntry|length %} {% if craft.app.request.absoluteUrl == link.menuEntry[0].url %} <a href="{{ link....


2

Since the URL is specific for each multisite, simply do not use section.handle in the structure's URI definition, but go for the term you want as a string instead, e.g. English: {parent.uri ?? 'products'}/{slug} German: {parent.uri ?? 'produkte'}/{slug} French: {parent.uri ?? 'produits'}/{slug} and so on...


2

Check the sort order dropdown at the top right of the index page to make sure you're on "Structure".


2

I've done something similar to this recently, and I went through the same though process as you've done! I initially added a new Channel for plans, and built each plan as an entry in that channel. These were then selected in an Entries field for the pricing page entry. However, after building this solution locally, I felt like it was overkill for my ...


1

There is no definite answer to your question but I think you can get pretty much what you want using just two types of categories. Section setup create 2 category groups: device types (with the deviceTypes) post types (with the postTypes) create an Articles section (with the article handle) configure you section with the following Entry URI format: {...


1

Take a database backup first to be on the safe side then run: ./craft utils/repair/section-structure yourStructureHandle See documentation - https://craftcms.com/docs/3.x/console-commands.html#utils-repair-section-structure


1

If you go to that user's account settings, then click on the "Preferences" tab, I'm guessing they have their "Formatting Locale" setting set to Cymraeg.


1

It's not intended behaviour when you're editing an existing entry, and it can't be changed - because it's not meant to be doing it. I noticed this on a site last week, but I can't replicate it right now. I think it'd be worth filing a bug report on https://github.com/craftcms/cms/issues


1

You can now use the filter tag of Twig. So you can just do something like this: {% nav page in subnav|filter(page => page.slug == craft.request.getSegment(page.level) ) %} do some stuff {% endnav %} Another solution would be to print out the children only if the condition is true: {% ifchildren %} {% if page.slug == craft.request.getSegment(...


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