Questions tagged [field]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
611 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 ...
1
vote
1answer
175 views

Global-only fields adding columns to content table?

I understand the rationale of adding one column per custom field to the craft_content table in the database; but why would this happen for fields that are only used once globally? Is there a way to ...
4
votes
1answer
206 views

Entries retain field data that has been removed from entry type layout

I have a single page section titled "About". At one point, I had assigned a "text" Rich Text field to the entry type layout. I then put some filler text in this field and saved the entry. Later I ...
0
votes
1answer
221 views

Assets Content/Fields not available until entry is saved?

I've got Asset location setup with a Photo Caption field. And a Photo Gallery field which references said Asset. When creating a new entry, I'm uploading images to the Photo Gallery field. When the ...
2
votes
1answer
1k views

Set site locale to display correct date format in date/time field

The date field is displaying dates in US format (mm/dd/yyyy) but I need the UK (dd/mm/yyyy) format. According to the docs: Dates and times are both formatted for the user’s preferred locale. They ...
1
vote
1answer
1k views

How to get a list of fields on an entry

How do you get a list of the fields that are on an entry? I tried {{ dump(entry.subentry) }} but that isn't any help ...
2
votes
1answer
80 views

Page breaks when editing a field

I'm suddenly having issues with multiple Craft builds on my local dev environment. Basically, everything else is working fine but when I edit a field the page breaks. It appears to only be displaying ...
1
vote
1answer
956 views

How do you output the value of a checkbox item?

Seems like it should be simple but it's not working for me. {% for option in entry.contributionType %} <li> {{ option.value }} </li> {% endfor %} This code outputs the option's ...
2
votes
1answer
876 views

Displaying a list of fields in a form select

In a plugin's settings view, I'm looking to show a list of fields to choose from: {% set fields = craft.fields.getAllFields() %} {{ forms.selectField({ label: 'Salary Mapping'|t, ...
2
votes
1answer
412 views

How to process CSV files within a Matrix field?

I'm trying to import and process CSV data within a matrix field. My situation is the following: I have a matrix field with one block and several fields inside. One of these is an asset field to ...
1
vote
1answer
262 views

Is it possible to define a 'richtext' fieldtype as 'MEDIUMTEXT' in DB?

Some articles are very long and getting cut off when saved to the database. Is it possible to define a 'richtext' fieldtype as 'MEDIUMTEXT', or would I have to write a plugin to replicate the '...
4
votes
2answers
1k views

How do I find the closest parent entry with an Assets field filled in?

I have a structure that goes up to 4 levels deep. Each page has a field for a 'hero' image. If a child page does not have this field filled out I would like to traverse up the structure and find the ...
1
vote
1answer
385 views

Front end edit required asset

Since file inputs are not allowd to be pre-populated, how do i tell craft that a required asset field is already filled in the front end edit form? Can’t seem to figure this one out. Edit: Users can ...
1
vote
1answer
329 views

Required fields in the user profile

how to make required plane text fields or required firsrtName and lastName fields in users profile? I want to during the registration and profile changes were required. Maybe there is any plugin for ...
1
vote
3answers
191 views

How to use required fields on localised entries?

I'm building a multi-lingual site and have found Craft's locales / translatable fields useful for setting up structures where each page will have a translated version. However, for at least one of the ...
3
votes
1answer
1k views

How to clear the database of unused fields?

I have one section with different entry types. One entry type uses two matrix fields, another one only one, and so on. Since the frontend layout is always the same, I use one template for the whole ...
1
vote
2answers
616 views

Plain text field - apostrophes are getting escaped

I have a plain text field in Craft and the content has an apostrophe. On the front end, the apostrophe gets turned into &#039; Not ideal! Thanks in advance..
11
votes
1answer
6k views

How to display all fields belonging to current entry?

How do I modify a template to include a loop that displays all custom fields that I added to the field group that the current entry belongs through? I know how to display the fields individually by ...
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 ...
0
votes
2answers
939 views

Entry field not outputting after {% set… %} code in template

I have an {entry.footer} field outputting just fine everywhere before {% set entry... %} Added {% endset %} tags after closing anchor tag and caused an error. Any idea what the issue is? {% extends "...
2
votes
1answer
526 views

Matrix fields within a plugin?

I'm just starting to explore the whole power of Craft and I'm really satisfied with its possibilities so far. But I can't get one thing done, so here's my question: Is it possible to use matrix ...
1
vote
1answer
437 views

Rich Text Field Adding Tags around script

I'm trying to add some embed code/script and the rich text field on save puts misc <p> tags around my code. How do I save code so it keeps it's code formatting without adding an extra stuff?
5
votes
1answer
210 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 ...
5
votes
1answer
1k views

How do I output a dropdown's values if I'm on a registration form not tied to an entry?

I have a registration form on my website. All of the fields here so far have been text, which is no problem. However, I've just been asked to create a dropdown box for users to select their salutation ...
5
votes
2answers
1k views

Restricting access to fields based on user group

I saw this thread Check user is in User Group / Custom User Permissions had an idea. Can I use USER group to limit who can see the Author dropdown on the entries form? Is this even permitted the craft ...
2
votes
2answers
514 views

How to only show translated fields in an additional locale?

I'm using the localisation feature for the first time, and I'm not sure if I understand its rationale. On a site with entries that have multiple fields, I only have the main body text set up for ...
6
votes
1answer
2k views

Get dropdown / checkbox / multiselect field values on frontend submit

I would like to allow registered users to submit entries to sections. The documentation didn't mention how to get the values and labels of dropdown / checkbox / multiselect fields to show them as ...
3
votes
2answers
1k views

Getting “Internal Server Error: Function 'dump' does not exist” when accessing/creating custom fields

On my in-development version of a site I'm working on, I'm unable to access any of my custom fields without Craft displaying an error that reads: Internal Server Error Function "dump" does not ...
4
votes
3answers
547 views

Unchecking Rich Text option to clean up HTML still cleaning?

We've unchecked the clean HTML feature on a few rich text fields but our attempts to add some html (span tags) keep getting cleaned out. Is there another setting we should be looking for?
2
votes
1answer
194 views

How do I get the data from a relation field?

If use the following code: $currentEntry = craft()->entries->getEntryById($entryId); $currentContent = $currentEntry->getContent()->getAttributes(); $currentAttributes = array(); $...
17
votes
3answers
3k views

Exporting/Importing Fields

Is there an easy way for Importing/Exporting Fields? I'm just working on a selection of Global fields that I'd like to be able to add for each client site. These would be things like Contact Details, ...
7
votes
4answers
967 views

Matrix field alternative (or easier field grouping)

Just started working with Craft, and it's been great! One question I have is regarding the 'correct' way to create a group of fields, rather than using Matrix or Table. To better illustrate, see the ...
2
votes
1answer
737 views

Can you add duplicates fields in a structured section's GUI?

Is there a way to duplicate fields when creating "structures" in the visual editor. If I wanted to add four simple textfields, it appears I can't just drag-and-drop four textfields in and give them ...
8
votes
2answers
506 views

Is there any way of specifying a default category for a category field?

I've set up a channel using categories to distinguish between different blog post types. The majority will probably be in one category, so it would be great to be able to specify a default category. ...
5
votes
1answer
1k views

How can I limit the rows returned in a table field?

I want to limit the rows returned here to 4, then if loop.index is 3 display a separator and then output the last row. Does the table field have that kind of control? {% for row in registration....
10
votes
2answers
2k views

How to add more options to the 'Restrict allowed file types' settings?

I am wondering what would be the best approach to add another file type to the 'Restrict allowed file types' asset field settings? For our website specification we need to have .zip files and .pdf ...
2
votes
1answer
2k views

Checking if a matrix field with entries has more than one entry

In my HTML-prototype I have two ways of showing a module of employees. One version shows one employee, and the other shows two. To build this in Craft I have setup a Matrix field (with a handle ...
4
votes
2answers
800 views

How to use a global variable in a conditional statement if an entries relation field is empty?

{% if entry.fieldHandle %} {{ entry.fieldHandle}} {% else %} {{ global.fieldHandle}} {% endif %} Doesn't seem to be rendering for me. The entry field shows up when it's true, but the global field ...
4
votes
1answer
116 views

How can I test if a field has been assigned to a channel?

I've got a generic template that can display entries from different channels. How in the template can I test if a field has been has been assigned to any given channel?
13
votes
2answers
1k views

How do we create a pre-defined Asset upload field in a plugin that integrates with the native Craft Assets file manager?

We've got a plugin. It doesn't have the ability to add custom field types. We're pre-defining all of the fields. One of the fields needs to be an Asset field. A user should be able to upload an ...
5
votes
1answer
252 views

Is there a way to hide Matrix blocks based on the Selected Entry Type?

I have 2 primary entry types, one for a full width page, and one for a sidebar page. The sidebar page shares about 90% of the same block types as the full width page. The other 10% do not apply to ...
11
votes
2answers
444 views

Will having large numbers of Fields decrease site performance?

I know that on page load Craft makes multiple queries to get Fields. I have about 300 separate fields on a pretty large site. I know it's probably better to reuse fields when I can, but in many cases ...
8
votes
1answer
743 views

How do I maintain the on value with a lightswitch-field as a plugin setting?

I'm trying to use a lightswitch-field in a plugin-config. But for some reason it won't get saved. The lightswitch-field is always off. protected function defineSettings() { return array( ....
5
votes
2answers
416 views

Is there a way to populate a drop-down with the templates files in a folder?

When I have a folder setup for template partials, is there a way I could automatically populate a drop-down with the list of templates in that folder? This would be useful in the case where I have a ...

1 2 3 4
5