People who code: we want your input. Take the Survey

Questions tagged [custom-field]

The tag has no usage guidance.

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

How do I set the value of a custom entries order field from a plugin?

I'm trying to set the value of a custom field on an order when saving an entry. I found an example of how to do this for a simple text field, but the field I'm trying to set is an entries field, not ...
1
vote
0answers
52 views

Filter conditions on related UserModel in custom Record

My plugin has a custom ResponseRecord with relations to a UserRecord and ElementRecord as follows: public function defineRelations() { return array( 'user' => array(static::BELONGS_TO,...
1
vote
1answer
450 views

Failed to add a custom field in settings

I'm trying to add a global set, with a Matrix and two required fields for a product. This always works. Now that I am in version 2.6.2791 it fails to add the fields with error: Warning</b> : ...
1
vote
1answer
772 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. ...
3
votes
1answer
1k views

Display custom product field in cart

How would I access a custom product field in the cart. I did it with the snapshot attribute like so: {# cart.html #} {% for item in cart.lineItems %} {{ craft.commerce.products.id(item.snapshot....
3
votes
1answer
414 views

How is Craft able to reuse fields in different Sections? (As opposed to EE.)

I'm a HUGE fan of Craft, but I'm wondering how specifically it's able to reuse fields in different sections. I'm very accustomed to an ExpressionEngine environment, where each field's shortname has to ...
1
vote
1answer
715 views

Combining custom field filters on craft.entries

I'm building a book store which filters entries based on GET variables. For the most part, this is working well just merging in various filters to a params variable and then passing craft.entries(...
1
vote
1answer
100 views

How to pull out all user data in a template?

I'm trying to pull out user data in a template for specified user profiles whilst the current user is logged in. To do this I check on the userId being referenced and use: {% if userId != currentUser....
0
votes
1answer
569 views

Allow a dropdown custom field to be edit from a front end form

I want users to be able select their own name prefix/title (Mr, Mrs, Dr. etc) as part of front end form that allows them to update their user details. I have created a custom dropdown field and ...
6
votes
1answer
2k views

How can I update custom order fields in the frontend

I am struggling with using additional custom order fields. (Added in the Craft Commerce settings at "order fields", in the field layout manager) I try to update them like this in the checkout process:...
1
vote
1answer
1k 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 ...
1
vote
1answer
299 views

Return entries where custom field partially contains

My entries have a field containing a third-party product id and a price, separated by a hyphen, like so: p666a-12.99 In the template, a plugin is returning me some product ids, and I want to return ...
0
votes
1answer
680 views

How to check custom field not empty within params?

The following returns entries correctly: {% paginate craft.entries.section('sectionName').customField(':notempty:').limit(10) as products %} {% for product in products %} {% include 'incs/...
0
votes
0answers
60 views

Adding extra data to an element

I know questions similar to this have been asked in the past. But I still don't feel like I am getting a full picture so feel there is benefit in asking it again. I want to add extra data to a post ...
2
votes
2answers
459 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 ...
2
votes
2answers
870 views

Add an assets field to a field type plugin template

I have a plugin that creates custom field types to extend crafts default field types. The custom field types hold several different form input fields. For example the field may be called video and ...
3
votes
1answer
560 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 ...
3
votes
2answers
1k views

Craft's Content Table

I'm essentially in the process of learning Craft and in that process have made some great strides. Today I was examining Craft's tables to see how it was actually storing fields created through ...
1
vote
1answer
133 views

Set custom field true email link

I'm working on a website where members can add entries with the frontend form. After creating the entry I want them to change the "status" with custom field by sending them an email link. The link is ...
1
vote
1answer
238 views

How to fill the custom fields of users from the front-end form?

how can i fill custom fields from the front-end form ? https://craftcms.com/docs/templating/user-registration-form
3
votes
1answer
280 views

Can a model or record have conditional requirements?

I have a form that spans two pages, with a required field on both pages and an optional field on both pages: Form A - Page 1 - Question 1 (required) - Question 2 (optional) [User submits partial ...
1
vote
1answer
790 views

customised slugs using custom field

I have a 'Profile' channel that gives the profile of people. I have 'Last name' as the title, 'first name' and I'd like to use first name in the slug rather than have to add the first name to the ...
0
votes
0answers
40 views

Display only those entries that have assets [duplicate]

I'm trying to get a list of entries that have at least one asset in it (standard assets field) called "assets". {% for entry in craft.entries.section('banks').first.assets.filename(':notempty:')....
6
votes
1answer
479 views

Display thumbnail using defineTableAttributes for a custom Element Type

Hi, I'm new to Craft and VERY new to plugin development. I'd like to display a thumbnail image in my table list view and thought it would be possible to accomplish using a new Custom Element Type. ...
1
vote
1answer
387 views

How can I translate checkboxes on a frontend user registration form to lightswitch custom fields?

I've got a frontend user registration form working that's populating a whole set of custom fields I've set up on my user profiles in Craft. But I've got a set of lightswitch fields on my user ...
0
votes
1answer
568 views

Searching members fields [closed]

I'm building a Users search page. I want to search the members group based on the following fields that I've setup for Users: First Name Last Name Company Name (handle: genericCompany, type: Plain ...
0
votes
2answers
151 views

Is there a way of displaying an entry twice depending on postDate and a custom field date in one loop?

I'm building a feed of entries mixed from different sections. One section contains a postDate and a custom field date called releaseDate. I want these entries to appear in the feed with their postDate,...
1
vote
1answer
274 views

Javascript event on save for custom field

I have implemented a custom field type. Is there any way to register a javascript event handler that is called before my custom field is saved?
1
vote
1answer
271 views

Why won't the values of an editableTableField show up in my template?

I'm still trying to process my csv data as mentioned in a former question. But I'm struggling with another part of this right now. I decided to implement a custom field type which should display the ...
12
votes
1answer
2k views

How to add custom user fields to the front end registration page

This question is similar to this post, but more of the next logical step. I have added custom fields to my user profiles, but would like these attributes to be part of the registration page. For ...
5
votes
1answer
217 views

Entry with many fields vs plugin/custom data structure

i'm just getting my feet wet with craft and would appreciate some pointers. Basically, what i would like to do is show and compare products. Each product will have a description, price, review, and ...
3
votes
1answer
453 views

How does a plugin make use of Craft's storage?

I am building a plugin that needs to cache generated images into a directory in Craft, presumably the craft/storage directory. I took a glance in the docs, but couldn't find much in the form of how to ...
2
votes
1answer
1k views

Using the required field validation in custom element types/plugins?

I am finishing up the last few details on my custom element type. I have custom statuses and public submissions working. The last detail is providing validation on custom fields set through the field ...
5
votes
2answers
587 views

How can I limit a list based on a custom date field

I a trying to display a simple event listing. I set up a custom date field called eventDate to note when the event happens. This code delivers me the list of events sorted by eventDate: {% for ...
7
votes
2answers
824 views

Best way to use custom enums in my plugin templates?

I am building a plugin that's uses an enum for custom statuses. The statuses are integrated within my plugin with the exception of changing the status in my template code. pluginname/enums/...
5
votes
1answer
697 views

“Excerpt” option in Redactor?

I love using the excerpt option in Wygwam (CKEditor). I've looked high and low but as of yet, have been unable to find a way to have an exceprt show short of having a whole second field. I have seen a ...
9
votes
2answers
998 views

Is it possible to output the name of a Matrix Block?

I'd like to output the Names of Matrix Blocks. I know you can filter by block types e.g. {% for block in entry.myMatrixField.type('text, heading') %} {% if block.type == "heading" %} <h3>{{ ...

1
2