Questions tagged [fieldtypes]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
24 views

What will happen if we change the field type in the fields (settings -> fields) in Craft 3?

I am a beginner in Craft CMS. I just want to know, what will happen if we change the field type in the fields (settings -> fields) in Craft 3?
1
vote
2answers
36 views

Proper way to implement array of objects as Craft field

I'm using Craft CMS for the first time and have a question about the proper/best practice to store what would equate to an array of objects (or just a plain array) in Javascript or JSON. Say I'd like ...
1
vote
1answer
18 views

Number field when empty and value=0

Is there a way to differentiate the number field value empty and 0? I would like to display this field only when there's a value in the field even though the value is 0. But when I input 0 into ...
1
vote
0answers
23 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 ...
1
vote
1answer
38 views

Craft CMS 3 Date Field problem

I added some date fields on my entry. I select a date and save the entry. But the date field saved the day before. Every editing the entry continue saving the day before. When the date comes to the ...
0
votes
0answers
40 views

Custom plugin - how to save settings featuring array?

I'm developing a custom plugin but hitting an issue when I want to save a settings that uses the multiSelect, checkboxSelect or checkboxGroup fields (essentially any field that saves values as an ...
1
vote
1answer
19 views

Pulling blog entries related to a structure entry field type

fairly new to craftCMS. I've wrestled with this now for hours and exhausted all research avenues. I have three main "service pages" (Web Design, Digital Marketing, Hosting & Analytics) These are ...
0
votes
0answers
18 views

How to create Unique text field?

Is there a way to create unique field with native MySQL unique index? We have a use case where we don't want duplicate content.
1
vote
0answers
25 views

Storing complex field content (plugin)

I'm trying to work through some issues with the field content for our Maps plugin, but I'm not sure about the best way to go about it. Currently the value for each map field is stored as an element ...
1
vote
1answer
37 views

Loop through all created fields and get the field type

I want to show some input fields on frontend template form. Type of input is dependent on the type of fields selected on the backend. For example, if the text field is selected in the backend I ...
0
votes
0answers
42 views

What's the difference between `checkboxGroupField` and `checkboxSelectField` in Craft 3?

Short: What exactly is the checkboxGroupField used for? And why not just using the checkboxSelectField? Long: I am building a library that's gonna be required by a couple of my future Craft plugins ...
0
votes
0answers
20 views

Access all entries when selecting an entry on multisite setup

I have a Craft 3 multi site setup. For example: - Site A - Site B - Site C Only Site B has a blog (channel). So the channel 'Blog' is disabled for Site A and site C. Now, I want to link to a specific ...
1
vote
1answer
24 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.
0
votes
0answers
14 views

Transition content from deprecated fieldtype

I used a special input mask field on a Craft 2 installation. Now I upgraded to Craft 3. Since the fieldtype doesn't exist for Craft 3 I converted the field to a plaintext field. Now all the fields ...
2
votes
1answer
55 views

Pre-fill fields when creating an entry in CP

I am using redactor plugin for my field type and I want to use global values of the same field type to be used as pre-fill value when creating a new entry. Use case: Each year there is an edition of ...
1
vote
1answer
133 views

Commerce discount promotions as a fieldtype?

I'd like to create an entry in Craft that talks about a new discount, and then choose that discount via a field (so a bit like you can choose an entry or a product). That way, should the parameters of ...
3
votes
1answer
24 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/...
2
votes
1answer
60 views

Craft CMS 3 data structure advice for vehicle make, model, trim, year tagging

Hi i really would like some advise on best practices on setting up some data for my Craft APP. Most of my documents will be linked to vehicle make/model/trim/year. EG Audi A5 Sport 2009-2016 and/Or ...
1
vote
2answers
223 views

How to Access the Twig Attribute Name from the Fieldtype Class

I want to be able to output different values for my fieldtype depending on the twig attribute. So {{ entry.myField }} would output AK by default, but {{ entry.myField.label }} would output Alaska. ...
1
vote
1answer
278 views

Custom Field Settings: Unknown Property Error

I have a custom field with a setting for regionType, but when I try to save the field I get this error: Setting unknown property: kgrote\siteutilities\fields\Regionselect::regionType In my ...
1
vote
1answer
44 views

Type number form in textField for plugin

I haven't found any fields that deal with numbers for a plugin. I've changed a forms.textField into a type:number which has seemed to work fine for the most part. But I can't find a way to keep ...
1
vote
1answer
84 views

Where does Craft store the field definitions?

I would like to add field and section definitions to versioning. Or at least, have them backed up constantly. I haven't been able to find out yet how craft handles this. I'd say it's in the database, ...
1
vote
1answer
367 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
44 views

Custom Pluging Entries FieldType

I have 2 plugins I created that store similar data: Plugin 1: id, name, panel_id, price Plugin 2: id, name, test_id, price I want to attach my plugin data to an entry, and I need to make sure they ...
2
votes
1answer
65 views

warning icon on fields

I am seeing warning icons on drop down fields like this Where does this come from?
1
vote
2answers
546 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
0answers
42 views

How do you include an “Add element” button to the element selector modal

In my plugin's field types I am extending the BaseRelationField. How do you activate the "Add Element" button that shows in the Element Selector modal when the element is double clicked?
1
vote
1answer
161 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 ...
3
votes
1answer
570 views

Missing Position Field Type in Matrix (Craft 3)

Anyone know how to get the Position field type to show up in Craft 3 (RC)? I have a Matrix field, and an Asset/Image field within that, and I'm trying to add a Position field to it.
2
votes
1answer
105 views

Plugin Development: find source group used by field

I'm writing a plugin that works with Fields in various ways, one thing I need to do is get the category source groups available to a particular category field. I have the field's handle and id and can ...
0
votes
1answer
75 views

How to display all fields for an entry within an entry field type?

I've got a portfolio site I'm building, and on each project's page I'm wanting to show a list of people who worked that project. I created a channel section called "work" with an entry field type ...
2
votes
0answers
79 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....
2
votes
1answer
389 views

Dynamic placeholder text in 'Plain text' field type

I have a plain text field that encourages content editors to write a more detailed description of a piece of content. However, on the front-end the template will use the post title by default if this ...
6
votes
1answer
221 views

Reorder selection of categories in category fieldtype

I'm looking to reorder my selected categories within a category field. I'm hoping this is possible because the order an editor selects these categories is important, primarily for the .first() ...
1
vote
1answer
51 views

Is there a fieldtype in Craft like “Content Elements” or “Bloqs” for ExpressionEngine?

I have been using EE for over 5 years now, and am just starting to get into Craft (and I love it!). In my recent EE sites, I've used Content Elements, and it has been a great way to give my clients ...
2
votes
1answer
564 views

More than one field for a fieldtype plugin

I can have many 'settings' fields for a fieldType and they're saved as a serialized string in the database. Is it possible to have more than one field for the fieldType itself? It looks like there's ...
1
vote
1answer
287 views

How to get Category URL from field in Matrix

This is my Matrix set up: I'm stumped to how to get the Categories URL. {% for block in entry.galleriesItem %} {% switch block.type %} {% case "galleriesItem" %} <a href="...
2
votes
1answer
286 views

Table fields, default single empty row, and never returning as empty?

I'm having a small problem with table fields. My issue is that by default a table fields starts with one row. Even if you leave this row empty (no values at all in any column) the field will never ...
3
votes
0answers
61 views

Set default order of Custom Fields inside Layout Tab

I'm writing a custom plugin, and I want to specify a custom order of the Fields in a tab. My plugin installs several fields, and I want the user to be able to simply add the tab that contains my ...
2
votes
1answer
39 views

Show on user profile page the commissions he is connected to

I have a commissions section in where we have a matrix field where we add the user (from craft.users) and the function of the user. A user can be in more that one commissions. On the user profile ...
4
votes
1answer
117 views

Plugin fieldtype settings for ColumnType::LongText being inserted as varchar(255)

I’m working on a plugin that includes a custom fieldtype. Using Craft 2.6.2911, the fieldtype’s defineSettings looks like this: public function defineSettings ( ) { return [ 'json_data' =...
3
votes
1answer
103 views

How can I make my custom FieldType show up in an element index?

I've built a custom FieldType, and I'd like editors to be able to add any fields using this FieldType to element indexes. Unfortunately, fields using my custom FieldType aren't included in the list of ...
1
vote
1answer
148 views

map values from checkbox field into category field using SQL

In a project I have a checkbox field called gradeLevels with 3 options (k-5,6-8, and 9-12). Due to design changes, I need to convert this field into a category field. I've made a new category with ...
2
votes
2answers
136 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
0answers
45 views

The fieldtype class “insert fieldtype class here” could not be found

I'm specifically having this issue with Sprout SEO, but I would imagine the problem would persist across any plugin, given whatever solution is used. Anywho, so I've got three environments - dev, ...
3
votes
1answer
331 views

How do I add a value to a tag field type using the entries service saveEntry method?

I am updating an entry using the entries service, I want to add a tag value into a tag field type (classifiedTags). $entry = craft()->entries->getEntryById(120); $entry->getContent()->...
2
votes
1answer
132 views

Odd error message when editing field settings (Variable “targetLocaleFieldHtml” does not exist)

After upgrading a site from 2.4.x to 2.6.x, I'm experiencing an odd issue where Craft throws the following template error whenever I attempt to edit a field: Variable "targetLocaleFieldHtml" does not ...
3
votes
2answers
49 views

Which string identifiers for field types do exist?

There are several enum classes containing constants such as the SectionType class which I can use to create sections: // … $section = new SectionModel(); $section->type = SectionType::Single; // ...
2
votes
1answer
60 views

Venti fieldtype bug [closed]

I've added a Venti fieldtype to an entry and when I try to save it as an all-day event it says Couldn't save entry Start Date and time must be set. End Date and time must be set. Help appreciated!
1
vote
1answer
290 views

Using elementSelect for third-party elements

I'm writing plugin to extend Craft Commerce and I want to present a good way to select products in CP. I know I could use dropdown select for this, but using Craft's elementSelect would make the UI ...