This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Block images are not showing on node pages.

I developed a block in Drupal 7 which carousel the static or dynamic images using Javascripting and jQuery. Problem is that block is showing images on "index", and "article" content type pages but when i view the "nodes" or drupal default pages such as "user/register" then block dose not show the images.

This is the code

Programmatically removing terms from a Node ?

Hi,

I am creating a theatre ticketing service: the (numbered) seats for a show are taxonomy terms.
I use taxonomy super select checkboxes and some theming/css/jquery to create a colored seating chart.

When a booking is made:

  • that booking has a nodereference to a show
  • the booking is tagged with the seats
  • the show is tagged with the same seats

This way I can look up what seats are taken for a date, and seats already in the show are inactive checkboxes through theming.

So far so good, now; As I understand it:

  • There is no function for deleting a term from a node ?
  • I have to make a $terms-collection sans the unwanted term and taxonomy_node_save() the entire new collection ?

If I remove a booking-node, the corresponding seats on the 'show'-node should also disappear.

So: when I remove a 'booking' node, I hook into _nodeapi, op=delete.

<?php
function seats_nodeapi(&$node, $op) {
if ($node->type=='booking' && $op=='delete') {
// seats stored in this booking:
$bookedseats = $node->taxonomy;

// seats stored in this show
$nid=$node->field_show[0]['nid'];
$show_node=node_load($nid);
$taken = taxonomy_node_get_terms($show_node);

// diff to create a term-collection without the seats from the node that is being deleted.

Sub Tabs, Pulling my hair out

Hi everyone,
ive been hunting around for a solution, but ive always had issues with sub tabs on the menu,
I am developing a module and need to implement second level tabs, i have the following code but after a whole day of trying i cant seem to get the second level tabs to show.

I though it may be a application_load (custom function) or application_to_arg problem but they all seem to be working, just cant seem to nail it, im hoping someone will be able to spot the issue in a second.

basically after the 'user-portal/my-applications/%application' is where id like the second level tabs to be

<?php
$items['user-portal'] = array(
'title' => t('User Portal'),
'page callback' => 'hqsportsfinance_blank_callback',
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM,
'weight' => 10,
);

$items['user-portal/home'] = array(
'title' => t('User Portal'),
'page callback' => 'hqsportsfinance_blank_callback',
'access arguments' => array('access content'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => 10,
);

$items['user-portal/my-applications'] = array(
'title' => t('My Applications'),
'page callback' => 'hqsportsfinance_my_auctions',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK,
'weight' => 11,
);

Making a menu item available for non admin users

Good morning,
I developed a simple module called "Gestione Pratiche" and I defined a menu item for that.
The problem is that I defined this menu item as "admin/pratiche/", so the menu is shown under Admin parent.
The Administrator has no problem, but I need to allow a couple of non administrative user to use the module! Once I log in as a normal user I cannot see the menu item and I cannot reach the module pages even if I write the address directly.

How can I make the module available to these users?
Off course I'd like to show the module administrative pages into the admin theme and not into the front-end.

Any suggestions?

Here's the code, if you need it:
<?php
function gestione_pratiche_menu() { // front end page
$items['pratiche/form'] = array(
'title' => t('Consulta lo stato della tua pratica'),
'page callback' => 'form_gestione_pratiche_empty',
'access arguments' => array('access content'),
'description' => t('Gestione Pratiche'),
'type' => MENU_CALLBACK,
'file' => "gestione_pratiche.inc.php",
);

$items['pratiche/status'] = array( // front end page
'title' => t('Consulta lo stato della tua pratica'),
'page callback' => 'form_gestione_pratiche_render',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => "gestione_pratiche.inc.php",
);

First module contrib to community

Hi,

Last week I've created a sandbox project of my module that I would like to contribute to the community.
So after creating the sandbox project I applied for a full project.

But then I'm a bit confused, how does it go to a full project so that people can download a released version of my module?

Thanks!

Is simpletest check node content?

Hi,

Is it possible to access node contents and check it for some existing text using simple test script.
for example:

my node is like:

http://drupalsite/node/100

which contains some text and i want to check some word exist on it or not then i can directly check it by
using

function testexample(){
$this->drupalGet('node/100');
$this->assertText('hello','hello text should exist');
}

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions