Questions tagged [7]

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

Filter by
Sorted by
Tagged with
3
votes
2answers
459 views

Is it possible to make the Book Outline a mandatory field when creating a new book page?

I would like to make sure that certain content types always have a parent book/page. Is there a way to do this, by JavaScript, by modifying the book module or whatever?
5
votes
3answers
5k views

Embedding content in external website

I'm new to Drupal (and SE) and am looking for a way to embed Drupal 7 content in an external website. D6 had modules for that (web widget and embed widget). How can I do it in D7? Thank you!
4
votes
1answer
599 views

Pointing the Views handler for Node Body at another field handler

I want to be able to use a CCK field as my node body without affecting interoperability with Views generated by independent modules. Using hook_data_alter(), I have attempt to re-target the Views node ...
3
votes
2answers
831 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&...
12
votes
3answers
17k views

Page template suggestions are not working

I've created a theme and have my template files in this structure /templates/page/page.tpl.php /templates/page/page--node-type.tpl.php I've created a custom page template but for some reason it's ...
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?
2
votes
4answers
817 views

Email notification based on purchased item

I am working on the magazine site using Ubercart. In this site individual magazines can be bought or subscribed to. When a new issue of a magazine which the customer has subscribed to is created, I ...
7
votes
3answers
8k views

Can I attach a jquery.ui.datepicker widget to a form element using the form api?

I have a generic form element: $form['date'] = array( '#type' => 'textfield', '#title' => t( 'Date' ), ); That I want to add the jquery ui datepicker to this element. Is there a way to ...
1
vote
2answers
3k views

How to enable menu link when creating a new node?

I try to enable the menu link programmatically, here is how I do it: function create_menu_link() { $node = new stdClass(); $node->type = 'mytype'; node_object_prepare($node); $...
2
votes
2answers
1k 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?
5
votes
1answer
720 views

Group ID Filter in Block?

I want to show teasers of content posted to an OG group. I want public and private groups, so the user must have view access to that group to see the content. I have a Group (named "Group") and a ...
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
2k views

Is there a module? Or: How to alter the Drupal pager to get this?

I want to add to alter the output of theme_pager(), and add a <li> tag, as the following: <li class="pager_go_input last">to <input type="text" id="pager_go_input_1" class="form_text ...
7
votes
4answers
10k views

What are the photo gallery/album module choices for Drupal 7?

I am looking to make a Flickr like site that user can create albums, upload photos. With Drupal 6, this can be easily done by CCK, Node Reference, Views. For Drupal 7, it seems difficult since Node ...
1
vote
1answer
4k views

How to add jQuery.LocalScroll to Drupal 7?

I'm trying to add smooth scrolling within a page. I did find out it could be done using jQuery.LocalScroll. What I've done so far: 1. I use Zen subtheme, so into my .info file I put: scripts[] = js/...
1
vote
1answer
732 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.
1
vote
1answer
4k views

I want to modify the drop down menus for Marinelli (a Drupal theme)

I have the Marinelli menu setup in a website I am internal testing. I want to modify the drop down menu (I know it uses jQuery), but I have no idea what to do to show the drop down all nested. In ...
2
votes
1answer
418 views

What's wrong with the fetch rss feed code?

The hook_block() code is the following. // … case 'view': $url = 'http://example.com/feed'; //the site's rss url $blocks['subject'] = t('on the bookshelf'); $blocks['...
0
votes
2answers
1k views

Add a drop-down list to a pager

I want to add drop-down list that allows users to select which page they want to visit. How can I accomplish this? What code should I use?
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
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?
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 ...
1
vote
2answers
2k views

How to set the language for the user while it is created?

How to set the language for a user while it is created from admin/people/create?
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. ...
3
votes
1answer
3k views

What is the difference between "Path redirect" and "Global Redirect"

I read the description of Global Redirect and Path redirect, but I still don't understand what the difference between the modules is, and why Path redirect recommends Global Redirect. What is the ...
2
votes
2answers
169 views

How to avoid submitting a form when creating a new content, depending on some criteria?

Let's suppose I have a content type Person, and I don't want the field Name to contain the text AAA. What would be the best way of avoid submitting the form if that happens? For example: - Hiding ...
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' =&...
5
votes
6answers
1k views

How to deal with this kind of node references, when creating a new instance of a content type?

I'm new using Drupal, and I'm trying creating a database driven website in Drupal. I don't know what is the best way of doing the following: I need to have three types of 'entities' (content types): ...
7
votes
2answers
7k views

Adding JavaScript and CSS to a particular menu page

I have set up a Drupal 7 web site with a few custom blocks and menus written by me. I have a non-Drupal PHP script displaying users (some of them are external, i.e. not stored in drupal tables) as a ...
2
votes
3answers
2k views

How to create new node programmatically, when a new user is created, in Drupal 7?

At the time when a new user is created, I want programmatically to create a new node (of some defined type) and make him the owner of that node. How can I do this in Drupal 7 ?
33
votes
5answers
32k views

Node count for taxonomy terms

How can I display the node count values for taxonomy terms with sorting the result list in descending order of node count?
0
votes
1answer
2k views

Displaying external SQL-table as paginated list

The following code works well for displaying a paginated list of Drupal users. function generate_list() { $query = db_select('users', 'u') ->extend('PagerDefault') ->fields('u', array('...
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?
13
votes
8answers
13k views

How to improve Drupal speed when developing in localhost

I'm looking for tips from other Drupal developers to make Drupal faster when developing (specially Drupal 7) Taking in consideration that during development you don't want cache, so you can see the ...
5
votes
4answers
3k views

How to use the $delta argument?

How do I use the $delta argument in hook_block? I have tried to used one, but there wasn't any effect. What is the correct way to do this?
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 ...
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
874 views

Last form validation function is passing an error even though the first one registers the user

I wrote a custom user_login form validation function that calls user_external_login_register() to register and login the user, but the last validation function for the form calls form_set_error(). ...
2
votes
2answers
100 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. ...
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 ...
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
3answers
3k views

moving *.tpl into "templates" folder, but Drupal does not recognize them. How?

I am building a custom theme. Currently, I put all the overridden *.tpl files under the theme root folder; it would be more clean and meaningful to put those files under "mytheme/templates", but ...
8
votes
1answer
3k views

Custom module with its own menu?

I am in the process of writing my 3rd custom module and this one is my biggest challenge yet. I know how to use hook_menu to generate menu items, and depending on the path you choose determines where ...
3
votes
2answers
2k views

How to support legacy url alias' and/or support multiple url alias' (Conditional Pathauto?)

I am migrating a site from wordpress and need to preserve my url structure whilst supporting native pathauto urls in the future (for new content) Overall Drupal's clean url process is almost ...
8
votes
4answers
14k views

Is it possible to redirect after "pushing" a file to the user?

I've got a setup where a site generates internal analytics about site usage. Users are able to request a download of their personal analytics, and because this information is sensitive I do not create ...
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 ...
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 ...
3
votes
2answers
3k views

Displaying SQL-table as a paginated list

I'm trying the following and it works: my.module: function my_menu() { $items['page_example'] = array( 'title' => 'Page Example', 'description' => 'Page Example', ...
5
votes
2answers
967 views

views with a SOAP back end

views3 supports plugable backends rather than a RDBMS, there are backends for solr, sparql, mongodb. Is there such a plug in to enable views to be a front end for a SOAP api? I have found a number ...

1
524 525
526
527 528
530