Questions tagged [field]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
104 views

Email notification on field value change?

Currently, I have the need to get an email notification, only when a particular field(s) have changed value. In my use case, a few light switches. Is there currently any way to get notified of this?
3
votes
1answer
381 views

Cannot select subcategory field in entity

I have a Structure section fruit with a single entry type fruit. I also have a Category fruitType with 2 levels: Citrus Orange Lemon Lime Melons Watermelon Honeydew The entry type fruit has a ...
5
votes
1answer
586 views

Can I add an enabled-by-default lightswitch field to existing entries?

I've created a lightswitch field that defaults to "On", and it works fine for new entries, but for all existing entries it is set to "Off". I'm keen to avoid having to manually go through all existing ...
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 ...
1
vote
1answer
59 views

Default values when using 2 locales

I have a field in a site I'm creating which is weather and uses a TABLE field in order to enter the MONTH, TEMP, RAIN etc etc. Im using 2 locales within the site, EN and FR... Initially I've setup ...
2
votes
0answers
61 views

Return all entry types or entry fields for one entry object [duplicate]

Is there a way to pull out all entry fields for an entry by their handle so they can be looped through? For example rather than doing each field manually like {{ entry.title }}, {{ entry.description }...
2
votes
1answer
734 views

Find entries related to user and display field name

If I’m finding all the entries that are related to a user, how could I get the field handle that the found user is referenced from? {% set events = craft.entries.section('events').relatedTo(user) %} {...
4
votes
1answer
695 views

How to use a Numeric Field with a Default Value

I have a case where I need to use a numeric field which also has a default value. For example: numericField needs to have a minimum value of 100 and a max value of 1000, but when the user adds a new ...
1
vote
1answer
645 views

Using a field multiple times in a single template

we have a problem over and over again and I wonder if we're missing something. Using bootstrap we have a matrix field, let's call it Grid, that has blocks like "full column" "half column" etc. It's ...
2
votes
1answer
68 views

Is it possible to assign fields to entries by category?

I want to show some fields depending in the category selected for the entry but within the editing stage. is it possible? If not, then how can i check if the entry is in a category in the template ...
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
423 views

Environment variable doesn't work in Assets field settings

I created an environment variable (in config/general.php) called {baseAssetPath} which contains the server path to the folder where all my assets are stored. This makes it easier to populate the Path ...
2
votes
1answer
470 views

How can I skip a required field if is not in the form?

The problem is that I have a register page where I have 3 fields, Username, Email, Password. There is another page with some more fields which are required. So when I try to register a user form my ...
3
votes
2answers
839 views

Disable or hide an entry field in the CMS

Is there a way to hide or disable an entry field in the CMS so that the field still exists in the database but can not be edited by a user. The field will only ever be altered dynamically from a ...
1
vote
1answer
435 views

How can I add attributes to craft field?

In my template I have this, {{ craft.fields .getFieldByHandle('ethnicOrigin') .getFieldType() .getInputHtml( 'fields[ethnicOrigin]', '') | raw }} which returns me a <select> ...
2
votes
2answers
1k views

How do you wrap text with HTML within a Plain Text field?

I have a Plain Text field used for product names. Some of these product names have a Registration Mark or a Trademark, which needs to be formatted within a superscript. Here is code within my ...
0
votes
2answers
644 views

How to pull all images in [body] Matrix fields

I'm working on a basic portfolio site wherein each entry or "project" has a body Matrix field with various blocks for various types of images. I'd like to make an index of all projects showing one ...
1
vote
1answer
889 views

Search within Matrix Field

I know there are some similar questions out there but none of the solutions suits my needs. What I'm trying to do is to display some related entries (from another section) within my blog posts. Here ...
2
votes
1answer
994 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 ...
1
vote
2answers
1k views

Matrix loop nesting issue using switch

Anyone know if it's possible to check what the current field is while in a loop of a matrix block? Running into an issue with a matrix block in my loop for how I want to output the content. {% case '...
1
vote
2answers
672 views

Solution to default template with all possible fields and determine position

Banging my head on this one and have not been able to come up with a solution to this. I'm wanting to create a default template for all single entries that checks for all of the fields I have created ...
2
votes
0answers
620 views

Asset dynamic subfolder paths referencing entry section not available until saved

I have an asset field within a matrix block, for which uploads are restricted to a single folder. The upload location path is set to {owner.section.handle}/{owner.slug}. Using this pattern the asset ...
3
votes
2answers
649 views

Creating and using custom content tables

If I want to create fields that get set to a custom content table rather than craft_content how would I do that?
1
vote
0answers
230 views

Get entries using Multi-Select Field as Criteria

When querying for entries, I'm stuck on how to query for "selected" fields. The query I'm using: $criteria = craft()->elements->getCriteria(ElementType::Entry); $criteria->section('athletes'...
1
vote
1answer
243 views

How to create an auxiliary page with sub url?

I have a section where each item has its own URL e.g: news/{slug} The Entry Template for this section is: news/news_detail For each post I would like to have a link to a unique page which is ...
0
votes
1answer
493 views

Frontend Profile - Listing out Radio Buttons

In the official documentation it explains how to let users customize user fields in the frontend, such as: <label for="bio">Bio</label> <textarea id="bio" name="fields[bio]">{{ ...
0
votes
1answer
179 views

Get user field category

I have a matrix that contains a block with a category field. I want to loop over the matrix models, in PHP, to get data. Here's what I have so far: foreach ($user->networksMatrix as $key => $...
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 ...
4
votes
3answers
2k views

Search for entries with matrix field's value

I'm building a travel site containing Campaigns (entries) Each of these campaigns has multiple travel dates, modelled by a matrix field of [startDate, endDate, price] I want to do the following ...
1
vote
1answer
601 views

Is it possible to convert a plain text field to a rich text field, without losing content?

I originally had some content stored in a plain text field but I want to give my co-workers the ability to add anchor links, lists etc.. If I were to change the field type form Plaintext to Rich ...
9
votes
2answers
3k views

“Conditional” field layout - hiding or showing fields based on another field

is it somehow possible to conditionally show or hide fields in the entry editor based on the value of another previously entered field? An example of this use would be: A section has Lightswitch ...
3
votes
2answers
361 views

How to check if entry field value is already outputted, and prevent it again?

For an event page I have the option to filter on cities and countries. Each event has entry fields in which the city and country, of which the values are outputted in a drop down list on the front end....
0
votes
1answer
110 views

content and fields won't show up on new single

I just installed Craft, linked it to my database (localhost) and then created a new single "about" page. But when I go to edit the single, there are no fields. I haven't changed anything else! When I ...
0
votes
2answers
2k views

Getting Attribute for Homepage

I have created a field for the homepage called icon_font. I now want to access that field in my template. What is the best way to do that? Do I have to use a for loop (even though there is only one ...
2
votes
1answer
823 views

Dynamically iterate over a matrix block's fields?

Is there a way to dynamically iterate over a matrix block's fields such that the template doesn't need to know the field handles? This doesn't work: {% for block in entry.myMatrixField %} {% for ...
3
votes
2answers
1k views

Clarification on UID creation

I have a series of matrix blocks that use a ton of the same fields and was hoping I could simply duplicate them in the database and update the context and id of the fields. It'd be a LOT faster this ...
4
votes
1answer
432 views

How do I select a default in the Position Select field?

Just getting around to adding advanced layout features to our site, when I say advanced I just mean floated images left & right. The problem I seem to have though is that left is always the ...
1
vote
1answer
567 views

How can I get a lightswitch to work with order() in craft.entries?

I'm getting mixed results when using a lightswitch field together with order('RAND()') and I wonder if I'm doing something wrong. For example, this code gives me the correct results: craft.entries....
2
votes
1answer
2k views

Can I change TEXT to MEDIUMTEXT/LONGTEXT in database?

I have a text field in my database in which I'm going to index the contents of a PDF file. Right now the database column for that field is defined as "TEXT" but I need more space since my PDF files ...
5
votes
2answers
1k views

Programatically Adding Fields to a Layout

I am looking to add a field (or perhaps a group?) to the userlayout via a database migration. I've looked over the docs, and found Is it possible to add a custom field to User model from a plugin? ...
2
votes
1answer
90 views

Find all empty fields in admin

I'm working with a fairly large data set in one of my channels and I was hoping there was a way maybe in admin to show me all the live entries where certain fields are empty. I want to be able to ...
2
votes
1answer
830 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-...
0
votes
1answer
2k views

Image asset not being displayed

This is my second website I am building with craft cms and I have no prior experience with Twig. I have had a particular issue with echoing image assets from a singles entry. The line I copied from ...
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 ...
0
votes
1answer
498 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 ...
1
vote
1answer
1k views

Fetch values for a single field across all entries in a section

I have a section "Hotel Room" with a field "Sleeps" (number). There is no limit on the values that can be entered. On the frontend I want a list of all existing entered values for this field. So if I ...
3
votes
1answer
610 views

Query for blocks across Block Types using the new field parameter?

This is a great new feature of Craft 2.3: It is now possible to set custom field parameters on Matrix block queries. I was wondering what would happen, if two or more Matrix Block Types had a ...