3

{% set allEntries = entry.entriesSelector.all() %} <ul> <li>First: {{ allEntries[0].title }}</li> <li>Second: {{ allEntries[1].title }}</li> <li>Fourth: {{ allEntries[3].title }}</li> <li>Last: {{ allEntries|reverse[0].title }}</li> </ul>


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 ...


2

After executing: craft migrate/up --type=app it works again.


1

If relatedJobDescription is an Entries field, accessing the field from your jobs entry will not return the selected jobDescriptions entry directly. Instead, you will get an EntryQuery which you can use to get the selected jobDescriptions from the database. See Working with Entries Field Data and Querying Entries. To get the jobDescriptions entry, you can use ...


1

Craft 3 $entry->setFieldValue('my_field_handle', 'new_value'); $app->elements->saveElement($entry);


1

Prepending the field name with field: should do the trick. <?php return [ [ 'sectionId' => $this->sectionIds['locations'], 'typeId' => $this->typeIds['locations']['locations'], 'title' => 'Location 1', 'field:gmbId' => '123', ], ]; See https://github.com/craftcms/cms/blob/develop/tests/fixtures/...


1

Sleeping on it (and peeking at the db) provided a solution, with even simpler code: $entries = \craft\elements\Entry::find() ->section('sectionProduct') ->all(); foreach($entries as $entry) { $entry->setFieldValue('distribution', ["1", "2"]); Craft::$app->getElements()->saveElement($entry); } where "1" ...


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


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