Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [custom-fieldtype]

The tag has no usage guidance.

1
vote
0answers
19 views

Element type vs. Field type - or: Element type without database storage?

I have already searched for information on this topic but I did not find much. I hope I did not overlook something. My problem is the following: I want to try to write a plugin that lists entries ...
1
vote
1answer
14 views

Saving a “craft-linkfield” field via an entry form

I'm editing an entry via an entry form as documented here: https://docs.craftcms.com/v3/dev/examples/entry-form.html How would I be able to save a link field that's using https://github.com/sebastian-...
0
votes
0answers
11 views

How to prevent Craft Admin from displaying “Leave site?” message for custom fields

I'm using custom fields provided by a Craft 3 Module to provide some Javascript-based functionality in the Craft Admin, and it includes some form elements, but the values of those form elements are ...
3
votes
1answer
21 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
24 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 ...
0
votes
0answers
26 views

Custom plugin: asset fieldtype

I have a custom plugin that uses a custom field leveraging the elementSelect fieldtype to select an asset (which is then processed on submission via a custom service). However, when I select an asset ...
0
votes
1answer
24 views

Custom Plugin Field Using Wrong Template Path

I'm trying to build a simple dropdown field with a pre-populated set of options, so I figured I'd just import most of the methods from Craft's native Dropdown field. The plugin name is siteutilities ...
1
vote
2answers
31 views

Assets metadata: Matrix required?

I'd like to add very basic metadata to assets (Alttext, Caption..) I noticed in volumes you can add custom field types – but they're not appearing when editing the entry. I found it can be edited in ...
2
votes
1answer
44 views

How to query entries by field values

I have some entries with a multi-select field called "gallery". We can choose many images to this field. I have a given image, how can I query entries whose "gallery" contains this given image? Thx! ...
1
vote
0answers
18 views

Get Entries with a specified. Custom FieldType

I have created a Custom FieldType with AttributeType::Mixed The field actually saves the a Custom Model I created. I'm trying to retrieve all the entries that have my custom model as the field. I'm ...
1
vote
1answer
25 views

Input Tags Template for my Custom FieldType

I created a custom FieldType that gathers data from 2 different Models. I was able to successfully display it as a Drop Down. My problem now is that there are tooo many records on my array and I would ...
1
vote
1answer
35 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 ...
1
vote
0answers
38 views

How do you query entries by field value for multi-select field type? [duplicate]

I am looking to query entries by a field value. The value will be a dynamic variable but i cannot get any results showing with hardcoded state. This is the code i have so far: $entries = Entry::...
1
vote
2answers
124 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
48 views

Plugin field-type not getting javascript variable?

Updating a plugin from Craft 2 to Craft 3, so this logic used to work. The plugin has a field-type which is a button. When clicked, the button does stuff depending upon another field. That handle(ID) ...
1
vote
1answer
19 views

Unable to render a plugin template

Creating a plugin that contains a custom field. I need to have some custom html for the settings of the field. I have the following in my field class: /** * @inheritdoc */ public function ...
0
votes
1answer
30 views

What is $source and $sources in BaseRelationField?

I see the following in BaseRelationField: public function settingsAttributes(): array { $attributes = parent::settingsAttributes(); $attributes[] = 'sources'; $attributes[] = 'source'; ...
1
vote
2answers
71 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 ...
2
votes
2answers
174 views

Adding Columns to a table

Is there a way or a plugin that allows you to add columns and change columns heading from within the entry? Instead of defining column heading while creating the table field. It would be nice to have ...
1
vote
1answer
21 views

Getting `modifyUserSortableAttributes` to work during plugin development

I have a plugin that is creating a custom field. I am using the modifyUserSortableAttributes method to make my field appear in the columns available for the Users Table and wanted to be able to sort ...
1
vote
1answer
256 views

Use a custom field type in Matrix Blocks - Craft 3

I'd like to create a field of type Dropdown/Table (or even use a field from a plugin like color-swatches) and have it available when selecting a matrix block element field type: In this case, it's ...
1
vote
0answers
56 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 ...
2
votes
2answers
55 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
2answers
160 views

Retrieve entries on custom field date using ElementCriteriaModel

I am trying to retrieve an array of entries on a particular section where inspectionDate is greater than today's date. Here is the code. $criteria = craft()->elements->getCriteria(ElementType::...
0
votes
0answers
29 views

if products related to entry in product entry field, else products related to type

I have an entry field in each of my products that have an entry assigned to them. These are designers that are linked to each product. I also have product types. For each product, I want to show ...
1
vote
1answer
390 views

Creating a Custom Field Type with nested Fields [duplicate]

I'm just wondering is it possible to have nested Fields inside of a Custom Field type. So if I create a custom Field type. I wish for it to contain all of the following. So it will contain multiple ...
2
votes
0answers
68 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....
1
vote
1answer
64 views

Using data within a mixed attribute type to query Craft entries dates

I wish to have a custom fieldtype which contains the standard datetime field abilities along with storing an extra piece of data. I have created a custom fieldtype for this with a mixed attributetype ...
0
votes
1answer
123 views

Get owner entry from fieldtype

I have a custom fieldtype (used within Neo block) and I need to know the ID/content of entry it belongs to, when editing the entry. I need to both populate field values based on value in other field (...
1
vote
1answer
193 views

Filtering values from Twig for my custom field type

I have a custom fieldtype for Craft which stores its value as an array of Models using AttributeType::Mixed. See below for an example of the FieldType and Model setup class MyCustomFieldType extends ...
1
vote
1answer
45 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
410 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 ...
3
votes
0answers
48 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 ...
4
votes
1answer
80 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' =...
1
vote
1answer
40 views

How should a multi-stage editorial process be implemented in Craft?

I'm building an editorial system on Craft which has 6-8 editorial stages, such as Assignment, Initial Proofing, Secondary Proofing, etc. It seems that the simplest solution would be to have the ...
3
votes
1answer
77 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 ...
3
votes
1answer
50 views

How can I specify what happens when someone calls my fieldtype without any further dot chains?

So, I'm in the process of building a fieldtype, and I'd like to output an HTML element and some javascript when a developer calls my plugin like this: {{ entry.fieldtypeHandle }} The field returns ...
1
vote
1answer
518 views

Form field validation

I am relatively new to Craft CMS and have been using the formBuilder2 plugin to create forms. No problem this far. I have been able to use ElementApi to output the forms into Json. Still no problem. ...
1
vote
1answer
229 views

CKEditor fieldtype overlaying redactor

I've created a Fieldtype to use CK Editor so can take advantage of the advanced table formatting options over Redactor. However I want to keep Redactor for other content management. I came across this ...
3
votes
2answers
682 views

Populating tables and matrix fields using GuestEntries

Is it possible to populate a Matrix Field, Table and Lightbox using the GuestEntries plugin from an HTML form? I'm trying to build an RSVP form, and am not having a lot of luck with different field ...
-1
votes
2answers
106 views

Custom fieldtype plugin

Any thoughts or tips on debugging a custom fieldtype plugin not showing up in Settings > Plugins? Code base up at http://cl.ly/2E0m3Y2Z2R00
4
votes
1answer
153 views

Why does field value get updated on $element->getContent()->fieldHandle but not when accessed directly $element->fieldHandle?

I am trying to update a custom field on an EntryModel. I'm having half success, and I don't understand why. I've looked at other posts such as this one by Brandon which discuss how to assign these ...
2
votes
0answers
87 views

How can I make a SmartMap field required on a user profile page?

I am using Craft 2.5 (Beta) along with the fantastic SmartMap plugin. I have a user registration page that I am using the SmartMap field with like this: twig ... <div class="form-group has-...
1
vote
1answer
84 views

Is it possible to target a fieldtype by it's Type name, rather than the handle name?

I've created an Asset Source and assigned my own field via the field layout. Then, I created an Assets Field to display a single image on a page. Using my plugins twig extension I can query the ...
1
vote
1answer
84 views

How to set url of delete button of editableTableField?

As title says, I have a URL which I need to call when someone clicks on delete button. I already have a primary key which I need to set and append in delete URL. How'd I do that? Update Rows are ...
1
vote
1answer
921 views

How to fetch entries based on contents of several custom fields?

I'm currently doing something like this: {% set vars = "foo, bar" %} {% set entries1 = craft.entries.section('sectionName').customField1(vars).limit(NULL) %} {% for entry in entries1 %} {% if ...
0
votes
0answers
80 views

Issue with external JS when toggling between entry types

I'm working on a custom plugin / fieldtype, and it requires first an external JS library, and then it needs to be initialized in-page. I.e: <script src="//remote.path.to/my_script.js"></...
4
votes
1answer
191 views

Are there callbacks for elementSelect macro?

I am writing a custom field type that makes use of Craft's asset selector, and saw that there is an elementSelector macro (in includes/_forms). I want to be able to do some things onSelect, but I ...
2
votes
1answer
655 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 ...
0
votes
1answer
51 views

How can I let JS UI building to field type plugin?

I want to use like owl carousel JS UI in front. Here's carousel a link! It has some option can setting. I want to create a own fields type in admin, can setting this option and show this UI in ...