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
4 votes
2 answers
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') ->...
  • 689
3 votes
2 answers
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
1 answer
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 ...
  • 689
12 votes
3 answers
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 ...
  • 95.6k
3 votes
1 answer
226 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 ...
  • 131
8 votes
2 answers
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
2 answers
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' => '...
  • 235
40 votes
11 answers
29k 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 ...
  • 645
2 votes
3 answers
386 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 and subsequently any bundle. Is there a way, using the Field API or the Entity API, to make fieldable ...
3 votes
3 answers
600 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 ...
  • 5,280
1 vote
1 answer
308 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", ...
  • 1,755
2 votes
2 answers
356 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 ...
  • 3,253
5 votes
1 answer
725 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 ...
  • 233
3 votes
1 answer
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
2 answers
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 ...
  • 734
1 vote
1 answer
742 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 ...
  • 649
5 votes
2 answers
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 ...
  • 217
2 votes
1 answer
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->...
user avatar
2 votes
3 answers
157 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 ...
  • 890
2 votes
1 answer
931 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 ...
  • 2,057
3 votes
1 answer
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?
  • 165
2 votes
1 answer
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
2 answers
443 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 ...
  • 291
2 votes
1 answer
278 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 ...
  • 201
3 votes
3 answers
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
5 answers
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 ...
  • 27.2k
3 votes
1 answer
600 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 ...
  • 201
2 votes
1 answer
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 ...
  • 233
2 votes
4 answers
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?
  • 27.2k
5 votes
3 answers
717 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?
  • 924
7 votes
4 answers
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
4 answers
7k 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 ...
  • 1,068
5 votes
5 answers
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,...
  • 27.2k
3 votes
3 answers
910 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
3 answers
926 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-...
  • 3,253
7 votes
5 answers
779 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 ...
  • 1,290
5 votes
2 answers
450 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 ...
  • 95.6k
2 votes
1 answer
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
1 answer
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 ...
  • 287
6 votes
5 answers
2k views

How to display cck node fields' values at the search result page?

I need to display some specific cck fields such as Telephone Number, Address, etc. at the search result page. As I see the search-result.tpl.php, there is no $node->... So how can I get the node ...
3 votes
2 answers
3k views

How do I create my own tokens?

I use the Rules module. I want to add 1 to a CCK integer field on an action. Someone told me to create a custom token doing this addition. So, I installed the tokenSTARTER module. Now, how do I ...
user avatar
7 votes
7 answers
13k views

How do I enable the WYSIWYG editor on fields?

I added couple of Text fields on a content type in Drupal; however, only the in-built "body" fields is WYSIWYG editor enabled. I am using FCKEditor as the WYSIWYG editor (installed under the Wysiwyg ...
user avatar

1
170 171 172 173
174