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
4
votes
1answer
989 views

Avoid redirect to comment page if comment is invalid

I have configured comments to display in the node page, but if submit an invalid comment (e.g. without text in the comment field) I get redirected to the /comment/reply/ page. I would like to remain ...
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 ...
2
votes
2answers
1k views

Drupal filters are not cacheable

I have a Drupal 7 site with many custom filters. Everything works correctly, but not quick. It looks as though the filter cache system does not work properly because the cache_filter table is always ...
2
votes
1answer
534 views

How to adjust the display order

The HTML structure is the following one: <div id="contentp"> <p>.........</p> <p>.........</p> <div id="rate-node-18-1-1" class="rate-widget rate-...
1
vote
2answers
2k views

Fields in page.tpl.php

I want to display in my page.tpl.php 3 custom fields form the latest content type added to my website. I have a custom content type called "Articles" with three custom fields, field_1, field_2, ...
3
votes
2answers
2k views

How to make a MENU_LOCAL_TASK on a user's profile only appear on their profile?

I use logic like this to place a tab on each user's profile page so users can view analytics from the usage of a WebApp: // maps a url to a sub-page of user's profile, url to user's Analytics-...
1
vote
2answers
1k views

Views Slideshow Output different in IE vs Firefox/Chrome/Safari

A site I'm working on is using Views and the Views Slideshow plugin to generate a tabbed panel on the site. We modified the output of the plugin to display link names instead of IDs, which worked ...
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 ...
7
votes
3answers
10k views

Views 3 and HTML5 - how to override output for markup?

I have a view that I've created that selects blog posts based on a specific taxonomy term, creating a sort of "Featured Posts" view that I've embedded on the front page of my site. The issue I keep ...
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
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?
0
votes
3answers
696 views

How do I echo the node vocabulary in preprocess_page or in page.tpl.php so that I can test against it in Drupal 7?

I need to be able to echo the vocabulary that is associated with a node, but I need to echo it either in the preprocess_page function in template.php OR somewhere in page.tpl.php. I can't seem to find ...
2
votes
2answers
2k views

default routing of custom module

I'm trying to write my first module and am using the hook_menu to route the pages. The module consists of a multi-step form and two static content pages. /** * Implements hook_menu(). */ function ...
8
votes
1answer
2k views

Testing installation profile with custom tasks

For a large project, we are using a code driven development workflow. We are using a custom installation profile to install and configure the contrib and custom modules used on the project. The ensure ...
10
votes
3answers
19k views

How can a user access only one specific node, and not all nodes of that type?

I have a user with view and edit rights to a specific content type. This give the privilege to all users to view and edit all the nodes of that type. But actually, I want to create for each user a ...
6
votes
7answers
12k views

How to redirect toward a specific node from front-page in Drupal 7?

I have a multi language site made in Drupal 7. And I want to check if I am on the front page then if true to redirect the user to a to some specific node. I have tried different methods: to create ...
7
votes
6answers
10k views

Attaching existing server files to filefield

How do you set an existing file path for a file field, in Drupal 7? The only option I see is to upload the file again. In Drupal 6, FileField Sources seems to do this. Does FileField Paths or IMCE ...
6
votes
2answers
8k views

How do I resolve the "Argument 1 passed to drupal_attributes() must be an array" error on my system_settings_form()?

I don't usually post specific questions like this, and ask for help on a specific issue but I am at the end of my rope wasting time way... I have a simple D7 module as seen below, when I load the ...
1
vote
4answers
284 views

Multiple "unused" Views displays

I'm creating a heavily customised website in Drupal. I want to use Views as a data source for a page with several options, where each option corresponds to a different display in a View. The reason I ...
1
vote
2answers
1k views

Node Access table goes empty

I currently have a project where I am inserting mulitple records into Drupal using node_save. Its usually a couple of hundred at a time. For some reason, sometimes the node_access table ends up empty, ...
3
votes
1answer
4k views

Are taxonomy fields exposed to views?

I am trying to create a view of nodes that have a taxonomy reference field. I can get the taxonomy term but do not see the taxonomy fields that I've created exposed to views. Google searches do not ...
5
votes
3answers
2k views

External JS libraries

I have a few external js files that I call in my page, at the moment these are called via script tags in the header. I am tempted to pull these locally and include them in my themes script file to ...
6
votes
2answers
5k views

Are "files[]" from custom_module.info not included on form submits?

I have a module that I am porting to Drupal 7 (specifically, Taxonomy Views Integrator) and there are 2 include files tvi.admin.inc which were included via the module's .info file: files[] = includes/...
3
votes
1answer
4k views

Custom default value for Webform's select options component

I use Drupal 7 with Webform 7.x-3.9. I have created a new component from type "select options". I also have chosen to display it as a listbox and I've populated it with a few strings from the type "...
3
votes
4answers
3k views

How to hook theme of the main system menu in drupal 7 to display only some of the elements?

I want to modify the main system menu in Drupal 7. Actually I want to display only some specific elements of the menu and hide some other specific elements, in a given case (which I will implement by ...
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>&...
31
votes
13answers
24k views

How can I disable a single checkbox in a 'checkboxes' FAPI element?

Title basically says it all, I want to disable a single checkbox of a checkboxes type FAPI element. I don't want to do if with JavaScript, nor is changing it from checkboxes to multiple checkbox ...
2
votes
2answers
833 views

Can I have a views field handler with an exposed form, or a filter handler with pre_query?

It's basically in the title, but here's the question: I'm trying to create a way to allow the user looking at a view to control which columns are visible. This isn't very hard, provided I can get ...
41
votes
9answers
45k views

How do I change a theme based on the URL?

I have a Drupal instance running on example.org. Which has a theme X installed and activated. Now for a limited period an event is supposed to be held on the site for which a special section has been "...
14
votes
4answers
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 ...
7
votes
2answers
3k views

What is the equivalent of theme_menu_item in Drupal 7?

I know that in drupal 6 exist: theme_menu_item, but in drupal 7 there is not. Is there any replacements so that I modify the output for main system menu ? Actually I want to do a kind of filter of ...
3
votes
2answers
4k views

How can I use conditional logic to not display a <div> in page.tpl.php based on node id?

I'm using a theme that has regions not supported by Panels' "Disable Drupal blocks/regions" settings. I've tried to remove the using an if statement in PHP, but either my PHP syntax is wrong or I'm ...
11
votes
10answers
6k views

deleting comments in bulk

how can I delete all comments at once? I have seen how to do it with nodes and bulkdelete module, How to delete all nodes of a given content type? but am looking at a similar solution for comments. ...
2
votes
2answers
3k views

hook_preprocess_page: "node_load() + node_page_view()" versus "%node + node_page_view()"

A basic node (nid "123") exists and a module registered two paths using hook_menu: first/%node second Both page callbacks use node_page_view($node) to display a fullpage view of the node, except ...
1
vote
1answer
3k views

Drupal 7 Views Contextual Links edit Nodes and Fields

I created some Views with Drupal 7 and also installed the module Contextual Links. It helps me to edit Views and Blocks. But for non-admin users like Editors etc. it would be great to even edit Nodes ...
2
votes
2answers
922 views

How to create a node revision view with a "Node" row style?

Is it possible to create a node revision view with a "Node" row style? This does not seem to be an option in the Views interface. "Fields" is the only options presented for this type of view. Is ...
3
votes
1answer
260 views

How do I get backslashes to save?

Everytime that I type a backslash into a textbox on my drupal site (in content editors, administration pages, you name it; I mean any textbox), it gets filtered out before it reaches the module code. ...
1
vote
3answers
1k views

Add custom permission to specific module "group" on permissions page

Using a custom module, how can a permission be added to a core/contributed module "group" on the permissions page without hacking the core/contributed module? Example:
8
votes
1answer
8k views

What is the URL to set the admin theme?

The URL to change the admin theme isn't the same in Drupal 7 compared to 6. What is the new URL?
7
votes
10answers
8k views

Stopping Drupal 7 spammers registering at mysite.com

I have a new Drupal 7 site at mysite.com (address changed) - a CentOS 5.5 Linux machine in my full control. By reading registration mails (they run through my Gmail account) I've noticed, that Drupal ...
5
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,...
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 ...
4
votes
4answers
6k views

Overriding a View table layout in module

I'm trying to override a view table from within my module. I can't locate what the arguments are suppose to be and in what order (for my hook_theme func). I copied the theme file from views/themes and ...
5
votes
1answer
3k views

Remove specific stylesheets from a given page

Adding a stylesheet to specific pages is easy: implement hook_preprocess_page(), call drupal_add_css(...) and set $vars['styles'] = drupal_get_css(). But what is the proper way to remove a stylesheet ...
3
votes
2answers
415 views

Adding a Space Context Condition

I want to add a condition of what type of space is currently active on the site. Does anyone know of a module that supports this? I notice that spaces is setting a context for us, but I cannot find ...
3
votes
2answers
2k views

How to expand the fieldsets in node-add form?

When I am adding new node by admin/content/node-type/story, there are a lot of settings ordered by groups: Submission form settings, workflow setting, comment settings. But all these fieldsets are ...
1
vote
1answer
162 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 ...
3
votes
3answers
904 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 ...
3
votes
3answers
857 views

Create an image repository

I'm trying to create an image repository with Drupal, but I face some problems. I want to create a node with several images attached, but since the relation between images to nodes can be many-to-many ...
5
votes
4answers
3k views

Can I use simple XML to feed views?

I want to use the power of views to handle my data which comes from simple xml representing just a grid resp table <list> <listpos id="12312"> <foo>attr1</foo> <...