Questions tagged [field]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
10 views

Radio button field no setting default checked

I have two radio buttons on a field. I check one of the options as default so it's checked automatically, but when I visit the entry it's on, both of them are unchecked. I've tried deleting and ...
1
vote
1answer
28 views

Using basic markup in field names

I'm creating field names for electrical components and I'd like to use subscripts like this: V<sub>min</sub> V<sub>max</sub> V<sub>adj</sub> Vmin Vmax Vadj Note ...
1
vote
1answer
17 views

Find Entries based on Field Values

I have a set of events I want to query based on user-input date times. How do I achieve something like this? {% set entries = craft.entries.section('events').minScheduleDate('>=', 'now')....
0
votes
1answer
29 views

Add rows to editableTableField via custom javascript

I am making a custom field via a module. I have an editableTableField that will hold the actual field values saved to an entry and I have other HTML elements that are used to grab data from a ...
1
vote
1answer
29 views

Is it possible to create this type of custom field?

We need a field that holds assigned postal codes. Each Location entry will have this field and I'd like to have the following: Buttons to assign postals by city, state, county (data grabbed from ...
0
votes
0answers
39 views

Can't save fields

I want to change some fields and when I click 'save' it goes to the list of fields and the changes aren't saved. I can't add fields either. I can add and edit entries for example.
0
votes
0answers
21 views

Asset subfolder dynamic condition

I have a channel called Locations. I've created a matrix field to hold x amount of team members. I have the asset folder for the team member's picture saved to locations/{owner.slug}/team I would ...
1
vote
1answer
19 views

Get and display a product's variant fields in twig

I'm working on a product template that can display products of any type. Various product types have varying numbers of variant fields each with their own options as other products. (All of my variant ...
0
votes
0answers
13 views

entry-field that is only editable on entry-creation and contains unique string

I have a text field that is used as a text-handle for linked entries. So it must not be changed after other entries reference it. It should be editable only on the creation of the entry and validated ...
1
vote
1answer
21 views

Values from fields in templates

I have categories in my cms. How do I gets a list of these value into my templates? Thanks.
1
vote
1answer
32 views

How to edit a date field in a plugin

So I want to edit date type filed on entry save, but I don't know how to format it. It times out on string and don't seem to accept DateTime objects either. Event::on( Elements::class, ...
1
vote
0answers
36 views

Custom plugin: Creating new fields will delete the field group they're being created in

I have a simple plugin which reads in a CSV file, and based on the first row of data will create a new field group, and then create fields within that group. The first time I run it everything goes ...
1
vote
0answers
18 views

Asset field - saving assets with dynamic subfolder by categories not working consistently

I have two asset (image) fields in project entry type, both with the same setting and with different outputs… Anyone knows why? Thanks My fields are: intro image field gallery image field Both ...
2
votes
1answer
90 views

How to exclude certain fields from .search()

I have an event section in my website with a couple of fields on the entries and one of them is a "related events" field where I can select a other event entries to be shown at the end of the page. I ...
1
vote
1answer
97 views

Element query: find entries where a field's value is greater than, or less than another field's value?

I would like to do something like this: craft.entries.section('mySection').field1('> field2').all() And it should return all the entries in mySection whose field1 value is greater than their ...
1
vote
1answer
49 views

Setting a default entry for the entry field

I have an entry field that is a selector tool for the page call to action at the bottom. I have a channel of four or five entries and I'd like one of them to be the default selection so it's one less ...
3
votes
1answer
22 views

Partial Dates within Craft

Is it possible to store partial dates? EG i want to create a document that covers a date range, sometimes that range could be Jan/2013 to JUN/2014 other times we may need it more specific EG 20/JAN/...
1
vote
1answer
46 views

Non-numeric characters in number field producing errors

Craft 3 is giving me this error when my client enters non-numeric characters into a number field on an entry: number_format() expects parameter 1 to be float, string given Is there a way for it to ...
1
vote
1answer
64 views

Update field setting value using getFieldByHandle

I need to update the limit setting for Images allowed to be empty, so as to allow for no limit. How do I go about updating the 'limit' setting? $fieldsService = Craft::$app->getFields(); $field = $...
1
vote
0answers
115 views

Unable to add data via migration to a new field

When I am creating a new field (and I've tried plain text, redactor, supertable and matrix field) and associating it with an existing entry type (using the Control Panel to do so), I run into an issue ...
0
votes
1answer
16 views

field from category not available via craft.categories

my categories have a custom field called titleTag for SEO as well as a number of other fields. When I render them at their URI (/categories/cat1) I can output those fields easily with {{category....
2
votes
0answers
76 views

How to print all possible options of a dropdown field inside of a Matrix field?

I'm asking this outside an entry context. My starting point is {% set field = craft.app.fields.getFieldByHandle('matrixFieldHandle') %} When I print the data of the field, I find nothing ...
1
vote
0answers
72 views

Craft CMS 3 create custom field in plugin with two fields returning two values

I need to get two text fields under the same custom form and have it return two different values to be stored in the database. Right now with what I have, it's storing the same variable for both, ...
1
vote
1answer
38 views

What could the possible causes be for a mismatch between `craft_fields` and `craft_fieldlayoutfields` MySQL tables?

I'm debugging an Internal Server Error on a site developed by, well, not me. :p The site has an absolutely enormous Matrix field called "Modules", and the blocks in said field have so many fields that ...
1
vote
1answer
183 views

How can I get the type of a field using Twig?

I would like to loop through all the fields of a field layout tab form the current entry. This is working fine to get the field name and value: {% for fieldLayoutField in entry.getFieldLayout()....
1
vote
1answer
23 views

How to create a border + border colour field on an image

My first question here... maybe one of a few! I've inherited a Craft project recently and don't have much experience with it. I want to allow admin to set a border (and border color) whenever they ...
2
votes
1answer
133 views

Getting all the values out of a field as array of values

I have a multi-select field in my work section I want to get the values either with the Element api as json or an array of simple values in my template.
2
votes
1answer
49 views

Craft 3 Field Plugin not firing $view->registerJs in entry versions

I am creating a Craft 3 plugin. It seems to work fine when editing regular entries but when I open a revision the JS I'm injecting using the below doesn't appear on the page. $view->registerJs($js,...
1
vote
2answers
318 views

How can I get entry id in field

I create a new filed type and attached it to entries. Now I need to get the entry id which the field is attached to. I tried $this->element in my field class, but got an error said that I'm ...
1
vote
1answer
44 views

How to create a Matrix Relation field / relate Matrix Blocks to other Elements

I would like to create a field / a way to relate a certain Matrix Block to another Element. Is this possible? For example: Entry A contains a Matrix Field matrix and has several blocks. I want to ...
1
vote
1answer
147 views

Translatable dropdown menu

Does anyone know how to make the dropdown field translatable? I'm working on a site which has both English and German languages, but whenever I set up a dropdown field it only ever appears in English ...
0
votes
1answer
130 views

Fields (Matrix) side by side?

In ExpressionEngine it was possible to have fields side by side. So when creating a entry you had all options (for example for an image) in one row. I can't figure out how to do that in Craft
2
votes
1answer
308 views

User registration form with checkbox field

Hi I have user registration form with multiple custom fields. They all work fine except for the field I have as a checkbox. It returns an error of 'my-field' is invalid. Any ideas anyone? code below (...
1
vote
2answers
140 views

Multiple Category Sources Field

I want to utilise the Category field type but with the ability to choose from multiple category sources (as with Entries). I noted in cms/src/fields/Categories.php that $this->allowMultipleSources ...
1
vote
1answer
90 views

Matrix Table Content not showing

I have a matrix table field that I want to render on a page. I've tried a few different things and nothing is working. I tried switch and elseif, but those weren't working. I'm no longer getting ...
1
vote
1answer
62 views

Populate Field Group With Fields From Another Field Group

I hadn't seen this asked, so I thought I'd broach the subject. I would like to copy fields into a new field group, and then add/delete a few of those fields from the new group, to save time of ...
2
votes
2answers
407 views

How can I iterate through an array of field handles for an entry?

Background: One of my templates has up to 6 fields that should each go into the same markup. Here's an example with a courseDesign field: {% if entry.courseDesign|length %} <section class="col-...
1
vote
0answers
38 views

Creating variants

I need to create variants for my entries ( the entry type is Product but I'm not on Craft Commerce ). The variants have a number of features. Those features may change between products ( ex. variants ...
2
votes
1answer
67 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, ...
1
vote
1answer
35 views

How do I setup my fields for a tumblr-like blog

My blog has different post types, e.g. full blog post, quick status, quote, image post, how would I go about it? Is the logical way to setup a single Matrix Field with each block representing a ...
1
vote
1answer
90 views

Search and link to Entries Matrix Field

I'm trying to create somewhat of a clever search for which only searches through certain pages of my site. At the moment, it can search those pages, but instead of the result returning the page name, ...
1
vote
1answer
109 views

Is it possible to use an existing field into a matrix?

I'm trying to reuse a dropdown field inside of a matrix. I've already created a field which has hundreds of dropdown values. I want to be able to select from this dropdown field for each item of a ...
1
vote
2answers
71 views

Database: Syncing “craft_fields” table through SQL dumps not possible?

I've been trying to simply sync an addition to a matrix field building block from my local dev server to the live environment database by doing a SQL dump of the "craft_fields" table. I now have the ...
1
vote
1answer
115 views

Can I add fields to the User > Account screen?

Is there any way to add to the fields shown on the 'Account' tab on the user account screen? I know I can add fields via the layout designer, but these appear as seperate tabs. I'd like to add "...
1
vote
0answers
97 views

Can't dynamically add value to hidden input Sprout field

I'm trying to add a hidden input with Sprout forms and Sprout fields but I can't dynamically add a value to the input attribute. I have a custom form template in craft/templates/_forms/field.html in ...
1
vote
1answer
57 views

Possible to change view of related entries field?

Is it possible to change the display of the related entries field, to include extra info (hoping to add thumbnail, because otherwise these entries are damn hard to identify!) I don't think they are ...
2
votes
2answers
91 views

Is it possible to populate admin form with data supplied by an external API?

I've been tasked with reviewing Craft as a potential solution for the company I work for and one of the requirements is that we need to be able to provide data from a external API in the page creating/...
1
vote
1answer
304 views

Get a field's required attribute in frontend form

I am trying to get the required attribute of a field in a frontend form. I know this attribute only makes sense in the context of an entry type. Doing this craft.fields.getFieldByHandle('handle') ...
0
votes
1answer
81 views

Disable “dynamic links” in rich text fields

When we're adding a "link > link to an entry" to a rich text field, this will result in a link to https://www.site.com/page#entry:3962:url and we understand what the purpose is of this additional #...
1
vote
1answer
42 views

Trying to set a default asset folder using Craft tags

I'm trying to set a default asset folder for a field, as per the Craft docs on Dynamic Subfolder Paths. I'm trying to set the asset path for each blog article to be /our-journal/{date}/{slug}, where ...