drupal

using views argument in the view tpl.php file

hello all. i am a newby to drupal. here is my problem: on my main page.tpl.php i have this code lines: "if ( $is_front == TRUE ) { print views_embed_view('all_product_by_type_thin', "default", "canon"); print views_embed_view('all_product_by_type_thin', "default", "Nikon"); }" as you can see, in case of the front page i print the "a...

Possible to have drupal read from a sql database?

I have a site under drupal (using mysql) but need it to read from a external sql database and make quires/reports, maybe using views2? Is is at all possible? I been looking for a solution to just read (not import, its thousands of entries...) from an external database for hours and not sure if its even possible. ...

Drupal form autocompleted with data from a database by ahah, how to do it?

I'm trying to do it for hours now, and I just can't do it. What I want is: A radio or select drop-down with varying options (from the database). This part is ok, it's just a query and building the options. Then there are 3 text fields, each option from the above form has data for these 3 text fields. When the user clicks/selects one ...

Wordpress and Drupal on the same domain cause htaccess conflicts?

Have a client who wants to move their Wordpress.com blog over to their main domain that has a Drupal installation. If I add Wordpress to a "/blog/" directory on the server, will there be any conflicts with the htaccess ie Mod Rewrites etc? Thanks. ...

Customizing ubercart shopping cart items

Does anyone know how to customize the shopping cart page for ubercart (Drupal 6.x)? I would like to add the SKU field in the 'desc' column under the product title and some other things.. like Shipping Time: 2 Weeks. So the 'desc' column should look like this: Product Title SKU: Model1 Shipping Time: 2 Weeks Much appreciated for any ...

How to build a website that allows clients to upload content and then allow certain users to download that content.

Ok, I ll try to be as concise as possible. What I want: I want to build a website that will allow clients to sign up for a small fee and allow them to upload content to their UNIQUE USER FOLDER. General users will then be able to sign up for free and request to download specific files from various clients (not just one). Administrato...

Drual form in tabular layout

I am trying to render a tabular layout (html table) for a form such that first cell contains a checkbox. $form = array(); $res = query('SELECT * FROM {mytable}'); $rows = array(); while($row = db_fetch_array($res)){ $record = array(); $checkbox = array( '#type' => 'checkbox', '#attributes' => array( '...

Generating secondary menu based on node titles

I would like to generate a secondary menu based on the first letter of all of my nodes that have a certain content-type, however I am unsure how to go about doing this. Basically, I will be generating an alphabetical list of all nodes that I have (for a given content-type). For instance, I would like to have my secondary menu generate ...

Show Drupal taxonomy subcategories (subterms) on a node page

Hi there, I would like to ask some Drupaler for help. Is it possible to show the subcategories of a taxonomy term on a node page? Let's say that a have taxonomy like this: category 1 subcategory 1 subcategory 2 ... And I want for Ubercart product to show on a node page that an item from category 1 has following s...

Using Optimized CSS and JS by Drupal for other files outside Drupal

Hi! I think my question would be better laid if I write here the scenario of our current set up and the things I want to achieve. We have a Drupal 6 site and freemarker files that are using the same theme as Drupal. Now I have to optimize the loading and reduce the file dependencies of the freemarker files to CSS and JS. I was told to us...

Drupal flash questions

I received from the client .flv files, and used SWF Tools to embed a different video in the right sidebar of each page. Now the client wants that changed, to .swf files. (I understand that both the .swf file and accompanying .flv file need to be present for this to work). Do I still use SWF Tools, or something else? Thanks in advance...

Increase number of login attempts per user or per role in Drupal

Is it possible to increase number of login attempts before blocking an account for a certain user or role in Drupal? (not for all users) Or even never block a certain user regardless of number of login failures? Thanks. ...

Drupal adding extra spacing in text

I am on Drupal6, and even with the WYSIWYG disabled, something is putting in white space where I don't expect it. For example if I enter: <p>HI there (you)</p> All is good. If I enter: <p>HI there (<strong>you</strong>)</p> I get a space between the opening parentheses and "you": Hi there ( you) When I save and go back in to t...

Is it better to cache an element in the block/view or the panel?

I am creating a panel page that will pull in blocks from a view? I want to cache these blocks. So is it better to enable caching of that element in the panel or do it where it was created in the block/view page? Or does it matter? FYI, There are other areas of the page that are too dynamic for me to cache the entire page using other ...

Drupal 6 Views: Multiple Dependent Navigation Displays

Assume a collection of nodes that we want to display in a view. Like all Drupal nodes, they have a published-on date. Assume that we want to organize them by that published-on date. Now, what I want is a page with TWO different navigation blocks. One that looks like this, where each year is a link to that years' posts: 2006 | 2007 |...

drupal json server, objects with ## symbol in javascript?!

I am using the services module in drupal a long with the JSON Server, and I am accessing it using jQuery this works great, but I have one small problem. Drupal/JSON Server always seem to return objects with the # symbol, which I don't really know how to handle, this prevents me from doing object.property Because in reality it's object...

What is the correct way to change the active Drupal theme programmatically?

What is the correct way to change the active Drupal theme programmatically? ...

Drupal Image Attach only need 2 image sizes for my content type

When I use image attach it's creating too many extra images that I don't need. I created a content type called "content_area_4" with Image Attach allowed. I then created an image size called "content_area_4_thumbnail" with a Scale & Crop of 160 x 130. When I go to create a node type of content_area_4 with Teaser image size: content_area_...

Drupal imagefield: save as .png

Where would I hook in to the imagefield api to set the filename of the destination file? I have figured out how to convert the file, but not how to save it as whatever it was + '.png'. ...

Can I truncate sessions and watchdog table in Drupal?

I have 16 million rows in these 2 tables in Drupal.My sites are slow and these 2 tables top the slow query log. Can I safely truncate them? Also, issuing a truncate command, hangs the system. Is there a way I can delete rows in batches? ...