Questions tagged [entries-field]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
880 views

Passing Multiple Relation Criteria In Plugin

I have a channel (projects) that has two different entries fields (year & research theme), both of which I want to be able to search in a plugin. The docs for the relatedTo entries method show ...
1
vote
1answer
165 views

How do I set the value of a custom entries order field from a plugin?

I'm trying to set the value of a custom field on an order when saving an entry. I found an example of how to do this for a simple text field, but the field I'm trying to set is an entries field, not ...
3
votes
1answer
1k views

How can I programmatically set the value of an Entries field type?

I need to set programmatically the value of an Entries field type when I'm going to create a new entry from the admin form, after the form loads I'm searching for the entry I need to set in the ...
2
votes
2answers
150 views

Restricting relationship field by author

First site using Craft and impressed thus far. I'm going to be allowing CP access for all users, and these users will have access to multiple channels. I want them to be able to relate their entries ...
1
vote
1answer
1k views

Search entries AND within associated assets fields

I have a large list of entries. Each entry has a a bunch of fields and a file-field with one or two files. Those files have related field (Author, Date, ..). I have now implemented a search. All ...
1
vote
2answers
178 views

Put simple content into Craft and grab it in JavaScript

I want to put a few simple text fields into Craft CP and then be able to retrieve them with JavaScript. What is the best way to structure this in Craft? I'd like to be able to create/edit an "entry" ...
0
votes
1answer
250 views

Showing related entries field

I have a section called Services. I have another section called Case Studies. For each Case Study I want to show which service is being used so I add an entry field and choose the right service. On ...
2
votes
2answers
225 views

Maintaining a relationship of parent from children selected through entry field

Not sure that is the best title but: I have a Section called Research Projects. An entry from this section contains a number of images, videos and audio entries in a grid chosen through an Entry ...
1
vote
1answer
633 views

Sort entries in a category or entries field?

I have a Products Section and a Product Category Structure Section In Products there is an Entries Field where the Category is selected from the Product Category section. Is it possible to sort the ...
0
votes
1answer
791 views

Accessing custom fields from User Model

I have a User entries field called 'company'. I'm writing a bespoke plugin to manage users in the front-end and was wondering how I can access the content of this field in my plugin via the user model?...
1
vote
1answer
369 views

Ordering relatedTo entries

There are a few tickets touching on this, but the solutions proposed aren't working and I'd like to share the use case: I have a Table of Contents page that is outputting a set of entries based on an ...
1
vote
1answer
825 views

for loop: get the title of the first element of an entries field

I want to get the title of the first element from a entries field in a for loop. I think its easier to understand with a code example: {% set programs = craft.entries.section('program_point').block....
1
vote
0answers
58 views

How do I filter / restrict entries field in CP with a category

Is there a way to restrict the entry field type to specific categories? For example when adding a new field with type "Entries" to select the categories from where entries will be available. I found ...
0
votes
1answer
615 views

The smoothest way to store JSON object to an entry?

I'm creating a page where I have a bunch of entries I want to populate with jquery drag and drop boxes. It's for the arrangement of songs, just as a tool. And I want to store the position of these ...
2
votes
1answer
166 views

How to get all (prepped) field values from an entry, indexed by field handle

Getting field values, properly prepped, is covered here: What is getContent() / the ContentModel, and how do I use it to get and set custom field values?
3
votes
1answer
294 views

Relating entries to assets within an ElementAction

I'm following the Element Actions example from the official Craft docs. I've defined an Artist entry type, and have defined an entries field on my Assets to relate an Artist to each Asset. To avoid ...
4
votes
1answer
379 views

Many db requests with relationship fields

I have a page with a lot of entries fields. They are awesome but that leads also to a LOT of db requests. Aside from caching are there some best practices to lower db requests on entries fields? For ...
4
votes
2answers
2k views

Exclude “featured” entries from a “recent” entries {% for %} loop

Here's my current setup: Blog (Channel) - All of my blog posts will go here Blog Landing (Single) - This section only has one field - a Featured Articles Entries field that lets me select 3 entries ...
0
votes
1answer
48 views

Display events that appear at certain venue

I'm trying to work out how to query some channel posts (events) that take place at a certain venue. {% set params = { section: 'events', } %} I have a 'eventVenue' field in my events section ...
1
vote
0answers
79 views

Entries relation

I have two entries, let's say A and B. In the B entry I can select multiple A entries in a entries field. I want to get B entries that have specific A entries selected. So i have the code: {% set ...
1
vote
0answers
66 views

Entries fieldtype

Is there scope for updating the Entries fieldtype so that only sections editable by the user are shown in the pop-up modal? Obviously don't want to go changing the core files, but some digging ...
2
votes
1answer
116 views

Is it possible to limit the level at which entries can be selected from within an entries field?

I have an entires field which is using a structure as a source. The structure has 3 levels and I would like to be able to limit it so the user can only select entries at the second level. I've had a ...
2
votes
1answer
177 views

How can I merge entry values to create a select dropdown

For the life of me I can't seem to find an answer for this question, so here goes! I have a field called jobCounty in a section called jobs. The jobCounty is selected in the CP from a drop down list ...
6
votes
4answers
3k views

Programmatically update entry field

I'm trying to update an entry's field value from a Craft plugin. First I was trying to just update the attributes of the entry like so: $entry->getContent()->setAttributes(array( 'metaStatus' ...
2
votes
1answer
252 views

Outputting Matrix blocks with grouped values based on Entries field id

This is the setup: I have a Matrix field called Breads. There is 1 block called Bread. Within, I have two fields: An Entries field called Selected bread (limited to 1 entry) A Number field called ...
1
vote
1answer
146 views

Why will my custom “Entries” field not display anything?

In my entry template I have the following... {% set entry95 = entry.story1995 %} {{ entry95.title }} And this displays nothing. Debug mode is on and no errors are showing. The handle for the field ...
2
votes
1answer
1k views

Add, remove, and append entries to an entries field via frontend form

I'm making a one-button form, to add an entry to an entries field. Adding seems pretty straightforward, but it overwrites any previous entry that occupied the entries field. How would I append an ...
3
votes
1answer
183 views

Multiple Entries fields, show empty ones?

I am using Entries Field to display related content. I have several Entries Field in an article and i also want to display the fields that are empty, but with their section name.... Is this even ...
2
votes
0answers
65 views

Return all entry types or entry fields for one entry object [duplicate]

Is there a way to pull out all entry fields for an entry by their handle so they can be looped through? For example rather than doing each field manually like {{ entry.title }}, {{ entry.description }...
2
votes
1answer
144 views

Get different kind of entries relatedTo one asset (many to one)?

I got an asset field called docs which is contained in 2 different entries. Those entries are in different sections and they contain the docs field directly or through a matrix field called ...
1
vote
2answers
176 views

Add entry author meta field in entries listing table in CP?

In CP Craft Admin in the entries table view I d like to display some authors meta info. How could I do that in my plugin? I know public function modifyEntryTableAttributes(&$attributes, $source) ...
3
votes
1answer
537 views

Hide (or disable) an entry field in CP depending on user group permission?

So I am trying to hide (or disable) a field in the "Edit Entry" view in the CP. I know how to test a user group : {% if currentUser.isInGroup('groupHandle') %} But I cannot find a hook in Craft ...
2
votes
1answer
542 views

Entries Field Type Validation

I am having some issues understanding why validation is not working on my entry forms. I've got an entry with several field types which aren't of type "entries" and the required validation is working ...
1
vote
1answer
121 views

How to use a dynamically defined field handle in a plugin?

I'm trying to make a plugin more generally usable (so others could use it). For my own use, it uses a category field called 'mainCategory' but I'd like that the field handle could be specified in the ...
3
votes
1answer
715 views

How to filter what is showed based on radio button checked

I am fairly new to Craft CMS coming from ruby on rails and angularjs. I am running into an issue with attempting to display images on a home page based on whether or not the radio button titled "...
3
votes
1answer
268 views

If loop contains id `X`

Is it possible to check a matrix array for an ID? I created a entries field which functions as a navigation. Now if the user decides to remove one entry I want the specific template to return a 404 ...
0
votes
1answer
67 views

Possible to append another field to entries field title?

Does anyone know of a way to append another field to the entry title displayed in an entries field? I'd like to try and append an entry_version field to the title displayed so I get something like "...
3
votes
3answers
1k views

Multiple craft.entries field parameters

I have an for entry loop in which I need to look for two different field conditions. Separately they are: craft.entries.eventStartDate('>=' ~ (now.date)) craft.entries.genericEventDate(':notempty:...
0
votes
1answer
346 views

Set EntryModel data on an element

I am trying to update the value of an Entries field on an EntryModel, however I am having a lot of trouble getting it to update correctly. I've tried allocating both an entire EntryModel and its id ...
0
votes
1answer
248 views

Compare custom-field value of entry to registration-form field value before saving user

Whoo, that title is a mouthful... I'm trying to check against a unique school "code" that an athlete has to input to register with a team. The code is different based on what team they are trying to ...
0
votes
1answer
541 views

Create a custom field with my plugin data

I want to create a field like categories but using my plugin data. I need to be able to select one element in entry page to get all the elements from my plugin group base on that selection. do i go ...
0
votes
1answer
627 views

Entries field: Output entries related to category

I have an entries field (activityPicker) that links to other entries in a different section. These other entries have categories (things-to-do and things-to-eat), and I'm trying to figure out how to ...
1
vote
2answers
1k views

Order “Entries Fields” by entry order

I want to order entries in an "Entries field" by the order I added them to the field. So Anastasia would be first and Beni would be last. My only idea was .fixedOrder like you would do it with an ...
1
vote
1answer
236 views

Plugin to maintain data integrity between related entries?

I would like to develop a plugin to help better maintain data integrity between related records. Something like the following: When deleting an entry, check whether the entry has "reverse related ...
4
votes
2answers
5k views

How to output an Entries Field value within a Matrix Field block

I'm trying to code up a Matrix field for a homepage slider, and it contains a single 'Slide' block type. It has fields for Image (Assets), Heading (Plain Text), Sub-Heading (Plain Text), and Slide ...
0
votes
1answer
288 views

Getting relation through entry field by author

I currently have a structure called 'Divisions' that includes 'Team' pages as children. On the 'Team', there is an entries field 'Head Coach', which is an entry created on a 'Coaches' channel. The ...
2
votes
2answers
2k views

Display entries based on 'entries fields'

I want to display blog entries within the related entry template linked together with 'entries fields': -- Entrysection Bla Blog -- Blog entry 1 (Linked to Entrysection Bla via 'entries fields') -- ...
3
votes
1answer
1k views

Get related entries from matrix field

I have a matrix field with one block type. In that block type, I have one field that is a related entries field. How do I access the title from the related entries field from the matrix field? Here ...
2
votes
2answers
270 views

Select entry from any locale with Entries Field

I'd like to be able to create an Entries field that can select from entries from all locales. Currently it looks like there's the option to choose a single locale or specify the same locale as the ...
5
votes
1answer
217 views

Entry with many fields vs plugin/custom data structure

i'm just getting my feet wet with craft and would appreciate some pointers. Basically, what i would like to do is show and compare products. Each product will have a description, price, review, and ...