Questions tagged [entries-field]
The entries-field tag has no usage guidance.
132
questions
1
vote
1
answer
23
views
Entry URI Format from an Entries Field (Categories)
i am trying to set the url format for some entries to include the category slugs set for it within a category entry field - i can get the first one like this
{eventCategory.one().slug}/{slug}
but ...
0
votes
0
answers
25
views
Disable URL's for nested levels in structure but keep URL's for the 2 top levels
I have some products with categories that go 4 and sometimes 5 levels deep.
The site will have an overview page for the first 2 levels.
For example: my-website.com/category/subcategory
I have created ...
1
vote
2
answers
35
views
testing if oEmbed field is empty fails
I am using the 'oEmbed' plugin and I have an oEmbed field with the handle videoUrl.
I am trying to do something very basic - to test if the field is empty.
I am not sure why it fails. I have tried the ...
2
votes
1
answer
139
views
Eager-load entry field that is being paginated
We have this entry with a field called faq which can contain multiple faq entries. We paginate this field with this code:
{% paginate entry.faq as pageInfo, pageItems %}
Now Blitz Recomendations says ...
1
vote
1
answer
51
views
Update from Craft 3 + Reasons to Craft 4: how to get fields' conditions from template?
I've just updated from Craft 3 to Craft 4. I was previously using the Reasons plugin for CP but also front-end purpose. On front-end, I was printing field layouts and show/hide the fields based on the ...
2
votes
1
answer
173
views
Parent based Selectable Entries Condition
In the Craft CMS admin, I have an entries field on a page, and I want to limit the selectable entries available to only the child pages of the current entry.
To achieve this, I set the Selectable ...
0
votes
0
answers
83
views
Programmatically change value of plaintextfield in matrixblock on Entry presave Event
I'm new to craft cms and try to write a module which should hook into the EVENT_BEFORE_SAVE and change the value of a plaintext field within a matrix block. Therefore I've set up the Module just like ...
0
votes
0
answers
22
views
GET Checkbox Value to the Query (Entries Field) [duplicate]
I am writing my first post because I am stuck and cannot move forward. I need a filter that filters by "Entries Field." The selection is done through a form + checkbox. I also get the ID of ...
2
votes
1
answer
698
views
Orderby entry field?
I am getting music album entries with the following code:
{% set entries = craft.entries()
.section('releases')
.orderBy('title ASC')
.all() %}
Rather than ordering by the title, ...
1
vote
1
answer
78
views
Add entry to entry field via frontend form
I have a frontend form that updates a single entry and sets the users field to the current user:
<form method="post" accept-charset="UTF-8">
{{ csrfInput() }}
{{ ...
1
vote
0
answers
42
views
cannot create matrix in craftcms 4.2.3
I just created a fresh project with craftcms 4, but am running into issues creating a matrix. Even with just one block field. It gives me the error
Cannot assign string to property craft\models\...
0
votes
1
answer
209
views
Navigation from structure with field Entries for URL
I am new to craftcms and searching did not get any answer. I have 2 fields setup navUrl (type entries) and customUrl (url) and I have a section called mainMenu with these fields. I have then added the ...
3
votes
1
answer
300
views
How to get column name of an entrie's field
I want to query some entries in a section.
I am able to write a query using a GET Param as a filter on the title field.
If I want to query a custom field however I need to know the precise column ...
1
vote
1
answer
178
views
How to find next sibling from entry order of parent entries field
I have an index of projects that uses a standard entries field to select multiple entries to display and also provides a custom order (different to their Structure order). This is my "Projects&...
0
votes
0
answers
67
views
Entries Field save errors
I'm running into some odd behavior with an entries field. There are multiple entries fields on the site and all work as expected but one. The behavior is as follows.
If there are multiple entries ...
1
vote
1
answer
330
views
Field dropdown - default value is not working in CMS
maybe this is a weird question but I have a dropdown field with values from 1 to 10, and set 4 as a default value.
The thing is: I edit my entry and when I see my dropdown the value is number 1, but I ...
3
votes
1
answer
105
views
How can I query entries related to another section’s entries having specific Matrix checkbox field values?
Let’s say I have a site with two sections: Things and Colors.
Things has a Matrix field (thingsBlocks) with a Sizes block type. That Sizes block type has a checkboxes field (sizes) with values that ...
1
vote
1
answer
147
views
What's the attribute of a Matrix field to add error message
I try to validate some fields before saving the entry, if the field is invalid, prevent the entry from saving and return the error message, I'm doing it via Element::EVENT_BEFORE_SAVE event.
It works ...
0
votes
1
answer
137
views
How to bind JavaScript events to entry form fields in the control panel
When adding an entry, there is a field called resource id, I want to build a front end event on this field, after the value input or changed, trigger ajax to call an external api to check whether the ...
1
vote
1
answer
140
views
Allow drafts in entries field
Is it possible to allow selecting drafts in an entries field? Not drafts of an existing live entry, but drafts that aren't published yet.
The only thing I found is an ElementCriteriaEvent triggered in ...
1
vote
1
answer
575
views
How to update a User's Entries custom field only once just after save?
From a custom module, I'm listening to EVENT_AFTER_SAVE_ELEMENT events, to be sure to get the Entry ID after save:
Event::on(
Elements::class,
Elements::EVENT_AFTER_SAVE_ELEMENT,
function (...
1
vote
1
answer
313
views
On a Craft 3 multi-site, how can I setup an Entries field to select entries from other sites?
On my primary site on a Craft 3 multi-site, I have an Entries field used to add links to other sites' entries. These entries are from Channels / Stuctures that are using the Only save entries to the ...
1
vote
1
answer
1k
views
How do I write a GraphQL query to search through sub-entries/entries as fields and return the whole entry?
So I have a fairly complex section structure that (on an Entry Type) has a matrix field that contains entries as fields(sub-entry) within a blocktype.
I'd like to write a GraphQL query such that when ...
2
votes
1
answer
131
views
How many levels will RelatedTo work? In Reverse?
The TL;DR summary: if I have a related Entries field that I access, can I then access an Entries field within that entry?
I created a learning project running on MAMP to help me learn Craft, and one ...
1
vote
1
answer
158
views
Can't get a simple Reverse Relations for Entries field to work
I'm trying to get a simple Reverse Entries working, nothing fancy, but I'm stumped.
I created a little personal project just to help me stretch and learn Craft better. I picked the NFL Draft just ...
2
votes
1
answer
149
views
Element API using the entries field to display related content from a separate section
I've seen similar questions but none seem to help.
I have two sections named jobs and jobDescriptions. I'm using the entries field to pull in a description field from the jobDescriptions section to ...
1
vote
1
answer
78
views
Best Practice on how to build a Pricing Page on CraftCMS
CraftCMS gives us so many ways/options on how to build pages that I'd love to see what people are doing with their pricing pages!
I'm planning on building something similar to Amilia.com or Slack.com.
...
1
vote
1
answer
103
views
How do you save custom fields on an EntryFixture?
I can't for the life of me figure out how to setup EntryFixtures in craft to populate with custom fields. I'm using the project config which already has the sections and fields defined in my tests. I'...
0
votes
0
answers
33
views
Structuring externally scraped content
I scrape content from an external website using JSON API with the FeedMe plugin. Content is saved as entries with plain text and redactor-type Fields.
How can I structure this content so that I can ...
3
votes
1
answer
270
views
what is the correct way to programmatically set checkboxes (MultiOptionsFieldData) in a migration? (solved)
I need to update existing entries after the creation of a checkbox fields, to apply the default value to everything that was created before the availability of the new field.
The code should run in a ...
1
vote
1
answer
43
views
After Migration from v2.9 to 3.5 - some entries added into an entry-relation-field get added twice after saving
We migrated a craft cms site with 3 locales from v2.9 to 3.5
We have a section with a field of type "Entries".
When editing the entry, and adding certain entries to this field, those get ...
1
vote
1
answer
758
views
Database Exception Column not found: 1054 Unknown column 'configVersion' in 'field list'
I get this Error when i want to save a Field. Also when i want to create a new field. I can hit the goback button and strangely the field gets still saved.
I work local and have project config ...
1
vote
1
answer
19
views
Output specific entry from entries field based on position
I have an entries field in a section, I am looking to output a certain selected entry from this field based on its position.
For example I want to out the 2nd or 3rd entry only from this entry field, ...
1
vote
1
answer
255
views
Possible bug when using Entries fieldtype with multi-site
Thought I'd run this by some people who know what they're doing before I report this as a bug.
I have a multi-site configuration. One of the sites has a base URL of example.com and only contains one ...
1
vote
1
answer
93
views
Feed Me import from CSV ignores decimal point
I use Feed Me to import values from a .csv file into my entries. Since a day i have an issue i can't explain. I didn't change anything.
Precisely, the issue concerns a number field.
In the .csv file, ...
1
vote
0
answers
124
views
Migrating to Matrix using Feed Me and Element API
How can I use Element API to move my entry fields into a matrix-based content builder? I'm going off the docs found at https://docs.craftcms.com/feed-me/v4/guides/importing-into-matrix.html#setup-your-...
1
vote
2
answers
435
views
Group by related entries field
I have a channel of Musical Compositions:
Now all these Compositions have a Composer.
All the composers are stored in a separate channel and then linked with their respective compositions trough a ...
1
vote
1
answer
51
views
Displaying An Entry's Image on Edit Page
Currently, these Entries display just the title. Has anyone found a way to display entries as a thumbnail (from it's image field)? I'm starting to look at plugins, but haven't seen anything that would ...
1
vote
1
answer
29
views
Show Category Title only where an entry has been included in an Entries field
I have a Category Group with an Entries field assigned so the admin can select which existing Entries should fall within a given category. An Entry can be assigned to multiple categories.
On the ...
1
vote
1
answer
257
views
Undefined index error in trying to duplicate file
I've inherited a Craft-based website, and I'm much more familiar with WordPress, so please pardon the extremely basic question: the homepage for this site uses {% extends "_layout" %} and then ...
1
vote
1
answer
52
views
How to limit sources for Entries field set up via migration
I'm seeting up all of my project's fields using migrations.
This works really well, but I haven't been able to figure out how to limit the sources (sections) for an entry selection field.
I've based ...
0
votes
0
answers
73
views
Add Matrix Blocks to existing Entry with Form without discarding existing Matrix Blocks
When I want to save an new Matrix block with an form to an existing Entry:
<form method="post" accept-charset="UTF-8">
{{ csrfInput() }}
<input type="hidden" name="action" value="entries/...
1
vote
1
answer
61
views
How to include a lightswitch for each related entry in the source element of a relationship
I have a Services section in which I keep a related entry field for News. (News by Service) The News items to be displayed for each service are selected in a "News" entries field in the Service entry. ...
1
vote
2
answers
389
views
Get all available fields in plugin setting page
I am trying to get all the fields created by admin in my custom plugin setting page.
As we can get entries , in same way can we have option to get the available fields.
{{ forms.elementSelectField({...
2
votes
1
answer
437
views
Use an entry field's value in body class
I have created a plain text field that is assigned to a section and is available in the tabs for entries in that section. I want to use this field's value to modify the CSS on my template. My _entry....
3
votes
1
answer
393
views
Related Entries not sorting correctly
Craft 3.0.16.1
I have a relationship that is outputting entries, but the entries are not in the order as selected.
{# not sorting correctly - **fieldName** is a variable passed via include #}
{% ...
1
vote
0
answers
101
views
Check the field type of all the attributes of an entry
Here's the whole picture:
I'm trying to make an API endpoint which should output everything from an entry:
First I did this:
public function transform(Entry $entry)
{
return $entry-...
1
vote
2
answers
493
views
Group entries by Category and then in each category by related entry field
I have a channel with categories and an entries field. I need to first group all entries by their category. This is working fine.
{% set entries = craft.entries.section('publicationsChannel') %}
{% ...
2
votes
1
answer
470
views
Element API Fetch Entries URL Within Matrix
I have a matrix with a field to set a Entries URL. Unfortunately the entry is not being returned, only an empty object.
Here are my field settings below and element api code.
See below for the ...
2
votes
1
answer
297
views
Using values from one entry as default values in another?
Is it possible to do the following in Craft?
I want to set up course information as follows:
1) have a courseType which contains default values for that type of course - name (i.e. 3 hour skills, ...