Questions tagged [fieldtypes]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
300 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 ...
5
votes
2answers
401 views

List of reserved field handles

Is there somewhere documented on what field handles are reserved? Would be great to have this as a resource here, especially for plugin development. Edit: A good place to start would be https://...
1
vote
1answer
666 views

amforms: display form field

I'm trying to output an amform in a template that has been selected from a Form field. From the amform docs, it says: {{ craft.amForms.displayForm('formHandle') }} My matrix fieldname is called ...
0
votes
1answer
214 views

How can I get the correct label of a dropdown that has matching values?

I have a drop-down field in the CP - It represents a range of numbers that are based either a percent or a fixed number. For example, a choice could be Fixed 5% or a choice could be Variable 5% In ...
1
vote
1answer
440 views

Is it possible to merge entry parameters to create a dynamic field handle?

I'm trying to merge a field name prefix with entry.section to make a dynamic field handle. I'm guessing I'm setting the sectionMatrix variable incorrectly, causing the code to fail without error. Any ...
3
votes
2answers
479 views

Target a certain entry type on the entries fieldtype

I have all of my entries as single pages, but of different types depending on the section. I need to create a field that allows users to link to another page entry, but I need to ensure they only ...
3
votes
1answer
351 views

Resource for setting up Craft CMS Fields

It's a good 7 months after the last time this question was asked. I've been developing sites for a long time, expert with Wordpress, some Drupal, Joomla when forced. I can understand a good part of ...
1
vote
1answer
250 views

Categories on a Front-end form

I have searched the forum and cannot find the answer to my question. I know how to populate a dropdown with the categories that are already in the system, but what happens if the category that needs ...
1
vote
1answer
689 views

Update User “Field Type” for Entry in Plugin

I have a channel called "Groups", with a users field type called members for the entries. I need to be able to add/remove users to the members entry field via plugin. What I've tried is: // criteria ...
2
votes
1answer
176 views

How do I store code in Craft

I need to store Javascript/HTML code in some of our entries. I have tried to put the code in plaintext but cannot get the code to render through twig. I cannot store this stuff on the filesystem. It ...
1
vote
1answer
152 views

Find Dropdown Option Labels That Are Assigned in a Section

I can get a list of option labels available in a dropdown field using the code below. Is there a way to get a list of option labels that have been assigned to entries in a specific section? {% for ...
2
votes
1answer
758 views

Model and its behaviors do not have a method or closure named “optgroup”

I'm attempting to finish my first fieldtype plugin (how exciting!) but having an issue with displaying options in a select dropdown in an entry. My ColumnWidth_WidthsFieldType has this: <?php ...
1
vote
2answers
649 views

Get label from value in radio buttons list fieldtype

Ok I know how to list radio buttons and use it to display a particular value: {% set newsType = craft.fields.getFieldbyHandle('newsType') %} {% for option in newsType.settings.options %} {% if ...
1
vote
1answer
248 views

Use-case: custom plugin or extended use of entries/categories/tags

I have to integrate a jobs feed into our website and I've been digging in the documentation, reading the core's code for a while now, and I am in a dilemma trying to figure out if in out use case I ...
1
vote
1answer
320 views

Craft model and populateModels() performance issue?

I'm getting a big performance hit on front end requests (+15 seconds) when using a model to store / use data from one of my custom fieldtypes, cp requests for the same data appear unaffected. The ...
2
votes
3answers
367 views

Multiple sources on category field type - possible?

We're trying to setup a category field type to allow the selection of 1 category but from multiple category sources. Is there a simple way to achieve this without writing a custom plugin / fieldtype? ...
4
votes
2answers
560 views

Color Picker with “no color” option?

I want let the editor to choose an optional color via the color picker, but this didn't have the option 'no color' (or transparent). Is there a solution to this? I use it a lot and have always to add ...
1
vote
2answers
1k views

How to loop through matrix block fields and pull out handle and content?

Ok this is similar to a previously asked question How to display all fields belonging to current entry? However I'd like to extend this so that it deals with matrix entry types. I have the following ...
4
votes
1answer
429 views

Is it possible to translate the name of a field in the CP?

I have content editors that speaks different languages. Is there a way to translate the name and introduction of a field in the control panel? A simple {{ "value"|t }} seams not to work. Example: ...
2
votes
1answer
37 views

Categories field that allows duplicate values

I have a categories field where I would like to be able to include the same category more than once. Any suggestions on how to do this?
1
vote
0answers
114 views

Custom Drop Down Field Type Validation

I have a custom fieldtype that I have built in a plugin. I want to validate these fields inside of field settings when data is added. I saw there was a getErrors method in the model however I am ...
1
vote
1answer
1k views

Conditional if statement for Matrix dropdown option

Ok, so I've tidied up the code a bit and using option.selected instead of option to see if the option is selected. But, it isn't behaving how I'd expect it: {% for telephone in user.profilePhone.type(...
1
vote
2answers
414 views

Populate or change the selection options in one field based on selected option in another field in the CP

I'm looking to change a select fields options with the onChange event from another select fields chosen option. Obviously this can be done with js on the frontend as per this post but has anyone done ...
3
votes
1answer
153 views

Error: min/max value in number fields

Is there any reason why min/max value are limited to the following? [9999999999999] - Min is too big (maximum is 2147483647) I need to add ISBN numbers which are 13-digits. Is there a reason for ...
3
votes
1answer
549 views

Custom field type that has multiple fields to extend the default field types

Ok scenario that I'd like to create. Create a custom field type lets call it videos. In this field type you would have 5 separate fields title, description, caption, link, thumb. This would make up ...
1
vote
1answer
203 views

Interacting with table fields via plugin

When you set up a table field column through the admin cp, you assign a name and a handle. When I var_dump the table field, all row data is referenced by column number. (e.g. col1, col5, col2, col3, ...
0
votes
1answer
532 views

Link to Global Fields like you can with the entries fieldtype

Is there any way to link to a global using a field in a entry form, much like you would use the "Entries" fieldtype to link to entries?
0
votes
1answer
64 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 "...
0
votes
1answer
173 views

Change field arrangement from the entries page

In ExpressionEngine you can rearrange the field types from inside the entry. I was wondering if there was any feature like this in Craft? I've got a lot of different types of entries so it's a pain to ...
1
vote
1answer
600 views

Getting checkbox options for a new entry, without having an entry

How would I get a list of all the checkbox options associated with a specific field, without having an entry to loop over? I'm using the same form for creating new entries and editing existing ones. ...
2
votes
1answer
996 views

How to populate Category field form frontend form?

I have a frontend form that has a select list for language. This field will allow for one language to be selected. In the backend I have a field set up for my entries as a category field populated by ...
2
votes
1answer
807 views

Limit characters in redactor wysiwyg field

I'm trying to limit the amount of characters by adding the 'limiter' plugin to the redactor field which can be found here: http://imperavi.com/redactor/plugins/limiter/ I've added the limiter.js ...
2
votes
1answer
653 views

Is it possible to create a field group that can be modified across entry types?

Sorry if this is asked/answered elsewhere. I tried to search for it with no success. Suppose I have a common group of fields that I want to include in different entry types, and each entry will have ...
2
votes
1answer
314 views

Found cool example of Header Globals what field type is used for this?

So I was reading an article on craft, and found an example of something I am trying to do. Creating a global for header/footer links etc so they can be managed dynamically. Here is a screenshot of ...
1
vote
1answer
95 views

Use default field type(s) within my plugin

I am just experimenting with plugin development and would like to use the existing dateTime field type. For no other reason than to maintain consistency throughout my application. Is there a way to ...
1
vote
2answers
580 views

Is there any way of distinguishing whether a Date field's “time” is set or not?

Date fields can have an optional "time" box. This works nicely in the admin, but I can't figure out whether there's any way to access date and time separately when accessing that field via a template. ...
4
votes
1answer
4k views

Link to an entry via Entries field type

I am attempting to create a "dynamic" button. By that I mean I want the user to be able to update the text and the target (href) of where the button links to when clicked. So I created fields: ...
1
vote
0answers
129 views

What's the best way to get all content for a field?

Given an array of field IDs, I want to get all content for those fields. So, in this situation: entry 1 field ID 1: 'test' entry 2 field ID 1: 'test test' I want to end up with array('test', '...
1
vote
1answer
391 views

How to change the display of asset fields in the control panel via plugin?

I would like to modify how assets are displayed within asset fields in the control panel's edit entry page, so that thumbnails are larger and the name is not displayed. After some investigation I ...
1
vote
1answer
684 views

Can I set color fields by hex value

Can I set the value of a Color Field to a hex value? Or only if the particular browser's color picker supports this? Maybe this is a feature request: please let us get and set color values in hex.
1
vote
1answer
272 views

How do I get an empty table field type to display on the front-end so a user can update their profile?

I'm building out a front end form that users will use to fill out with their information. Naturally, when a user first signs up, their profile fields are empty and a blank space appears for them to ...
2
votes
1answer
831 views

Field type for selecting a section (channel / structure / single)?

I have a channel for products but in some cases I would like to associate a product with a structure containing documentation and release note pages: http://mysite.com/product/my-product/docs/getting-...
1
vote
1answer
2k views

getting fields of a section (getFields())

I feel like I'm doing this wrong (looping on section fields): {% for fieldLayoutField in craft.entries.section('rentalsBulletin').getEntryTypes().first.getFieldLayout().getFields() %} {% set ...
1
vote
1answer
322 views

FieldType's element attribute is null

I am trying to create a new entry via a form post that will come from a third party, by doing this in my plugin's service class: $entry = EntryModel::populateModel(array( 'sectionId' => 1, ...
5
votes
1answer
99 views

Is there a masked input field type for Craft?

Is there anything like the EE add-on for Craft? This would be really useful for part numbers, etc.
1
vote
1answer
664 views

Linking to Search Results

Ok what i'm trying to achieve is a set of links which have "search parameters" attached to them. Which would be a "category" and an "option.field". Then when these links are clicked they display ...
2
votes
1answer
59 views

Is there a prescribed way to to represent complex field types as strings?

I've found the need lately for a way to represent complex fieldtypes like Matrix, Entries, etc as strings. e.g. in the following plugins: https://github.com/boboldehampsink/auditlog https://github....
7
votes
3answers
2k views

Default field values?

This seems so simple, but after reading over the docs, I couldn't find an answer: Is there a way to have a field have a default value in Craft? In my case, I have a Lightswitch field that I want to ...
6
votes
2answers
2k views

Custom Field Type with Multiple Values

I'd like to create a field type for my plugin called "location" with two text boxes: one that holds a coordinate for latitude, and one for longitude. I haven't figured out yet how to map those two ...
3
votes
1answer
307 views

Plot absolute coordinates / Image map

I have a site where I want to set up a "tour" of a software screenshot, and I need to allow users to select points on an image to insert the tour "stops". Is there an add-on like DevDemon's Entry ...