Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [custom-field]

The tag has no usage guidance.

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

Save field value After Complete Order

I am using Craft Commerce and want to edit the order after it has been completed by the customer. For this I am using the EVENT_AFTER_COMPLETE_ORDER event. Event::on( Order::class, ...
Matthias's user avatar
  • 301
1 vote
1 answer
51 views

Find all Users with a Custom Field Value in a Plugin

Spent a good amount of time trying to return all Users that match a custom field value. Reading the docs here, it shows a findAll() command. However, when trying the code below, it's not working. use ...
Dario Zadro's user avatar
0 votes
0 answers
31 views

Can't reference custom field in Section's Entry URI Format

Craft 3.7.33 I've got a channel Section called "Stories", and a plain text custom field, subTitle, which I want to use in the Entry URI Format. Right now, that is stories/{slug}. When I ...
Sandwich's user avatar
  • 636
1 vote
2 answers
200 views

Can't access values in Typed Link Field

I'm using this plugin/fieldtype https://github.com/sebastian-lenz/craft-linkfield v1.0.25 on Craft 3.7.61. When I try to output some of its values, for example: {{ item.button.getUrl() }} I get no ...
4midori's user avatar
  • 656
1 vote
1 answer
107 views

Get custom fields data on GraphQL

I have several custom fields on craftcms (cp/settings/fields), and some of them are dropdowns. I'm trying to get this custom fields data (for example the dropdown options) on graphql, because we are ...
Nairo Granados's user avatar
0 votes
0 answers
113 views

How to modify a custom field on cart, when the cart is created

I want to set a custom field on shopping cart when I first retrieve it. https://craftcms.com/docs/commerce/4.x/extend/events.html#modifycartinfo sounds appropriate so I tried doing this: Event::on( ...
kindoflike's user avatar
0 votes
0 answers
101 views

How make custom order fields required with "event_define_rules" like a required address fields?

I want to make a craft commerce custom order field required (server side). I already use this for require the default address fields. But how to add custom fields? Because this is done on the Address ...
Maarten Heideman's user avatar
1 vote
1 answer
180 views

Add custom field value to Commerce Order Confirmation E-Mail

in my confirmation e-mail i output all ordered items. now i want to add a custom field (the article number) from a product, but it does not show up. i show items like this: {% for item in order....
Henrik's user avatar
  • 425
2 votes
1 answer
236 views

Can I change a user field with twig without using a form?

I basically just want to set the value of a users field to a different number if something happens, so that the user field is actually updated in the CMS. Can I do that without creating a form? So ...
Keatyn Garton's user avatar
2 votes
1 answer
136 views

How to validate custom field duplication on Front end form

I am working on the Entry Form for a shop entry (Channel section type). For the shop entry, there is one custom field named "businessNumber" that must be unique. All shop entries in a single ...
Apple's user avatar
  • 23
1 vote
1 answer
93 views

Get field settings of custom field via ElementInterface

It is possible to get the field settings via ElementInterface in normalizeValue Method ? I need these settings of my custom field from my plugin : how i can get now these values inside normalizeValue ...
antdev's user avatar
  • 137
1 vote
1 answer
278 views

How do I get custom fields of User on graphQL?

I am wanting to fetch queries for custom fields of users, how would I go about doing that? So if I did something like this: query { users { id firstName lastName email photo { ...
Keatyn Garton's user avatar
5 votes
1 answer
298 views

Is there a way to re-use field groups/layouts?

Coming from Wordpress and using ACF plugin...it's really nice to be able to have say a field group called "SEO Fields" that contains all the custom fields for SEO needs (title, description, ...
kevindeleon's user avatar
1 vote
1 answer
144 views

Countries Field for Freeform

The Freeform docs say there is a predefined option for Countries, but I do not see it anywhere in the Field types or existing fields. How does one access this? Using the latest version of both Craft ...
Roi Agneta's user avatar
  • 1,463
1 vote
0 answers
57 views

Craft 3 entry.author.getPhoto() is coming up null on template, but the author has a photo uploaded in the user > details section, any ideas why?

The site is utilizing a Servd bucket to store all assets. The backend shows a photo successfully uploaded to the user > details section, but does not provide a url in the entry.author.getPhoto(), ...
user11767's user avatar
1 vote
1 answer
62 views

Structure Navigation with 3 possible Link Types using Nav tag

I'd like to build a Structure that can be used to output the main site navigation; each "entry" in the Structure would have three custom fields (types): Category, Entries, URL This question ...
doctorgloom's user avatar
1 vote
1 answer
126 views

Commerce element query on custom field in console command

I'm on Craft 3.4.30 (latest 3.4) and Commerce 2.2.25 (latest 2.2): My product type "ticket" has a custom date field with handle productStartDate. E.g. the following query in TWIG works: {% ...
Matthias Redl-Mann's user avatar
1 vote
1 answer
390 views

How to set the value of a Date field from PHP?

I'd like to set the value of a Date field from my custom PHP code. How can this be made? Which format does the Date field expect when using the setValue() function?
DaveFX's user avatar
  • 113
1 vote
2 answers
366 views

Creating a custom, "multiple dates picker" field

We're migrating* a website that uses http://dubrox.github.io/Multiple-Dates-Picker-for-jQuery-UI/ to store any combination of dates for an entry... (eg not just a single date or date range, can be ...
James Greig's user avatar
3 votes
1 answer
108 views

Use own/custom field inside Craft Table

I made my own, fairly simple field inside a Module for Craft 3.x. What settings do i need to define to make it usable inside a table?
Leonardo's user avatar
  • 471
1 vote
1 answer
32 views

Trying to create a new field returns "General Error: 1030 Got error 1 from storage engine"

I recently updated the site to 3.5.5, so not sure if this has anything to do with it. It's been a while since the last field we created, so can not say for sure if this is correlated. Database on this ...
flannel's user avatar
  • 21
1 vote
0 answers
42 views

Show parents of entry in custom entries field extending BaseRelationField

The default BaseRelationField shows only the name of the selected entry in the field (e.g. "SubEntryX"). I created a custom entries field by extending the BaseRelationField in a module. Now ...
Bobby's user avatar
  • 11
1 vote
1 answer
356 views

How can retrieve users custom fields only?

I have created fields for users and also entry type. I want to get only users fields. I have retrieved custom fields but that returns all the fields. $users = \craft\elements\User::find()->id(...
Amit Senjaliya's user avatar
1 vote
1 answer
184 views

Normalize then validate unique entry in a custom module field

I have a custom text field in a module that the user populate with an EAN number. The input is getting validate by a "match" validator and then is serialized before save to get ride of the various ...
scandella's user avatar
1 vote
0 answers
49 views

Cannot get asset from custom user field, with no-admin account

I would like to get a file of custom user field, which is "asset", and provide a link to the file for the user. However, the asset file cannot be gotten. The length of the asset field is zero. In ...
Kota.M's user avatar
  • 423
1 vote
1 answer
517 views

Custom field plugin: Unable to find template / General custom field plugin information

I am still relatively new to Craft CMS. I am trying to make a custom field plugin for Craft 3 but I am struggling to understand why I can't render my form template. The fieldtype should render a map ...
ves's user avatar
  • 117
2 votes
1 answer
1k views

Entries search query by 2 custom fields

So I have a Entry type that has two custom fields on it. Both fields are integer fields. I'd like to make a query in PHP that gets the entries by two custom fields, both of which are integer values. ...
aaron.cimolini's user avatar
1 vote
1 answer
192 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 ...
good_afternoon's user avatar
1 vote
0 answers
60 views

Customer (Member) Profile Page

I have a site where I'd like customers to login and be immediately presented with their profile page (and ONLY their profile page). On this page they can: 1. See progress reports on their jobs (...
Martin's user avatar
  • 1,203
2 votes
1 answer
350 views

How can additional custom fields be added to the Sites settings?

In Craft 3 Sites, there are some default fields like language, handle, etc. I would like to add additional fields. Is this possible. Specifically, I want to add an Image field so we can add a flag ...
Laurence Cope's user avatar
1 vote
2 answers
627 views

how to search for entries where a custom field is either not present or is empty

Some of my entries have the optional plaintext field myCustomField. I want to retrieve all entries except those where myCustomField is filled out. I can get all entries that have an empty ...
henry's user avatar
  • 228
0 votes
1 answer
202 views

For loop through custom field in JavaScript

I'm using a script to animate four sets of numbers on a page. I would like the numbers to be editable from within the admin (a SuperTable field). Currently I have this: <ul class="counters"> ...
Martin's user avatar
  • 1,203
1 vote
0 answers
134 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 ...
Luke's user avatar
  • 521
3 votes
2 answers
765 views

How to store custom data into a user

I need some direction in how to store (complex) data into users (best practice) I'm working on a project for a fitness app. I created a structure with 2 levels for workouts where level 1 entries are ...
Kevon's user avatar
  • 160
3 votes
1 answer
33 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/...
Dean Sanderson's user avatar
2 votes
1 answer
237 views

saving user field type custom field - Failed to set unsafe attribute

I have tried to save a custom field of "user field" type which resulted in this error. "Failed to set unsafe attribute" code: $order->setAttributes(array( 'operatorUid' => Craft::$app-&...
ravos's user avatar
  • 21
1 vote
2 answers
2k 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 ...
yu xia's user avatar
  • 397
0 votes
1 answer
675 views

Get custom field value on entries.onBeforeSaveEntry event

I am trying to get a custom field value on entries.onBeforeSaveEntry, event. So I can perform some action depending on the value of that field. craft()->on('entries.onBeforeSaveEntry', function(...
Jahanzeb Khan's user avatar
1 vote
1 answer
135 views

Solspace Calendar: custom fields not outputting

I'm unable to get custom fields to output using Solspace Calendar on Craft3. I am not getting any errors indicating that the field does not exist, it's just not outputting. The field is a Redactor ...
Vaughn D. Taylor's user avatar
2 votes
2 answers
1k 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 ...
user6999's user avatar
  • 157
2 votes
2 answers
401 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/...
someguy's user avatar
  • 21
1 vote
2 answers
249 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::...
matthew's user avatar
  • 333
1 vote
1 answer
125 views

Add Checked Attribute to Custom User Fields on Frontend User Form

I have a multi-select for users to sign up for newsletters. When they edit their profile they need to be able to see which newsletters they are already signed up for. I have the code to output the ...
Chattervast's user avatar
3 votes
3 answers
1k views

Option and notes fields after cart at checkout for order, not just line items

My client has gift wrapping services but they apply to the entire order, not one single line item. How would I add notes or custom fields to the entire order, at the shipping stage of checkout? is ...
ToddPadwick's user avatar
1 vote
1 answer
464 views

Filter products by custom boolean field

I'm working on a online store website and we need a filter to hide some products based on the country. I created a lightswitch field called "Hide in Europe" (default false) and added it to the ...
karinegomes's user avatar
0 votes
1 answer
384 views

Add fields/custom fields to page in the admin page (backend)

following situation: let's assume I have page with some ARTICLES (textfields): Article1, Article2, Article3, etc.. Now is there a module for CraftCMS that I can add textfields (articles) to a page ...
muco's user avatar
  • 1
1 vote
1 answer
207 views

How to check for a value OR NULL on custom enddate field using yii syntax when calling entries?

I have a section of 'deals/coupons' with custom startDate and endDate. These are needed so the client can load up a bunch of deals but only have them render to the page when a particular deal is '...
FattyBeardFace's user avatar
0 votes
1 answer
308 views

Anyway to programmatically add default fields to a layout?

So I've been building my plugin to import product listings directly from Salesforce. So far I've been making progress. However, I've approached another roadblock and I was wondering how I would ...
Chris Fam's user avatar
1 vote
1 answer
3k views

How to save a new entry with custom fields - Craft 3

I'm trying to create a new Entry via PHP, with custom fields (Craft 3). I can save it, however my custom fields don't appear. I've tried using setFieldValue, as well as $entry->excerpt = 'Lorem...';...
SteveEdson's user avatar
1 vote
2 answers
1k views

Create custom field to input canonical url in a page

What is the best way of creating a custom field for each page whereby the user can input a URL into a field, which then gets input into a rel=canonical element like the example below. <link rel="...
Gazz's user avatar
  • 111