Questions tagged [7]

Version tag to tag issues specifically related to Drupal 7.x. Please note that version tags should be used only for questions that apply to a version only, not to merely say what version a site is using.

Filter by
Sorted by
Tagged with
7
votes
1answer
165 views

When posting OG content, how to choose only from Content Author's Groups?

When a user is editing/creating a node, there is a field where the user can choose what groups to post the content to. I want this field to list only groups the user is actually a member of. Is there ...
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 ...
4
votes
2answers
425 views

Single SQL query to pull recent two nodes from each node type

As mentioned in the title, I was wondering how this can be achieved with single SQL query. All I need is the node ID from node table that matches the given criteria.
0
votes
2answers
121 views

How to generate a list of which Features are enabled in which Spaces?

I'm running a Drupal 6.x site with Organic Groups, Features, and Spaces, and I'm interested in generating a list of which Spaces have which Features enabled. Preferably a table, with Spaces along the ...
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 ...
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 ...
4
votes
1answer
276 views

Is there a modules “wish list” anywhere?

I'm new to Drupal, and right now my job consists mainly of site-building. But I'm a PHP developer, and I'd like to get into module development. The problem is, anything I could think of to do has most ...
2
votes
1answer
76 views

How to write a view of a user signed up nodes?

There is a content-type (event) with signup enabled. I want to show, on a user profile, the events this user has already signed up. I am having several frustrations with the signup relations and ...
2
votes
1answer
977 views

Select an image from a directory

How do I select an image from a directory of images uploaded with the image field, in the same way done in Joomla?
3
votes
1answer
608 views

The theme is broken when I enable the “Optimize CSS files” option

The theme I made is broken, when I enable the "Optimize CSS files" option. I have cleared the cache, but the theme still doesn't work. With Firefox and Internet Explorer it is OK, but with Google ...
2
votes
1answer
1k views

Views2 Handlers: Fatal Error Class 'views_handler_field' not found

I am working on a module and want exposing some fields to Views and provide some custom filters. But I can't extend any Views classes without drawing a fatal error. My code looks something like this. ...
2
votes
1answer
321 views

Serving CSS, images and JavaScript in Drupal

Does the whole Drupal stack get fired up (bootstrapped) each time one of these static content types gets requested?
5
votes
2answers
4k views

Why does the page callback have two arguments?

function menufun_menu() { $items['menufun/%/bar/baz'] = array( 'title' => 'Hi', 'page callback' => 'menufun_hello', 'page arguments' => array(1), // The matched wildcard. '...
2
votes
2answers
2k views

Altering a URL alias without using a module

Is there a way to alter a URL alias without using a module? Somebody told me to write a record into database table, but I don't know how to do it.
2
votes
3answers
1k views

Using node_view() to display a node doesn't print local menu items

When using node_view() to display a node (via return from a function that's called in hook_menu()) the usual View/Edit tabs are missing. Is this expected behaviour?
2
votes
2answers
554 views

When viewing a user, display their content profile

When I go to /user/uid I want it to go to /content/content-profileID by default. This is a node typer that is used by content profile. How can I go about doing this?
6
votes
2answers
474 views

Is Drupal 7 a good fit for my site?

I started creating my site in Wordpress 3.1, and I have hit a speed bump. I am considering switching to EE or Drupal 7, in hopes of achieving my vision of the site. The problem I am having is ...
3
votes
1answer
433 views

og_members block & og_nodes block won't display content

OG Version: 7.x-1.x-dev My problem is that I can't get the og_members block & og_nodes block to show up under a group page. Breakdown of my process: A fresh install of D7, necessary modules ...
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
2answers
816 views

Views as definition list?

Is there a way to output the content of a view as a definition list? Example: <dl> <dt>Nodes title</dt> <dd>Nodes content</dd> <dt>Another nodes title</dt&...
5
votes
1answer
6k views

How to create groups and assign users to them?

I want to allow the administrator and manager roles to be able to create groups (for example different jobs within a company) and be able to assign users to the groups. I want this to be a one-to-many ...
2
votes
2answers
988 views

Which method to set up pay to register?

I am building a site that requires payment, from paypal for instance, as part of the user registration. What approach should I take?
1
vote
1answer
411 views

Custom SQL: nodereference joins and latest VID

I'm having a heck of a time constructing a custom SQL query. The query has multiple nodereferences and needs to return the latest node revision. I understand joins pretty well, but for some reason ...
1
vote
1answer
161 views

“Node: Created day” mismatched, not reflecting the actual created day

Views Version: 7.x-3.0-alpha1 I was trying to create a blog archive view, like blog/yyyy/mm/dd, where blog/2011/03/10 is supposed to display all posts created on 2011, March 10th. However, the page ...
2
votes
1answer
1k views

Gmap Views Module - Popups are too big

I'm using GMAP module and its views counterpart. The issue I'm having is that I'm using a custom text field to display fields wrapped in HTML that I have pulled in from the query. However, the popup ...
1
vote
2answers
2k views

Dependant dropdown list

I have 2 fields, state and city. I would like to change the city field when I select the state field. I tried to use "hs_nodereference", but this module shows the state and city fields as follows. ...
1
vote
2answers
1k views

How to use the Tabs module?

I've installed the Tabs module, but I don't know how to use it. Can anyone help me, please?
1
vote
1answer
726 views

module_invoke() and the performance

I am using module_invoke() many times in the front page to invoke lots of block. Does this effect the site performance? Thank you.
3
votes
2answers
3k views

Redirect to an external site when accessing the page of a node meeting a set of condition

I need to redirect users to an external website when they access the node view page at node/%node of a node meeting some conditions. What would the proper/best way to achieve this (using code) be?
1
vote
1answer
125 views

Alter submitted by text and retain RDF tags

I am looking to change the submitted by text from: <span rel="sioc:has_creator" datatype="xsd:dateTime" content="2011-03-20T22:54:29+13:00" property="dc:date dc:created">Submitted by <a ...
1
vote
1answer
195 views

Grant access to CCK referenced nodes

I have one content type 'object' that references one or more nodes of content type 'image'. I'm granting access to nodes with TAC Lite: a user can view only content with a particular term. Since the ...
6
votes
2answers
8k views

How can I output the Devel query log?

Is it possible to output the Devel generated query log in some way? By default, it prints to the bottom of the page which is fine until I need to send the results to someone else to review.
1
vote
2answers
256 views

What's wrong with this code?

function welcome_menu() { $item=array(); $item['welcome'] = array( 'title' => 'welcome', 'access callback' => 'welcome_init', 'page callback' => 'welcome_test', 'type' =&...
8
votes
2answers
4k views

db_affected_rows in Drupal 7 for db_query

I just noticed that @Berdir was so nice to remove db_affected_rows from Drupal 7. I'm now wondering what the best practice is now to detect if the query you ran changed anything in the database. A ...
2
votes
1answer
1k views

Detect the taxonomy term(s) of a node from within a template file

I have a Drupal 7 site with a content type of event. I have a taxonomy called "event types" that has 5 options (Party, Conference, Meeting, etc) I have one template named node--event.tpl.php for ...
2
votes
2answers
98 views

Why would my Views take longer to load when I'm logged in as a regular user than one I'm logged in as an administrator

I have a Views display that returns a 30 row table of node parameters that is taking about 16 seconds to load when I'm not logged in as either user 1 or one of the users with the administrator role. ...
5
votes
2answers
2k views

Version Control of a Content Type

I'd like to create a content type. My problem is this content type will change frequently (every 6 months, I will add some fields and I will delete others). How would you do it? I had thought several ...
2
votes
2answers
2k views

How to increase the width to the Omega sub-theme more than 950 usable pixels

I have created a new sub-theme of the Omega theme (version 7.x-2.1) in Drupal 7. But I want to use 970 usable pixels instead of 950 pixels as the sub-theme offers in "Default container width". How ...
2
votes
2answers
1k views

Where is the best place to insert additional logout functionality?

To insert additional logic when a user logs off one might look at function user_logout() in user.pages.inc. This code being in a core module, you should not edit it, but works very well... for ...
4
votes
2answers
2k views

Send a CSV file to the user on FAPI form submit

I have a FAPI form that collects some information from the user, then generates a CSV file. The intent is when the user clicks 'export' on the form, the CSV is downloaded straight away. However, when ...
2
votes
1answer
646 views

Print module's default setting is annoying

We often use the print module to create PDF of nodes; most of the times, it works out-of-box. For our requirements, however, one thing that makes me very annoyed is its default settings. When the ...
5
votes
1answer
11k views

drupal_add_js best practice to include inline code or script file

While reading the API page for drupal_add_js, I kept wondering what is the best practice to include inline JavaScript or a JS file. It seems like it works exactly the same even if you omit 'file', '...
5
votes
4answers
891 views

How to get the content owned by the currently logged-in user?

A user is the owner of only one node, and I want to redirect the user, at login time, to his only owned node. How can I get the node content if I know only the logged-in user?
0
votes
2answers
562 views

Panels call custom function

Is it possible to call custom code from a panel? My custom module has a function which returns some content. I wish to call this from my panel.
1
vote
1answer
269 views

What is the access record “content_access: all”? This is overriding my taxonomy access module

I have had problems with my permissions ever since I last rebuilt my permissions. (I did this after working on user reference permissions. This field has no user reference on it) The taxonomy ...
3
votes
2answers
2k views

Creating a view block inside a fieldset using templates

I am trying to create a new .tpl.php for some of my views. I know how to create the file and display the elements the way I want, but only by changing the default views-view.tpl.php which would ...
2
votes
3answers
151 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
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
2answers
750 views

Path associated to Views

I used Pathauto to create URLs for my nodes like gallery/[node:title]. I created a view with an argument, and the path is gallery/% (% is the node title), but when I point my browser to that URL, I ...
1
vote
2answers
1k views

Batch API and curl or file_get_contents() issue in Drupal 7?

Has anyone ever experienced issues with curl or file_get_contents() when using the batch API? I'm trying to import nodes from a remote data source via batch API; I used file_get_contents() during one ...