All Questions
2,664 questions
2
votes
1
answer
471
views
Testing the value of Fields stored on Taxonomy Terms
I have a field (called Division) attached to a node. I want to print out a link (called Switch) on page.tpl.php that varies according to the value of this (node-based) field.
I can successfully do ...
7
votes
2
answers
3k
views
View mode for specific bundle
Drupal 7 makes it quite easy to create a new view mode (see this tutorial for instance), but is there a way to define a view mode that is only available for a specific bundle (content type)?
4
votes
2
answers
3k
views
Moving custom content types and content
I'm rebuilding a Drupal 6 site in Drupal 7. So much needs to change, it doesn't seem worth trying to upgrade, so I'm starting from scratch.
I would love to know if there is an easy way to export all ...
3
votes
3
answers
2k
views
Set default value with PHP on a node field.
I'm using Drupal 7 and have created a content type called abc. In abc there is a field called seller. When a logged in user creates a new piece of abc content, the value of the seller field would be ...
1
vote
4
answers
3k
views
Drupal 7, Default value php snippet missing?
Im using drupal 7 and created a content type abc. In abc there is a CCK field called seller. When a logged in user create a new item for content type abc, the value of the seller field would be the ...
15
votes
1
answer
12k
views
How to integrate Field collection module in Views?
I have created fields and grouped together with Field collection module. I have attached the group field (containing 4 fields), to user account settings in : admin/config/people/accounts/fields.
Now ...
4
votes
2
answers
813
views
Drupal 7, Custom Content Type... Does an addon that does this exist?
I rebuilding my companies intranet... we have what's called a portal. Within the portal is pages. Each portal page is either HTML, a PDF or a Video.
Right now... I'm planning on creating 3 seperate ...
8
votes
2
answers
6k
views
Example of hook_file_download
How do I restrict the access to certain files based on their content type? I have the download section for registered users, and I want to prevent them to post links somewhere outside my site.
Is ...
4
votes
2
answers
973
views
Help with #text_format and field widgets
I'm struggling with #type 'text_format' for a widget form field as this field gets expanded two separate elements, one holding the orignal element and the other the format selector. The orignal ...
1
vote
2
answers
190
views
Where can I see the options accepted by the field API for the widget type?
Where can I see the options accepted by the field API for the widget type?
$instance = array(
'field_name' => $field_name,
'label' => 'Demofield Demo',
'description' => 'This is a ...
6
votes
2
answers
593
views
What approach for showing custom user fields on a node?
I've added a few custom user fields which users complete when registering.
What is the simplest approach to show these fields when viewing content that user has created?
For example, when viewing a ...
3
votes
2
answers
4k
views
How do I retrieve the field data associated with an entity, using EntityFieldQuery?
I'm still confused about the entity concept in Drupal 7.
I have a node type audio with an MP3 field. I'm able to use EntityFieldQuery to find all the audio nodes, but I need the URL of the MP3, which ...
1
vote
1
answer
182
views
Problem while using the user_reference field in my bundle
I am creating an entity for my D7 Module and trying to include a user_reference auto-complete field in it. The autocomplete-field shows up correctly with the add-more option since I have set ...
2
votes
1
answer
330
views
Field template in theme based on Garland
I have problem with template for field "field_is_new" in Drupal 7.
My_Theme is a modification of the Garland theme. (I don't know if it's important.)
I have created a template for this field in my ...
2
votes
2
answers
6k
views
Changing a field settings on a live site in Drupal7
In the middle of entering content I discovered the length of 15 characters of a particular field I set earlier is not enough.
In Drupal6 I could change the settings of a cck field. It could be ...
2
votes
1
answer
541
views
Select the fields of a node using code
I'm new to Drupal, and I have some problems.
I need to select some fields from a node (via code), and then process the data.
[Full-size image]
Basically, I want to show the total of column "value", ...
2
votes
2
answers
362
views
Custom Table or CCK?
I'm currently working on a project with a new requirement that, in a nutshell, queues submissions from users and submits them them to a remote API:
collects submissions from users (with a form)
each ...
0
votes
1
answer
2k
views
Helper to get the raw value of a node field?
I wonder if something "core" already exists that gives me the raw value of a field inside a node. For that matter I wrote this little helper, but it seems too strange not to be able to do it with a ...
2
votes
1
answer
386
views
Module development - integrating custom content types
I want to create a module which would need custom content types from the cck module. I know in the .info I can say a dependency is the cck module.
How can I best have the module create the content ...
1
vote
3
answers
5k
views
Export Users with custom fields?
I need to set up a semi-regular export of people who have signed up on our website. We're using Drupal 7. I can do a simple export of the Users table, but that doesn't include the additional custom ...
1
vote
1
answer
253
views
very bad thing of output the vocabulary in drupal 7
I created four vocabularies for the "article" content type.
I want to output the vocabulary which belongs to the node; when I used print render($conetent['field_vocab']), it output the vocabulary, ...
2
votes
1
answer
3k
views
Custom field widget with text field formatter?
I'm trying to create a compound field in Drupal 7 that combines and image field, text field and a textarea field.
I've successfully done this but I'm now trying to add text format option to the ...
7
votes
4
answers
7k
views
Add fields to user roles
I'm using Drupal 7 to create a project linking organizations to volunteers. My initial approach is to use profile module to create different profiles for each role (volunteer & organization). Is ...
12
votes
3
answers
6k
views
How to bypass node_access when using EntityFieldQuery?
With the following code, if the current user does not have 'bypass node access' (see _node_query_node_access_alter() for exact verifications), then the query checks for node_access, even though I do ...
2
votes
1
answer
4k
views
Using hook_form_alter to set default values for multiple-value CCK fields
I was previously using the Default Value PHP field in the CCK Field Properties page to define multi-value default which was working fine. However the code is now getting so complex and I need to pass ...
2
votes
1
answer
709
views
Are CCK shared fields loaded on node_load()?
field_metatitle is a CCK field that is used amongst 5 different content types, meaning that it is a "shared field". When I do $node = node_load('123');, I see that $node->field_metatitle is not ...
1
vote
1
answer
2k
views
Set dropdown list programmatically in exposed view filters
I have programmatically set a text CCK to a select and given a few choices:
function mymodule_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'views_exposed_form' && $...
2
votes
1
answer
170
views
How can I cascade field display formatters?
I need to display a thumbnail of my images and the count of its downloads below the thumbnail.
I am using these modules:
CCK
FileField
ImageField
ImageCache
DownloadCount
and I think I need ...
1
vote
1
answer
680
views
Registration full name
I would like to edit the registration fields, but I can't find where to do it.
I want to replace the username field on the registration form with two fields for first name and last name, which are ...
4
votes
3
answers
2k
views
Grouping fields together
Is it possible to generate fields which are "grouped" together when marked as Unlimited? For example, a select field with label "What time do you wake up?" lets the user select the day of the week (...
2
votes
1
answer
611
views
Update node with services doesn't work for text_list widget
I'm setting up a REST server with Drupal 7 and Services 3.x.
Everything work fine (authentication, node creation, etc..), except that I can't update a text_list field of a node.
I've tried to use &...
20
votes
4
answers
15k
views
How to hide a custom user field in user profile?
In Drupal 7, what is the best way to prevent any non-administrative user from changing a custom user profile field?
Use case: I've created a user field called "Customer ID" that I do not want the ...
0
votes
1
answer
565
views
Custom CCK Currency exposed filter for available currencies
I am trying to set the available currencies programatically like this:
function mymodule_form_alter(&$form, $form_state, $form_id) {
/** Modify exposed filter views */
if ($form_id == '...
1
vote
2
answers
940
views
Custom content type on registration form. No node title field
I set my custom content type to show on user registration form. I see cck fields, but I don't see node title field (required field) :(
Could somebody give any advice?
6
votes
2
answers
4k
views
How do you build a query to get a series of nodes and their field values filtered by field values?
Hopefully someone with Drupal 7 experience can point me in the right direction.
I'm creating a custom module to query some nodes and group and sort them by their field values.
I tried to use Views ...
0
votes
2
answers
152
views
CCK Nodereference individual imagefields
Is there a way to use a nodereference field on each individual image in a node? The images are CCK imagefields.
2
votes
1
answer
648
views
Displaying node fields in a view
I have a content type called Snippet. Snippet will have one image field and unlimited text fields.
I want to output fields in Views as:
image field (image.png)
text field (Text1)
text field (Text2)
...
1
vote
0
answers
158
views
CCK field in Workflow tab
I would like to add a user reference field to the Workflow tab.
Currently we have a user reference CCK field but it is only editable in the Node edit form. Really it would make much more sense to be ...
8
votes
5
answers
7k
views
How can I add a real name field beside username to user information?
I want to add a real name field beside the default username when I creat a new user in admin/people/create. How can I do this?
I have checked the RealName module but is not doing what I need.
4
votes
2
answers
2k
views
How to pass formatter settings to field theme function?
I've created a field by implementing hook_field_info, I've created the widget which works perfectly and I've hit a road block with the formatter.
I've implemented hook_field_formatter_settings_form ...
1
vote
1
answer
198
views
Display a field 'Category' on the home page
How do I display a field 'category' (so as 'tags') in the node.tpl.php?
3
votes
2
answers
1k
views
cache_clear_all() doesn't seem to work
I have a block with a few CCK fields. In this block I have a link to an action that changes the value of the fields in that block.
The code is the following:
db_query("UPDATE {content_type_event} ...
1
vote
3
answers
1k
views
Prevent a date from happening in the past
I have a CCK field that is a date. I want to prevent people entering a date that has happend in the past. I know you can set Years back and forward and I have set this to -0:+2 but this just limits ...
1
vote
1
answer
1k
views
Pagination for entities
I have an entity called announcement, and I have a page (user/%/announcement) where I display a table of three columns (name of entity,an edit entity link and an delete entity link).
function ...
0
votes
2
answers
1k
views
CCK Node Reference options not showing "this post can't be referenced."
I have a CCK field of node reference. As user 1 I can set the node ference field to a node. I will see something like Node Title[nid:123]. When I go in as another user I see [nid:123]. When I go to ...
3
votes
2
answers
146
views
Using third-party functions
I have a third-party PHP script that I want to integrate and use in my site. The script is quite small and comes with its own functions and array indexes. How would I be able to call the functions and ...
8
votes
3
answers
10k
views
Custom theme function not being called?
I'm building a Drupal 7 module to create a bespoke field type. I've implemented all the required hooks. My hook_field_formatter_view() function looks like this:
function MYMODULE_field_formatter_view(...
1
vote
3
answers
644
views
How do I print out a field
I created a new content type with several fields in it. How would I print out those fields anywhere on the page that I need them like in the sidebar and other areas? What is the syntax for printing ...
2
votes
2
answers
364
views
Override nodereference_autocomplete functionality
I would like to edit the functionality contained in nodereference_autocomplete() so that it will only return a subset of all nodes. What would be the best way to override this default functionality?
6
votes
3
answers
2k
views
Restricting node reference values to owner
I have played with a bunch of modules (Node Reference Node Access, Views Field, View Reference) and can't seem to find one that does a very simple job; In one content type I want a field that provides ...