83 questions
0
votes
1
answer
78
views
apply rel="nofollow" to field in drupal 7
I have content type with name "Product" and there is field name Remote product link and field type is link.
I want to set rel="nofollow" for this field. I am new to drupal and I am ...
0
votes
2
answers
274
views
Cannot get array element by key, but key exists on array
I'm working with Drupal 8, but since this looks like a PHP problem to me, I'm asking it here and not on Drupal Answers.
The isset statement in the following code should return TRUE, but it does not:
...
0
votes
1
answer
64
views
Drupal form design without using associative arrays
How to design Drupal forms without coding a lot?
0
votes
2
answers
1k
views
Drupal 8 - How to enable custom field under manage form display programmatically?
I have created a drupal8 module that programmatically created custom user fields. It display in Manage fields section but not enable/view inside Manage form display and Manage display section.
I have ...
0
votes
1
answer
2k
views
How to create an entity reference field which will allow unlimited values in a configuration form?
public function buildForm(array $form, FormStateInterface $form_state) {
$form = parent::buildForm($form, $form_state);
$config = $this->config('category_dynamic_block.settings')...
0
votes
1
answer
899
views
Drupal 8 - Admin - Content Types - Manage form display - Fields groups, labels, headers
I would like to know if possible in ADMIN, without modifying the admin template, by means of some module or extension do the following:
I would need to be able to create the data entry form for ...
0
votes
0
answers
52
views
Where is the "Enable/Disable translation" value stored in the database?
Where is the "Enable/Disable translation" value stored in the database? I haven't been able to find this info anywhere.
0
votes
1
answer
62
views
Drupal Add Field Collection with mutli-value field with web services
i am trying to create a node that have a field collection with multi-values, but this only save the first value and the second not.
I am trying in the following way:
"field_mobile_number_collection" ...
1
vote
4
answers
2k
views
Add a field from a node into page.tpl.php, drupal 7
Creating a sub-theme in Drupal 7's page.tpl.php and needing to pull the value (plain text) from field_EXAMPLE from a custom content type outside of where the rest of the content would normal be.
<!...
0
votes
1
answer
63
views
Drupal 7 | Preserve file after entity_wrapper unset?
Question is quite simple: How to preserve file on server and in file tables, so its fid is still valid after unsetting/changing value with entity wrapper?
$ewrapper = entity_metadata_wrapper('node', $...
0
votes
1
answer
240
views
How to Expose Filter to user when using View for EntityReference field Drupal
I have an entityreference field on node creation that allows you to select another node. I’d like to be able to let the user filter by content/node type, instead of seeing them all at once. (The nodes ...
0
votes
1
answer
49
views
Define and use a field of other node type as my form element type in Drupal 7
I'm developing a Drupal 7's module. I defined a node type named 'Booth'. Now in my module, I created a form with some fields like name, phone, address and so on. One of these fields is Booth which is ...
6
votes
3
answers
12k
views
Drupal 8 create field programmatically
I created a custom module for Drupal 8 that allows the users to choose a Content type in order to add some fields programmatically.
How I can create some fields (text type in this case) and attach ...
4
votes
5
answers
14k
views
Drupal 8, add an image field from a BuildForm with preview
I created a custom form from a buildForm function. In this form, I would like add an image field.
I can do that via this code :
$form['main']['image'] = array(
'#type' => 'text_format',
'...
9
votes
4
answers
24k
views
Drupal 8, get programmatically the list of fields of a custom content
I want create programmatically a custom content (custom content created via the admin UI). But, before the creation, I want check programmatically the types of fields of my custom content
My custom ...
1
vote
1
answer
89
views
Drupal: - Field Info API as REST
We would like to get label for the field.
As per previous question: How do I get a field label by the field name?
But I need to get this through the REST API of Drupal.
Could anyone please suggest ...
0
votes
1
answer
427
views
Drupal 7: Populate node fields with values from $form
I would like to know if it's possible to populate a node fields with the values from form_state or something like that.
Basically what I do is to show a register form merged with a form from a ...
4
votes
1
answer
525
views
Drupal-7 how to get hook_field_[formatter_]prepare_view() invoked without overwriting existing formatter
From my module, I'm looking for a way to change text-fields value during rendering process, but WITHOUT creating a new formatter, and BEFORE the currently affected formatter works.
In other words I ...
0
votes
1
answer
1k
views
How to dynamically remove field in Drupal 7 custom form using AJAX
Based on the "Add-more button (with graceful degradation)" example available in Drupal examples module I have created a form that can add fields dynamically using AJAX, and now i want to add a ...
0
votes
0
answers
152
views
In Drupal after selecting a value in an autocomplet, I need to load field values from a database record
I am using Drupal 7's Form API to develop a prototype for an old system. I've managed to get the dropdown select boxes to load dynamically and dependently from the database. I have also managed to ...
0
votes
1
answer
99
views
drupal - collection field with status - publish checkbox
is there a way to have a publish checkbox on a collection field associated to a content type ?
if i have 3 items on a collection field associated to a node , one i want to set it unpublished so only ...
1
vote
1
answer
910
views
Undefined index: custom field in locale_field_entity_form_submit() (line 438 of locale module)
Hi I am getting this kind of error in creating custom node type with custom fields:
Undefined index: field_block_pre_login_body in locale_field_entity_form_submit() (line 438 of D:\xampp\htdocs\...
4
votes
1
answer
6k
views
How to Add Date Field type in Drupal 7
I was wondering how to add a date field type in drupal 7. I was following a video tutorial, when I notice that I dont have a "date" field type in my select options. How will i do that?
0
votes
1
answer
78
views
Drupal 7 - how can I control content layout in a view?
I've been handed a design spec which requires a news listing in a specific format - e.g. image floating to the left, with the main title and content on its right.
I've created the articles listing ...
0
votes
2
answers
5k
views
Drupal 7: make values of a field dependant on other field value
I created a content type with different kinds of fields (text, dates, entity relation...).
I have 2 dropdown fields (related to 2 taxonomies). I would like that the second dropdown values change based ...
0
votes
1
answer
152
views
Hiding Time Field if Date is Expired
My time field shows after an expired date. My client wants to have the time hidden after the expired date. But still have the date show. Is this possible?
4
votes
3
answers
542
views
Drupal 7 add headings to each grouped section in my content type?
I have created a content type and it has about 5 groups which are all vertical tabs.
For some reason the Field group label doesn't work for vertical tabs. the <h2> tag is always: <h2 class="...
1
vote
1
answer
1k
views
How can i add list(image) field in drupal 7?
I'm using Drupal 7 + Ubercart. Have to add a field with easy selecting from images (52 logo images of producers), that are already uploaded and will be used every time, when i'm adding new product.
0
votes
2
answers
148
views
Add field when adding new content in Drupal
I'd like to ask a tricky question to you about Drupal.
I created a new content type which includes lots of fields.
I want to find a module that adds a 'Add another' link to the adding content screen ...
1
vote
1
answer
4k
views
How to programmatically set a conditional field with OR functionality in Drupal 7
In mymodule_form_alter() I am programmatically setting states for my conditional fields.
I.E.
$form['my_field_one']['#states'] = array(
'visible' => array(
':input[...
0
votes
1
answer
88
views
Drupal fields: Passing a variable to view
I have a custom field plugin. It's widget looks somewhat like this:
function mymodule_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
...
...
1
vote
1
answer
820
views
Drupal 7 - how to allow file extensions for field
After creating multiple fields with the help of the installation profile I am now also trying to figure out how I can add the allowed file extensions in the installation profile. Here is my code so ...
0
votes
1
answer
233
views
How to limit selection to one across several term reference fields?
I'm hoping somebody can help me.
I have added nine term reference fields, one for each of my vocabularies, to the Create New User page. What I want is to only allow one term to be selected from all ...
1
vote
2
answers
790
views
Drupal 7 conditionally check a field
I'm trying to write a conditional statement in a template file to check if the value of a 'node reference' field is not equal to a certain value. This is what I have so far:
<?php
$value = ( $...
1
vote
1
answer
291
views
Alter Drupal 7 Text list values when you don't know position of text list in form array
I am creating a module to alter the output of Drupal 7 text list fields.
I know that I can use hook_form_alter to do this, the problem is that the text field is output in different forms in different ...
1
vote
3
answers
5k
views
Drupal: Auto number field for content-type with starting value
I need a field which autonumbers my content-type, but starts at some value like 2000. I tried Serial Field and Computed Field. Couldn`t figure out how to do it. The number (using Serial Field) does ...
0
votes
1
answer
460
views
Drupal: Auto fill CCK field
I have a "movie" content type, on the node for a movie I have a link to create "Movie Review" content. I was wondering if it is possible to pull the title of the "Movie" Node and put it in the Title ...
1
vote
1
answer
199
views
Drupal 6 to 7; returning keys instead of label
I recently upgraded from Drupal 6 to 7 and on my node pages it is now returning the keys for each selected custom field, instead of the label. This is only happening for "Select list" fields.
For ...
1
vote
1
answer
2k
views
Creating rule based on field collection field
What I want to do is trigger an action when one of the fields on my field collection is changed to a certain value. For example, my 'campaign' node has a field collection with a field called 'status' ...
0
votes
1
answer
58
views
Author of a particular field - which user modified the field
Is it possible in Drupal to find out which user modified a particular field? Not just the whole node. After saving the content I want to display the author name next to that field.
Not sure if this ...
1
vote
2
answers
281
views
Drupal email field
How can I lock the default e-mail field (make it read only), so that users will not be able to change their e-mail addresses after registering.
Thanks
0
votes
2
answers
74
views
Permission to see hidden fields
There is a node type with hidden fields. Anyone can find nodes of that content type from the search form, and see open information. To see all the fields, users must make a request to the node owner, ...
1
vote
1
answer
2k
views
Drupal 7 access field collection data in views
I have a field collection called field_logo_logos.
There are 2 fields within:
field_logo_image and field_logo_link
In views I can get the data and it comes out like this:
<div typeof="" about="/...
0
votes
1
answer
1k
views
Drupal 7 views_embed_view node.tpl.php fields
With Drupal 7 and Views 3, I'm trying to get the result of a call to views_embed_view with contextual filter arguments in hook_preprocess_node, for embedding into a node template.
The view is using ...
0
votes
1
answer
1k
views
attach image_field to entity in drupal 7
I use drupal 7, and Entity API to develope a module. I have an entity to record client information. I wish to use image_field to let client upload their logo. So I have this function:
function ...
0
votes
1
answer
601
views
Dependent Dropdown issues in Drupal 7
I am using two select boxes in my form: one for country and one for state. I want the states box to be displayed based on the selection of the country box.
I also have two database tables: countries ...
1
vote
1
answer
59
views
printing all the "articles" related to the content type
my content type, plan to have one or more 'articles'.
the following php code, I can get them all:
<?php print render($content['field_articolo_di_riferimento']);?>
and I get the following ...
1
vote
1
answer
706
views
Drupal 7 Is the a way to programmatically know the Fields in a Content Type?
In Drupal 7, i need to Programmatically create the nodes, by using:
$node = new stdClass();
$node->type = "movie";
After, just this codes above, and lets assume i don't know what are the fields ...
0
votes
1
answer
166
views
Drupal 7 Does "New Node Creation" initiate/prepare the Fields for different Content Types?
In Drupal 7, i need to Programmatically create the Nodes. As usual, there are Different Fields set for Different Content Types.
For very simple example:
Content Type: "car"
Fields: "Model", "Engine",...
2
votes
2
answers
7k
views
Drupal 7 conditional fields : How to display specific fields based on other select option fields
I am using Drupal 7 and conditional fields. I need to show a select field with values based on the value selected from the first option field. For example, if the first selected option is "Country" ...