drupal-6

Select a template through the admin area?

Up to now, I've always hard coded what page template a certain page should use, either based on the URL, or what type of node it is. What would be really useful is if there was a way to select which tpl file to use, right there in the node edit form. This would allow the user to flick between different page layouts at will. Does anyone...

How do I attach file information after saving a file

I'm currently working on a Flash application that needs to save files to Drupal. I already saved the file to the Drupal site with the File service, but I can't get to attach the file to the node with the node.save service (Upload module, not CCK file field). The object that I will transfer with node.save looks like this in AS3 : var no...

Add subitem to second level

I have primary links created manually. The are links to node (content type 'page') like -About --About Us --About company I need to add subitems About/About company/company1 and About/About company/company2 from my module. Next lines create menu item in first level (in one level with -About) $items['about2'] = array( 'menu_name' ...

how to make drupal pages into menus and submenus like administrator menu

Hi everyone, I'am new to Drupal, i just want to create a website which contains pages like about us, contact us and other static information that may be changed after a long time. Now i can create the pages and sub pages to main pages. The links are displaying on the top of the logo and the sub pages were showing on the side of the mai...

Importing 60,000 nodes :(

hi, I'm using Table Wizard + Migrate module to import nodes into my Drupal installation. I need to import around 60,000 questions / answers (they are both nodes) and I thought it would have been an easy task. However, the migrate process imports 4 nodes per minute, and it would take approximately 11 days to finish the importing. I wa...

How to assign custom role automatically on registration?

I am using a hook form alter to override the registration process. I want to assign a custom role that i have defined to the new user. How do i get about doing that? I see that there is a users_roles table. Would simply making an entry in it with the user id and role id do the trick? Thanks ...

How to display a custom profile based on a specific role?

For example I have a role called "teachers". For any user that belongs to that role, I want to be able to display a custom profile that is different then the main one. I read at some place that one can make a tpl file in the pages folder of the theme and some how it could be made to show for specific roles or URL path. Would anyone care...

what's the point to have hook_mail_alter if I already have hook_mail ?

hi, what's the point to have hook_mail_alter if I already have hook_mail ? For example, I saw that hook_mail_alter is used to add a footer to my mail message. But I could use hook_mail to add it, instead of using 2 functions... what am I missing ? Maybe it is done to add the footer after some other function is invoked ? thanks ...

How to get rid of 0-width empty button in Drupal

I am using fivestar rating module with Drupal Acquia Slate theme. This rating system works with both javascript enabled and disabled. In first case you click on the star and the voting is done, in second case there is a button with 'Rate' label and a dropdown list. The problem is that with js enabled there is a 0-width empty button that ...

Is "Similar Entries" or "Similar by Terms" a better module for listing nodes similar to the one the user is currently viewing?

I'm looking at these two modules for a "Related articles" style listing: Similar by Terms Similar Entries Any opinions on either of them? I have a tag system set up so searching by terms would be fine, but it hasn't been updated as recently as the other module. How reliable is "Similar Entries"? Anyone have any field experience with ...

Module created page - cached?

Hi there, This should be a very simple question, but I'm finding it surprisingly hard to find an answer. I'm creating custom pages using hook_menu that have both static content and dynamic aspects, (mainly from sql queries and views embeds etc...). My question is, how does drupal's cache system treat these custom pages? I'm concerned...

Display new module in site

hey there i am new to drupal , i created a new module base on this example http://api.drupal.org/api/drupal/developer--examples--page_example--page_example.module/6/source i just changed the module name and method to my module new name 'jtpc' and change the jtpc_perm to this function jtpc_perm() { return array( 'access jtpc ...

Refreshing existing nodes to pick up Automatic Nodetitles in Drupal

I have a set of existing nodes for a content type ('foo'). Since then I have installed the Automatic Nodetitles module, which has helped tremendously, since I no longer need to work hard to make standardized names for each node of that type. I have used Automatic Nodetitles in conjunction with Tokens to create an automatic title naming p...

Drupal Slowness Trouble Shooting

I have a Drupal site that is running slowly. What are the best ways to trouble shoot the slowness? Each page load takes ~11 seconds. Once the page has been accessed once it is cached and is fine. How do you increase performance for anonymous and logged in users? ...

Custom theme footer problem

I have finished my theme for drupal, was working fine but with no site name and slogan on but when i turned it on something gone bad my footer has got spaces in it, one on top and one on bottom if i turn them off gap is still there, I don't know what is happening no margin's set. Any suggestions. ...

How does the Drupal 6 Batch API work?

I've been using the Batch API successfully to do processing that would normally lead to PHP timeouts or out of memory errors, and it's been working nicely. I've looked through the code a little, but I'm still unclear about what's happening behind the scenes. Could someone familiar with the process describe how it works? ...

Theming views block naming conventions

Hi! I just try to style the block of a view called sidegalery. I placed a file called block-views-sidegalery-block_1.tpl.php in my themes folder which is working. But now I read in the views documentation and found that "Theme: Information" link in the views UI. There the filename views-view--sidegalery--block.tpl.php is suggested. ...

Does the Auto Assign Role Module not work with Custom form registrations?

I have a custom user registration form at: somepath/register using hook form alter. I set up auto assign role by path to "/somepath/register" and it does not seem to assign the role that I am wanting. Does Auto Assign only work with content profile and not hook form alter registration ? ...

Embed node creation form using PHP

I have a content type called "enquiry". I want to embed the node creation form at various places throughout my website. How do I do this via PHP? ...

How to hide new content type from create content menu

Hello guys I am a newbie in drupal, i have created a new content type 'new', I have two type of roles Editor and manager. Editor must be able to add content in to the new content type but manager wont. I have specified in the module code that function new_access($op, $node, $account) { switch ($op) { case 'create': return use...