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
8 votes
Accepted

{% if loop.first %} and {{ loop.index0 }} not working with Matrix

At the moment loop.first and loop.index0 are relative to your block.image loop. If you want them to be set based on your entry.locationSlideshow loop (the parent loop) you can use {{ loop.parent.loop....
Luke Pearce's user avatar
  • 3,863
7 votes
Accepted

Get entry associated with current uri

Surprisingly, the Craft docs aren't super clear on this so I'll post a little info. When you set up a Section in the Control Panel, you set the URI Format and Template fields to map to an entry ...
Sam Hernandez's user avatar
5 votes
Accepted

How to list out entry types in a section

Take a look at the sections documentation: https://craftcms.com/docs/templating/craft.sections The following code lists all entrytypes of all sections. {% set sections = craft.sections....
Tom Bauer's user avatar
  • 1,327
5 votes
Accepted

A Structure section with an entry to a channel index

I like what Matt P wrote in his answer: try to consider how someone [else] will find the logic of the CMS design The other factor you want to consider in information architecture is you only want ...
RitterKnight's user avatar
  • 6,582
4 votes

A Structure section with an entry to a channel index

Yes that makes sense. There are many ways to approach this. I always try to consider how someone other than me will find the logic of the CMS design i.e. How easy will they find Craft to actually use ...
Matt P's user avatar
  • 1,538
4 votes
Accepted

Redirect entry type to another domain

The reason that you get that odd URL with the {% redirect %} tag is just because there's some whitespace at the beginning of the value returned from your helpers.msuLink() macro. Using the |trim ...
Mats Mikkel Rummelhoff's user avatar
4 votes

Matrix vs Multiple entry types

I see this question as two parts: information architecture and templating. If you're used to something like WordPress where the template has a one-to-one relationship with how the template gets data ...
RitterKnight's user avatar
  • 6,582
4 votes
Accepted

Max # of entry types?

Brad mentions there's no limitations on entry types, though whether it's a good idea long term for maintainability and UI purposes is another story. Entry Types are the most useful when your content ...
RitterKnight's user avatar
  • 6,582
3 votes
Accepted

If multiple entry types?

You were so close! Instead of asking whether entry.type is equal to the array (which it isn't), you need to find out whether the value of entry.type matches one of the array items. Here is an updated ...
Jake Dohm's user avatar
  • 766
3 votes
Accepted

Redirect to another EntryType template if no Children exist

Fixed! So bearing in mind i'm using this method to load templates according to entry type, Clive Portman's answer got me thinking about hasDescendants. In my _entry.html I now have something like ...
Martin's user avatar
  • 1,203
3 votes

Limit a field to entries by entry type

Probably too late for you, OP, but the Entries Subset plugin for Craft 3 lets you do this and more.
Katie Fritz's user avatar
3 votes
Accepted

how to specify entry type on front end entry form?

You just need to specify a hidden input with the typeId set correctly. i.e. <input type="hidden" name="typeId" value="{{ entry.typeId }}">
Brad Bell's user avatar
  • 67.5k
3 votes
Accepted

Checking if a field contains information

If you want a Dropdown field with the option to not select a value (or to clear out the current selection), you can just add an option (typically the first) with an empty value column. If the empty ...
Mats Mikkel Rummelhoff's user avatar
3 votes

Duplicate Entry Types into a new section

You need to use a plugin to do this. I've used the architect for doing exactly this in the past. Just export the section and entry types you want to duplicate, rename the section in the json file, ...
André Elvan's user avatar
  • 7,288
3 votes

Managing a large number of Variants in Craft Commerce

I'll go ahead and add this as an answer with a bit more detial....we have a large number of variants in total - about 50 different box sizes for about 110 types of product (each product has ~ 10 sizes ...
Jeremy Daalder's user avatar
3 votes

Entry Types Custom Slug

You can use twig filters in url structures as mentioned by RhealPoirier in a comment above, no need for a plugin: my-section/{type.handle|replace('/(^|[a-z])([A-Z])/', '\\1-\\2')|lower}/{slug} or ...
plankguy's user avatar
3 votes
Accepted

Using multiple sections VS a single section with entry types

It's hard to answer without examples of your content types. I would suggest that if you would ever need deliberately relate one Entry to another using the Entries field type, then making use of ...
Matt P's user avatar
  • 1,538
3 votes
Accepted

Get Entries from a specific Entry Type

$entries = Entry::find()->section('sectionHandle')->type(['yourTypeHandle'])->all();
Robin Schambach's user avatar
3 votes

Showing entries for light switch

Try rewriting your element query like so... craft.entries .section(['etiquette','style','culture']) .requiredReading(true) .orderBy('id desc') .limit(12) .all() In Craft you can do queries against ...
Mutual's user avatar
  • 442
3 votes
Accepted

How can I list Entry Types of a single Section?

You're close – this should work: {% set blogSection = craft.app.sections.getSectionByHandle('blog') %} {% set blogSectionEntryTypes = blogSection.getEntryTypes() %} {% for entryType in ...
Mats Mikkel Rummelhoff's user avatar
2 votes
Accepted

When to add a field to an asset?

It makes sense, when it's a task that should only be done once and is directly related to the asset. A good example I have of an Asset custom field is a field allowing the content-administrator to ...
Matt P's user avatar
  • 1,538
2 votes
Accepted

Entries field won't save/update from plugin, although data seems to be correct

Seems that you simply have to set all entries of a related field at once, and as I tried to add them one by one, it only kept the last.
KSP's user avatar
  • 849
2 votes
Accepted

I managed to make an entry type that won't let me create any entries. How can I fix it?

It sounds like you're trying to have a dynamic title for that section, based on an Entries field (Venue). Working out the nuances in this situation can be a little tricky, but I think this would do ...
Lindsey D's user avatar
  • 24k
2 votes

Redirect to another EntryType template if no Children exist

I agree with the other answers that your best solution is to just render a different template and don't do a redirect. But, if you do find a more applicable use later, you can do in-template redirects ...
Megan Z.'s user avatar
2 votes

Redirect to another EntryType template if no Children exist

It might be easier to have the products point to the same template, then create two sub-templates that you include depending on the entry type. For example, I have a template called landing/pages/...
Clive Portman's user avatar
2 votes

If multiple entry types?

Maybe off topic, but if you are looking to have a lot of logic based around entry types, maybe its easier to have one template per entry type? If you set your section to use the template "sectionName/...
Syversen's user avatar
  • 485
2 votes
Accepted

Unable to delete some entries

You can define different permissions in Craft CMS, if you are not admin its likely someone restricts your access. Furthermore you can't delete entries in a section of type single - those entries will ...
Robin Schambach's user avatar
2 votes

exclude array of entry types in query

I found it here: https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#parameters type: ['not', 'webinarsLanding', 'caseStudyLanding'],
Danielle Frappier's user avatar
1 vote

How to limit navigation by entry type

Both of these work: {% set sectionNamePages = craft.entries.section('sectionName').type('entryTypeA').level(1) %} {% for page in sectionNamePages %} <li class="{{ page.id == entry.id ? 'active'...
Andrew's user avatar
  • 738

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