Drupal Commerce Display Products in a View

Drupal Commerce Display Products in a View

Monday, Oct 1, 2012
Recently I have been working with Drupal Commerce quite a bit, however, it can be difficult to get your views to display as required, especially as there is no way to specifically select the product entity inside views. So here are a few tips for getting your products to display in useful views. Drupal Commerce product reference relationships OK, so you want to display the products referenced (images prices etc) rather than the node that is linked to them. ...

Read more
Create An Output File From A SQL Query

Create An Output File From A SQL Query

Monday, Sep 10, 2012
Sometimes, keeping files as hard copy, or just being able to move things in and around using csv files or such like can be great. However, doing so when you don’t have access to a mysql client (like phpmyadmin) can be a bit tricky. Hopefully this script can help you out. Of course you can change things inside it to make a whole wealth of different files with different data inside it. ...

Read more
Updating embedded content from the database

Updating embedded content from the database

Tuesday, Aug 21, 2012
This is part 2 (or a re-visit) of a previous blog post (Drupal Post Migration Data Cleanup) on updating content after moving it to another domain . If you have your data inside a multisite, you probably have some embedded some images/files into node bodies (or such like) and want an easy way to replace all of the instances. OK great. Using the REPLACE function in MySql you can easily replace instances where the url for the files is wrong. ...

Read more
Collapsible Fieldsets in Drupal 7 Nodes

Collapsible Fieldsets in Drupal 7 Nodes

Monday, Mar 12, 2012
After struggling with various adoptions for getting collapsible fieldsets to work within nodes for Drupal 7 I came across a final solution. Make adjustments to template.php (or in a module if you prefer): function THEMENAME_preprocess_html(&$variables){ // This function looks for node 1 and only adds the javascript for this. // However it can be extended in different ways if required if ($variables['node']['nid'] = 1){ drupal_add_js('misc/form.js'); drupal_add_js('misc/collapse.js'); } } In D7 you must also make sure that your legend contains a span with class fieldset-legend, and that your content is contained in a div with class fieldset-description, and that you include misc/form. ...

Read more
jQuery UI tabs inside a Drupal node

jQuery UI tabs inside a Drupal node

Monday, Mar 12, 2012
Following up on my previous post about collapsible fieldsets in drupal 7 nodes I recently wanted to just add some jQuery UI tabs to another node, and taking inspiration from my previous post about collapsible fieldsets in Drupal 7 nodes, made a little few edits to the template.php to achieve this as well. I actually made this to display vertical tabs from jquery ui, which is why the ui-tabs-vertical class has been added to the JavaScript, so if you don’t want that then just remove it. ...

Read more
Webform Function Overrides from template.php

Webform Function Overrides from template.php

Tuesday, Aug 16, 2011
So, it has been a while since I last blogged, probably because I have had a lot of work on recently, which certainly isn’t something to complain about. The latest little snippet I have for you is concerning webforms, and more specifically overriding the submit button with an image button. Basically when I searched around drupal.org, I found a range of differing answers, none of which appeared to solve the problem for me. ...

Read more
Drupal Post Migration Data Clean Up

Drupal Post Migration Data Clean Up

Thursday, Mar 31, 2011
Post migration data clean up, basically, most of the time when you develop a site you do it either under the default site of Drupal (sites/$new_url) or you do it under a different site (mynewsite.willhallonline.co.uk) with the intention of moving it to its own domain name when you have finished. Moving your data when you have finished on your new site is pretty easy. As most of the parts of your data are in the database, you can almost move to any file location and providing it is in the drupal root you will be fine! ...

Read more
Theme Ubercart Shopping Cart Block

Theme Ubercart Shopping Cart Block

Monday, Jan 17, 2011
So, you have a kicking Drupal Ubercart site but you don’t like the way that the shopping cart block works. Maybe you want it on one line. Maybe you want to change the structure of it? How can it be done? A little bit of investigation leads us to line 751 of uc_cart.module. function theme_uc_cart_block_summary($item_count, $item_text, $total, $summary_links) { $context = array( 'revision' => 'themed-original', 'type' => 'amount', ); // Build the basic table with the number of items in the cart and total. ...

Read more