This forum is for assistance with theme development.

Customize ubercart module

Hey guys, how are you?

Guys, I'm from Brazil and I started with Drupal 5 or 6 months ago, and now I'm with a great doubt to customize drupal.
The project is an e-commerce and I'm using ubercart.

The client is asking for a required page before access the cart list!

For example:

The normal way is = Access the Product Page -> Add to Cart -> Cart List -> Checkout -> Finalize the purchase.

What I need to do = Access the Product Page -> Add to Cart -> Required Page -> Cart List -> Checkout - Finalize the purchase.

Having difficulty theming Node edit "Save / Delete" buttons

Hi, I have a couple of images I designed to replace the "Save" and "Delete" buttons on my node edit page.

https://dl.dropbox.com/u/8495276/1304/buttons.png

I studied up on how to replace the default buttons with images like this. However, it appears my code is not entirely correct.


function MYTHEME_form_alter(&$form, &$form_state, $form_id) {

  if($form_id == 'FORMIWANT') {

    $form['actions']['submit']['#type'] = 'image_button'; 
    $form['actions']['submit']['#src'] = drupal_get_path('theme', 'MYTHEME') . '/images/MYSAVEBUTTON.png'; 
    $form['actions']['submit']['#attributes']['class'][] = 'MYCUSTOMCLASS'; 
}

The code above actually works fine; it replaces the Save button. The problem is when I add the following code which is intended to replace the Delete button:


    $form['actions']['delete']['#type'] = 'image_button'; 
    $form['actions']['delete']['#src'] = drupal_get_path('theme', 'MYTHEME') . '/images/MYDELETEBUTTON.png'; 
    $form['actions']['delete']['#attributes']['class'][] = 'MYCUSTOMCLASS'; 

When I add this code, both buttons appear nicely - but they don't function correctly. Specifically, both buttons end up performing the same action. If you click my Save button, it wants to delete the node! :(

styling a tabbed menu, how to deal with "menu-xyz" classnames in sytlesheet

hello,

i made a custom tabbed menubar, that uses background pngs for list items of the different menuitems.

now, the classnames which drupal prints out are something like:
menu-476

how can style these elements elegantly without hardcoding these class names in the css?

eg. at the moment i would have to do style:

Best practice: "path_to_theme()" or "$GLOBALS['theme_path']" ?

Some developers use a different method each to call scripts for instance.

So there are two ways:

  • drupal_add_js("/" . path_to_theme() . '/scripts/myscript.js');
  • drupal_add_js($GLOBALS['theme_path'].'/scripts/myscript.js')

We were told the second one ($GLOBALS) is rather unpredictable. Is that right?

What is the best practice to call these kind of scripts anyway?

Show/Hide certain markers on GMAP view

Hello,

I am using GMAP module on Drupal7 for Google Maps. I am using it with Views module.
Have created map view with markers from content type. Everything works fine.

Now I want to be able to show and hide some markers (not all) based on for example some category or any node field. How can I manipulate (just show and hide some of them) markers outside the view? Or maybe there is a possibility to do it within view?

Thanks.

need help cleaning up a very messy theme modification - "submenu" shows in footer

hello,

i just inherited a very messy and hacky site with a modified "framework" theme.
i managed to clean up some of the css, but i am far from done.

please forgive me if my questions seem silly, however i am kinda new to drupal.

my main problem at the moment is the display of "<h2>submenu</h2>" on top of the sites footer.
i cannot seem to find where this gets generated.
in the page.tpl i have

Pages

Subscribe with RSS Subscribe to RSS - Theme development