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

Adding menu dynamically

I am trying to add a menu option dynamically from within a module. Basically, the menu will be inserted into the menu tree when the specific content type is called.

I can get it working by using the menu hook in my module, but it dumps it into the top level of the navigation menu. I actually want it to be inserted into the primary links menu, a few levels down.

Anyone have experience with this? anyone at all....

btw, this is the code that is generating the menu:

subscription module: how to??

I am sure I must be missing something. Installed subscription module, read everything I could find (even the code). I still cannot figure out how I would assign a particular user to receive email every time any new content of a particular type is posted.

How do I do this? Thanks

Create Page with Tabs

Hi, I have read through the API documentation on the Drupal Menu System, and have seen that if you want to add tabs to a page then you should declare the "type" for your new menu item as "MENU_LOCAL_TASK", but I have been unable to get it to work the way I want to, and I can't seem to find an example here on the site about how to build tabbed pages. Can you help me?

Here is my current menu's code:

Help needed - I made a change to user_menu and locked ALL accounts out of the site

Ok, I'm a fairly seasoned Drupal programmer, but I screwed up and managed to lock myself out of the site I'm developing.

I was trying to setup access rights to certain 'user/xxxx' paths, to prevent anyone who might know Drupal from accessing them, as I created alternative paths with alternative pages to handle all the necessary functionality.

Unfortunately I added an 'admin' level access right to the plain old 'user' path in the user_menu() function, then opened 'admin/modules' to apply the changes and that's where things went wrong.

Forms API and with and Custom date

Hi There,
I am having sone dificulty getting my hook_update to recognise and update my 'date'.

I can do update with other fields ok.

 $day= format_date($node->work->date_of_work,'custom','j');
  $month= format_date($node->work->date_of_work,'custom','n');
  $year= format_date($node->work->date_of_work,'custom','Y');
  $form['date_of_work'] = array(
      '#type'          => 'date',
      '#title'         => t('Date of Work'),
      //'#default_value' => array('year' => 1997, 'month' => 1, 'day' => 1),
          '#default_value' => array('day' => isset($node->work->date_of_work) ? $day : 1,
                                    'month' => isset($node->work->data_of_work) ? $month : 12,
                                    'year' => isset($node->work->date_of_work) ? $year : 1989
                                    ),
      '#description'   => t("Date of the work if known"),
    );

If I substitute $node->date_of_work['year'] for a integer it works fine.
How do I get the value out of this array, please?


function catres_update($node) {
db_query("UPDATE {cr_work} SET
title = '%s',
date_of_work = '%d',
WHERE nid = '%d' ",
$node->title,
HOW to get this value ???
mktime(0,0,0,11,11,$node->date_of_work['year']),

Example Codes for "FrontPage" Design

Hi All:

I would like to create my Frontpage in a "newspaper" type format. Currently I am using the Democratica theme in a simple blogging format. If you have a good Frontpage layout that resembles those used by newspapers - then can you please share with me?

Thanks,
Dkaps

Pages

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