2022 Developer Survey is open! Take survey.

Questions tagged [field]

The tag has no usage guidance.

22 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3 votes
0 answers
341 views

How can I create a dropdown field programmatically with a plugin?

I'm trying to create a Dropdown field and add it to the User field layout. I've successfully created an empty dropdown field (no options) and added it to the User field layout. Here is my current ...
user avatar
  • 76
2 votes
0 answers
89 views

Custom fieldtype to add text field to dropdown, radiobuttons and checkboxes

In my plugin I need to create a fieldtype of a dropdown, radiobutton or checkbox combined with a textfield. I've gone ahead and created a custom field type using the description here https://craftcms....
user avatar
2 votes
0 answers
724 views

Asset dynamic subfolder paths referencing entry section not available until saved

I have an asset field within a matrix block, for which uploads are restricted to a single folder. The upload location path is set to {owner.section.handle}/{owner.slug}. Using this pattern the asset ...
user avatar
1 vote
0 answers
32 views

Embedding code into an entry

I need to embed some coding into an entry, but I'm unsure how to do it. I understand that I need to put the code into a Plain text field, so I've created a Plain Text field in Settings, but I now don'...
user avatar
1 vote
0 answers
55 views

Craft Table/Tabular static entry input field

Is there a way to set up a Craft CMS entry field to have a table with predefined rows and columns? I have tried with the native Craft Table field, but it allows users to add rows or edit default ...
user avatar
1 vote
0 answers
106 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 ...
user avatar
  • 111
1 vote
0 answers
56 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 ...
user avatar
  • 65
1 vote
0 answers
307 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 ...
user avatar
  • 171
1 vote
0 answers
267 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, ...
user avatar
  • 11
1 vote
0 answers
79 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 ...
user avatar
1 vote
0 answers
251 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 ...
user avatar
1 vote
0 answers
47 views

Make fields sortable in CP

I'm displaying list of fields on frontend (using craft.fields.getFieldsByGroupId) and for that purpose I need the fields in group to be in particular order. Is there a way to add 'order' property to ...
user avatar
1 vote
0 answers
98 views

How to insert data with the querybuilder?

Is it possible to insert data with the query builder if so how? I want to make (backend) fields by queries. What is the easiest way to do this? Or do I have to use regular mysql queries?
user avatar
  • 31
1 vote
0 answers
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 ...
user avatar
1 vote
0 answers
244 views

Get entries using Multi-Select Field as Criteria

When querying for entries, I'm stuck on how to query for "selected" fields. The query I'm using: $criteria = craft()->elements->getCriteria(ElementType::Entry); $criteria->section('athletes'...
user avatar
0 votes
0 answers
12 views

Fields are saved, but not loaded for some blocks

I'm experiencing an issue on my development-environment, and I cannot figure out what's going on. It seems that the fields of some of our blocks aren't being retrieved after saving. To reproduce I ...
user avatar
0 votes
0 answers
64 views

internal server error when creating new field

whenever i try to save a new field I get an internal server error in the backend of craft 3. This happens whenever i want to create or modify a field that has an input like date, plain text, reactor......
user avatar
0 votes
0 answers
23 views

How to validate a single field on an element?

I'm working on a migration which includes importing some phone numbers that will be stored in a Phone Number field. Some of the phone numbers are malformed, so I'm trying to validate the phone number ...
user avatar
  • 6,040
0 votes
0 answers
24 views

Need to populate new field based on existing data

Say I have a section called "Stores" that has an existing field called "Store Hours". The client has populated the store hours for 1000 some stores. Now, however, it seems what the ...
user avatar
  • 121
0 votes
0 answers
62 views

Add additional entry fields to backend search

The search field in the craft backend entry section searches the title and slug field by default. Is it possible to add custom entry fields to this search function (in my case e.g. a custom item ...
user avatar
  • 1
0 votes
0 answers
289 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.
user avatar
  • 1
0 votes
0 answers
78 views

How to create a plugin which will update a field in a section when an entry is saved

I am looking to create a plugin which will update a field in a section when I save an entry. I will be getting the length of an MP3 file (using FFMPEG) I upload via assets and output the time to ...
user avatar
  • 419