drupal

In Drupal, how do you get the submit button to appear last on a create content form?

In Drupal, how do you get the submit button to appear last on a create content form without making the entire form from scratch? I can set the weight of the submit button using code, but it never goes below any custom fields I've created. If I drag a lot of custom fields from the bottom of the form to the top, the submit button only stay...

[Drupal] How can I programmatically add taxonomy terms to a node in hook_nodeapi()?

I am creating a module that needs to tag nodes with taxonomy terms when they are created. I have implemented hook_nodeapi() to do this, and am trying to add the term in there like so: function hook_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { switch ($op) { case 'insert': $node->taxonomy = array(1 => taxonomy_get_term(1));...

which CMS should i use?

can anyone tell me which CMS should i use as a beginner and some beginner's tutorials. I have searched over internet and there are two famous CMSes Drupal and Joomla. I have no idea which one is better between two. Can anyone guide me? ...

drupal how to enable menu translation by l10n_client?

menu translation module of l18n is already on but can't see the menu texts in the l10n ui ...

Fastest way to get HTML version of Drupal page?

I create a page called "blank" located at http://www.mysite.com/blank How can I download this page and get it as an HTML string in PHP? I know the PHP "file_get_contents" function could do the trick, but I would prefer a way where Drupal's API generated page with node ID X, and I can just grab the whole page generated as an HTML string....

Display Menu Title in Drupal please

I have a custom menu in Drupal. Here is the code I use to display it inside my theme (page.tpl.php): <h4>Site Information</h4> <?php print theme("links", menu_navigation_links("menu-teaser-05")); ?> Rather than display Site Information I would like to be able to pull out the Menu Title. Short of doing custom SQL/code can anyone help...

SimpleSAMLphp config problem ?

Hi All, I have configured simplesamlphp(SSO) for my project, but it gives the below error . 0: /var/simplesamlphp/lib/SAML2/Utils.php:104 (SAML2_Utils::validateSignature) 1: [builtin] (call_user_func) 2: /var/simplesamlphp/lib/SAML2/Message.php:210 (SAML2_Message::validate) 3: /var/simplesamlphp/modules/sa...

Drupal - customizing $scripts output

Hi, Basically the issue im having is I have a custom theme, and I need to use $scripts to call the analytics code at the top (the link tracking settings) however this also loads loads of other cr*p js files I dont need or want. All I want is the analytics stuff the module places in $scripts. So can I somehow either: A) Load only the ...

hook_form_FORM_ID_alter not called after 'Submit' or 'Preview' is clicked

Hi, In a custom module, I have the following (to add javascript to a particular form): function mymodule_form_mynode_node_form_alter(&$form, $form_state) { drupal_add_js(drupal_get_path('module', 'mymodule') . '/js/mymodule.js', 'module'); } This function does get called the form is first loaded (i.e. browse to http://myserver.com/...

No reaction for Menu trail condition for Drupal Context module

I'm using Development Seed's fantastic Context module (version 6.x-2.0) for Drupal 6 on a site that I am developing. Everything is working fine except in the case where I need to set a context for a particular menu trail. Perhaps I am misunderstanding the menu trail condition, but the context only exists when the defined menu item is a...

Drupal: Create Content Link Missing in Admin Menu

Hi ! The Create content link in my admin menu is missing. Any ideas ? Update: I am using Drupal 6.17 and the admin account. Previously I was using the 6.x-1.5 version of the admin menu. I updated to the 6.x-3.0-alpha4 to see if the problem was solved but nothing changed. ...

Decoding XML with base64_decode works fine in PHPUnit but returns UTF-16 encoded data in browser

I'm having some strange issues with decoding an XML snippet, contained with a cookie, with PHP's base64_decode function: In our PHPUnit tests, we can decode the XML and echo it out to the console and it prints XML as you would expect (all unit tests pass as well). As soon as we try running the same code in the browser, the decoded XML ...

Drupal: unwanted duplicated nodes

hi, I'm experiencing some bugs with Drupal on a server. Sometimes when I update a node, a copy of this node (with the same title) is saved and I have to delete the wrong copies. I suspect this is caused by the fUpload (multiple upload) CCK field, that allow you to upload multiple images. But I'm not sure about that, there is nothing in...

drupal questions - how to print a form from another module?

I'm trying to include a module form in a panel and I've tried using drupal_get_form(), but not sure I'm using it correctly. In the organic groups module, there's a function to render an og_broadcast_form. It's called within a page_callback in og.module: // Broadcast tab on group node. $items['node/%node/broadcast'] = array( ...

Proper way to include a jQuery library

I am working on a module for Drupal 7. I am using some of the jQuery UI modules which are included. my natural way to include these is to use drupal_add_js() and drupal_add_css() with the relevant files. However this feels a little wrong. Is there an official (or better) way to include these libraries, either from Drupal or jQuery. I ...

Is it safe to switch theme in drupal on my site?

I have a website with Drupal CMS behind it. I use a custom theme and I would like to change it but I am not sure if it is entirely safe, i.e. is it possible to lose some data, design, etc if I switch it back to my theme? What about blocks and their position if the theme uses different blocks layout. Thanks. ...

what is the difference between MENU_NORMAL_ITEM and MENU_CALLBACK?

thanks for your answers ...

Range search based on price field in drupal.

I have a CCK field price which the user can fill in. I would like to create a search form with dropdown price field with different ranges (such as below 100$, 100$-1000$, more than 1000$). The problem is that the user input is an integer so I cannot achieve range search using filter exposure. The user would have to specify the exact valu...

Drupal 6.17 just showing admin blocks

Hi ! I am using Drupal version 6.17 with RootCandy Dark 6.x-1.8 as the administration theme what happens is that Drupal shows the rootcandy regions on the blocks page even if I click on the site's theme. If I disable the administration theme everything works. I already tried to clear all the caches and nothing changes. Any ideas ? Tha...

What is a path from Ctools Modal to Modal Frame API

I wrote a module that uses the Ctools Modal Window to serve a form wizard. I would like to switch to using the Modal Frame API (which uses the JQuery UI Dialog as the modal). If someone has some experience making this type of switch in their code and can give me some pointers, I would appreciate it. Thanks, David Update: So I fin...