Questions tagged [entities]

Nodes, comments, taxonomy terms, and users, in the terminology used since Drupal 7, are generally called "entities."

Filter by
Sorted by
Tagged with
7
votes
2answers
918 views

Creating N fields with N 'subfields'

I'd like to create a content type "Enterprise" where user can define N services and, for every service, N tasks. I have already created the other fields for this content-type (name, description, ..., ...
3
votes
3answers
2k views

Display referenced node field in view

I have a view made up of nodes that include node reference fields. I would like to pull in a field from each of the nodes being referenced for display in my view. I know that is a little confusing ...
3
votes
4answers
4k views

Generating node title from node fields

So, this is a newbie question. I'm using Automatic Nodetitles with a custom content type. I'd like the node's title to be equivalent to one of my fields. After some snooping around I came up with this:...
3
votes
2answers
2k views

Autocomplete textfield

I've noticed that the autocomplete textfield widget has not been ported to Drupal 7. I'm looking for a way to provide user with suggestion for already submitted values, but I don't want to create a ...
2
votes
1answer
773 views

How to programmatically edit a field?

I have a type node called flat, a field called latitude. I want to update the value of this field in a module each time the node is updated. I try to use the hook_node_update() but nothing happens : ...
6
votes
4answers
3k views

In Node References, how to show a custom field, instead of the Title?

Is it possible to show in a select list, another field instead of the Title when referencing a node?
2
votes
2answers
371 views

How to include the Title field of a content type inside of a Group?

When creating a new content, is it possible to have the field Title inside a Group defined by me?
1
vote
1answer
1k views

Sending mail to an adress specified in a node creation form with an CCK email field with Rules

I'm using a node creation form open to anonymous users to register volunteers for an event, and I want to redirect them to a thank you page, and send them an email when they register. I'm using Rules ...
1
vote
1answer
1k views

Multiple primary keys

I have defined a new content type, statetype and a CCK field, state. I need to use the CCK field as primary key in this table because I have another table and I need use that field as foreign key. (...
7
votes
3answers
3k views

Display taxonomy field in node display

I created a vocabulary where terms have an image as additional field. I want to show the image instead of the term name in the node page. How can I do this? In Drupal 6.x, I would load the term and ...
4
votes
2answers
4k views

Howto print out the pagination for EntityFieldQueries?

I have this code that uses an EntityFieldQuery object: $query = new EntityFieldQuery; $query ->entityCondition('entity_type', 'node') ->entityCondition('bundle', 'yacht') ->...
3
votes
2answers
2k views

What format are CCK dates stored in?

In what format are CCK dates stored? If it stores dates in the database using a timestamp string instead of a native MySQL datetime format, what implications does that have in regards to storing dates ...
1
vote
1answer
4k views

Adding Node-Fields to query with db_select();

I am building a query using db_select(); Now I need to sort my result by a field that a added using fields. Is there some nicer way than to join field_data_field_fieldname, and revision? I was ...
12
votes
3answers
2k views

What does “Entity API” add to the Drupal API, and why would a module depend on it?

The Entity API module extends the entity API defined in Drupal. In which cases should a module use the API provided from that module? Are modules that implement new entities easier to be written if ...
3
votes
1answer
225 views

Field api - taking responsibility over a field display

I am writing a Drupal module that deals with the taxonomy terms, which are (as I understand) fields, taxonomy vocabulary , which are as I understand entities. My module should take over the taxonomy ...
8
votes
2answers
20k views

How to create node reference fields in Drupal 7?

I am puzzled. This was a very valuable option in D6 CCK, but since it moved into core, I can't find the option to create a noderef field (found a term reference field, though). I know it must be out ...
4
votes
2answers
3k views

Multiple values in creating a new field instance

This is the code I actually have: $instance = array( 'field_name' => FIELD_PROJECT_TAGS, 'entity_type' => 'node', 'label' => $vocabulary->name, 'bundle' => '...
40
votes
11answers
28k views

How to display a field before node title?

I'm looking to render a certain field before the node's title when displaying a teaser in D7. Effectively I want to go from this to this. I have looked into updating the node.tpl.php but I notice ...
2
votes
3answers
379 views

How can I make individual nodes fieldable?

One of the great things about the Entity and Field APIs is the ability to add fields to any entity (nodes, users, etc.) and subsequently any bundle (e.g. node content types). But is there a way, ...
3
votes
3answers
598 views

Can node reference be altered to include views pages?

I have a site where 'related pages' is a node reference CCK field for a node. Authors can add related pages (1 or more) to a node with the autocomplete functionality of node reference. My question is ...
1
vote
1answer
305 views

Output Flexifield content as Excel file?

I'm using Drupal 6 and Flexifield to create an extensible CCK content type for doing various measurements. The content type is composed of three flexifield fields -- "levels", "rooms" and "fixtures", ...
2
votes
2answers
349 views

Extending a CCK field formatter

I've created a custom formatter (display) for filefield but I'd like to add a settings page per field for width and height. Currently my code only consists of the bare minimum to get the formatter to ...
5
votes
1answer
708 views

Remove “required” status from the Date field

I have a field that is currently marked as required. However, I want this to be required for all roles but the Admin. I've made a module that implements hook_form_alter(), and I have been able to ...
3
votes
1answer
173 views

Filtering CCK views by path

I've created a View in Drupal 6 which I am using to display a list of events. I would like to be able to filter the view by year via the path like this: http://www.mysite.com/events -> gives me ...
5
votes
2answers
2k views

Replace summary/description with another field in Views RSS output

I have a view for an RSS feed which uses the node output (only option it seems when RSS style is selected) so I cant choose custom fields. But, as the body field is 'text and summary' the RSS view ...
1
vote
1answer
732 views

File/image upload via CCK and Nginx + FastCGI

I am using the ImageField module with Pressflow, Nginx, and FastCGI. When I go to add a file via the standard ImageField CCK upload widget on a node, the Upload "throbber" does its thing, Drupal does ...
5
votes
2answers
1k views

Cache field / entity / node

I have a custom field/widget that has a format view function that is highly resource intensive. I currently am caching the result using cache_set()/cache_get() inside the hook_field_formatter_view ...
2
votes
1answer
265 views

CCK field value count is never less than 1

I have got a CCK field set up so that unlimited values can be entered upon node creation (number of values: unlimited). When I try to print values in a node with the following code if ($node->...
2
votes
3answers
153 views

Best practice to have a 'category' fields where admin can choose wich voices the user can choose

I have a content type that needs a 'category' field; this can both be a taxonomy vocabulary or a text field (with the select widget), it doesn't really matter. (I won't have more then 5-6 voices at ...
2
votes
1answer
926 views

Where can I find the save destination path for a filefield? (via code)

I have an image file field and I am attempting to write a little script that will programmatically scan my nodes and save images found in the body of my node into an image file field entitled ...
3
votes
1answer
874 views

Image field theming

In Drupal 6 Views, there was an option to display the path of that file for an image type field, which is not present in Drupal 7. Where is it?
2
votes
1answer
107 views

How should I use a field in views?

I have a CCK field that I want to use in a view. How can I do it?
4
votes
2answers
436 views

Image upload & gallery

Is there a way to limit the number of imagefield fields present in a node? I am using iTweak Upload, which allows to upload an unlimited number of images, but I need something that can limit the ...
2
votes
1answer
275 views

cck Nodereference for files

I am trying to create a node that has a single file attachment (using CCK filefield), and be able to reference that file by other nodes (possibly more than one node). The application is such that ...
3
votes
3answers
2k views

How do I edit a complex entity via dynamically loaded AJAX-forms?

I have a "profile" entity with a field "education" (to get started). That field contains various input fields that describe the "education". At the moment I have "institution" and "year". I created ...
13
votes
5answers
2k views

Entities in Drupal 7

What are Drupal Entities in Drupal 7? I understand that Drupal Commerce built Products as an Entity. I know now there is a core Entity API and an contrib add on for Entity API. I have a few projects ...
3
votes
1answer
599 views

How to create a view to display a block of referenced nodes?

I have a node type, called "policy", that has a bunch of CCK fields, including a Node Reference type. This is configured to reference an unlimited number of nodes. When the nodes are viewed, the ...
2
votes
1answer
1k views

Using CCK Date with Date Repeat on Calendar

I have a content type named Event. It has a field name Date, which uses the jQuery pop-up with Repeat options. It uses the To and From date, both of which are required. The time zone conversion ...
2
votes
4answers
1k views

Entity API and Contrib Modules

When using the Entity API, is it fairly simple to interact with Taxonomy, Path/Pathauto, XML Sitemap, and Views? If so, what parts of the API should I be looking at?
5
votes
3answers
696 views

Change $<field_name>_rendered output?

In a node I get the values of CCK fields as $ array or $_rendered as the rendered view of the field. How can I change the $<field_name>_rendered from its default way of rendering?
7
votes
4answers
7k views

Customising the first item in a view

As a block on my homepage I'm trying to output: <ul> <li><a><img><p>Node 1</p></a></li> <li><a>Node 2</a></li> <li>&...
14
votes
4answers
6k views

Limit Teaser to display only the first value of a Field

I have a Content Type with an Image Field. This field will typically be populated with 0 to 4 values. By default the teaser for this Content Type outputs all 0 to 4 images. How can I adjust the Teaser ...
4
votes
5answers
2k views

CCK Field with two values?

Is there a way to have a CCK Field have two values for one input? For example, a field called 'Sodium' and two values, '190mg' and '8%'- first being the amount, second being % of daily value. If not,...
3
votes
3answers
898 views

Does it make sense to develop a fantasy sports management system by creating or extending entities?

I am considering building a fantasy sports management system with Drupal. The system will need content, so that's taken care of with the standard Drupal system. However, does it make sense (or even ...
1
vote
3answers
919 views

Customising field container

I've created a cck field formatter. The field outputs uploads from filefield into embedded iframes that link to google docs for display. It currently outputs: <div class="field field-type-...
20
votes
9answers
13k views

How to implement two way node references?

The node-reference module (a component of CCK) provides a great way to create a reference one node from another. What is the best way to expose a two-way relationship between the two? Example below: ...
8
votes
5answers
752 views

How might I create a “step-by-step process” content type?

I'm thinking about creating a process manual for an intranet. Most (all?) of the processes have a very clear order, although the actual order may change from time to time. The plan is to have the ...
5
votes
2answers
441 views

Field API versus custom code

If I need to add custom fields only to user profiles, is it better to create a module that uses the field API, or a module that uses its own code to show the custom fields at a custom URL and to save ...
2
votes
1answer
103 views

Making responses to public nodes only viewable by the creator and the originator

I've got a prototype site built in D6, pertinent modules: CCK Comment block Node Comment Views Views Or The site is built around a list of open requests; to solicit a private response. These nodes ...
5
votes
1answer
4k views

How to create relationships between Taxonomy vocabularies?

I'm trying to build a site with similar content conventions to Craigslist. The problem is, I don't really know a good way to create multiple vocabulary relationships in drupal. Here's the end result I ...