codekarate
Customizing Drupal 6 Quicktab Styles
This is a guest post from Adam, my Co-founder at BEgINr Media
When finished: After you get through this tutorial you will have made a custom Quicktabs style in Drupal 6.
This is how to do it.
Stuff I am assuming:
...you have downloaded the Quicktabs module from Drupal.org and Install it.
...you have a photo editor (Gimp, Photoshop, etc)
Drupal 6 Ubercart Theme Add to Cart Form
So you need to theme the Add to cart form that is output by Ubercart? If so, read on for more information. If you are looking to change the general theme or style of the Ubercart product node page, then you might want to look at my post on theming Ubercart Product Page for Drupal 6.
Post Topics: Drupal Drupal 6 Ubercart Drupal PlanetDrupal 6 Override views pager theme function
It is possible to override a specific pager for a specific views using a theme function in your template.php file. Here are the steps needed:
Theme Views Pager Step 1No matter how you want your pager to look, make sure to select mini pager within views. This will allow you to take advantage of the views pager theme hook patterns. I was unable to get this to easily work when using the full pager.
Depending on how you want your pager to look, you can start with either the code that produces the views mini pager or views full pager using the options below.
Post Topics: Drupal Drupal 6 Views Drupal PlanetDisable Personal Contact Form in Drupal 7 Contact module
In the comments of a past post discussing best Drupal modules, it was recommended not to use Webform for contact forms. So for a project I am currently working on I decided to just use the Drupal 7 contact module that comes with core Drupal.
I have used this is the past and it works just fine. My requirements were simple, "provide a site-wide contact form that authenticated users can use to contact the site admins". On the surface it seems simple enough.
Post Topics: Drupal Drupal Planet General DiscussionThe best way to learn Drupal
I often get asked what is the best way to go about learning Drupal or the best way to get started with website development. Because of these questions, I decided to put together a list of things I wish I would have done first, when I started to teach myself Drupal.
Learning Drupal Tip #1 - Getting Started Post Topics: Drupal Module Development Theme Development Drupal Planet General DiscussionTop Ten Best Drupal 7 Contrib Modules
Over the years I have used hundreds of Drupal contributed modules and have written a lot of my own. However, I thought it appropriate to compile a list of my 10 best Drupal 7 contrib modules that I don't think I could live without.
Criteria for my best drupal 7 modules list Post Topics: Drupal 7 Drupal Planet General DiscussionDrupal 7 Views Exposed Filters in Blocks (and panels)
Ran into a views and panels issue today that was very simple to fix, but difficult to track down. Here is my situation in case you run into a similar views/panels issue.
I have one Drupal 7 panel page that does a lot of visibility rule filtering based on the path of the panel. Depending on the path, I have different pieces of content that show up. In some situations, this may be a view (othertimes it is static content, custom coded blocks, etc).
Post Topics: Drupal Drupal 7 Panels Views Drupal PlanetDrupal 6 Fixing Stuck Cron Run
If you have ever seen this in your Drupal 6 log, I feel your pain:
Attempting to re-run cron while it is already running.
So what is going on here? Basically, a cron run started and for whatever reason did not finished... and frankly, probably never will. So the first question:
How to I get the Drupal 6 Cron Unstuck?This is fairly easy to do. There are three easy ways (choose the one that works for you):
Drupal Force HTTPS (ssl)
There may come a time where you need to force a user to see your site under HTTPS. If you only have one site on the server, you can easily add something like this to your apache config file:
Redirect permanent / https://www.domainname.com/
Theme an image field in Drupal 7
If you have a node with an image field in Drupal 7 and need to manually print the image, here is a quick code snippet for theming the image:
$my_image = array( 'style_name' => 'my_style', //the image style created 'path' => $node->field_my_image['und'][0]['uri'], ); print theme('image_style', $my_image);
As you will notice, the image field is called "my_image" and is accessible from $node->field_my_image['und'][0]
You will need to make sure you set up "my_style" inside the Image Styles section in the D7 Admin interface.
Post Topics: Drupal Drupal 7Drupal 7 Deleting Organic Group content
Ran into a situation today where I had to delete content from a group programmatically. Basically I have a setup where a group can only have one of a specific type of content posted to their group at any one time. I have it set up so a user can control which one is posted into the group but it needs to restrict them to only allow one.
Post Topics: Drupal Drupal 7Drupal 7 Add Node to Organic Group (OG) programmatically
Needed an easy way to add content into an organic group using Drupal 7. I ended up using the og_group function provided by Organic Groups (in the og.module file). Here is the quick solution that worked for me.
//Get the group id $gid = 25; //Get the full node that needs to be subscribed to the group $node = node_load(17); //Set the values $values = array( 'entity_type' => 'node', 'entity' => $node, 'state' => OG_STATE_ACTIVE, ); //Add this node to the group $result = og_group('node', $gid, $values);
Post Topics: Drupal 7Recurly subscription integration in Django
In my last post I discussed setting up a Payment Form in Django for entering credit card information. Here is how I tied it in on the back-end to integrate with Recurly for the recurring payments on http://getpropeller.com.
I added the following to a file called subscriptions.py and added it to one of my Django Apps. It provides a light wrapper around the Recurly Python library.
class SubscriptionManager: """ A class that handles the subscriptions on Propeller """ def __init__(self, company):
Post Topics: DjangoDjango Credit Card Payment Form
Was not able to find a drop in example of a Payment form for Django that worked for me on http://getpropeller.com to hook into Recurly's API for recurring payments. I found a few Django snippets that got me close, but had to make some modifications to get things working.
Here is what I came up with for my forms.py file:
class CreditCardField(forms.IntegerField): def get_cc_type(self, number): """ Gets credit card type given number. Based on values from Wikipedia page "Credit card number". http://en.wikipedia.org/w/index.php?title=Credit_card_number
Post Topics: DjangoBlogging for Drupal
This is a guest post from Mitchel Xavier. Mitchel Xavier is a Drupal Developer for a Drupal web design company in Sydney, Australia.
Post Topics: Drupal 6 Drupal 7 General DiscussionDrupal 7 getting all members of an Organic Group
Simple function that gets a list of all users subscribed to an organic group.
/** * Get all users of a group */ function _get_users_in_group($gid) { $query = db_select('users', 'u'); $query ->condition('u.uid', 0, '<>') ->condition('u.status', 1, '=') ->fields('u', array('uid', 'name')) ->join('og_membership', 'ogm', "ogm.gid = :gid AND u.uid = ogm.etid AND ogm.entity_type = 'user'", array(':gid' => $gid)); return $query->execute(); }
You can then loop through the results using something like:
Post Topics: Drupal 7
Django dynamically retrieve and serve PDF file
I am using Recurly for recurring payments on the Propeller website. This site is a Django web site running on Heroku. I needed to fully integrate recurring payments so I opted to use Recurly's API instead of any type of hosted or JS form version. This required a good deal of work (and it is still not finished) but is definitely worth the effort.
Post Topics: DjangoUsing Virtual Environments in Django
At first I was a little hesitant to virtual environments in Django. Not because I didn't think it was a good idea, but because it seemed like a lot of extra work. After finally spending some time learning more about it, I can tell you that overall it is pretty easy and I would highly recommend it for all Django development.
Using Virtual environments not only makes rebuilding your environments easier, it also makes deploying to a service such as Heroku or Google App Engine possible. Here is the general workflow I use when dealing with virtual environments.
Create environment Post Topics: Django

