Posts about Drupal 7, jQuery, PHP, CSS3, Swift 2.0, and SpriteKit

Equal inner table cell spacing - just CSS width and padding

11 months 1 week ago

Instead of padding the left and right side of all your table cells you only want to pad the inner cells.  You want the table of images, perhaps, to fill the entire content area, but you want the images spaced the same inside the content.

Also, you may not have control over the markup of the site, and need to just use width and padding for the four cells.

Cleaning up the old images in your Drupal 7 Drealty realtor site

2 years 4 months ago

Update, this is an old method not using drush. The best way to do this is actually use the routine Drealty provides: drush -u admin rets-purge-inactive

Only Set The Viewport Width For Mobile Devices

2 years 5 months ago

I know I am going to need this again. This saved me from a decent into madness figuring out why I couldnt get the iPad view to look right. Normally I don't make the iPad view of the site responsive. I just give the user the desktop experience. So setting the viewport to always use "width=device-width" was making the iPad have to scroll to see the 960 pixel width.

Changing The Default Value Of A Form Field In Your Custom Drupal 7 Module

3 years 5 months ago

I guess I couldnt stay in the dark about hooks forever.  They are actually quite useful.  Here was my problem:

I am using a custom profile type for a drupal commerce site in drupal 7.  It is a simple profile type with one simple text field called "From Name".  All I wanted to do was have this be prepopulated with the default value from their last order.  

How To Easily Make A Quick Module In Drupal 7

How To Easily Make A Quick Module In Drupal 7

3 years 6 months ago

I still dont completely understand hooks and all that.  This is maily to have a library of functions you can use across themes.  I used to put everything in template.php, cause ya know, it works.  However then when i was in my admin theme i would get errors of "undefined functions."

Simple 3D Book Opening Effect For All Browsers

3 years 7 months ago

I first have to recognize this awesome web tool by microsoft.  It finally cleared up how to do this transition for me.  It shows a live preview of all these confusing css tranform properties.  As always, If you can get it to work in internet explorer you are pretty much guaranteed...

Browserstack helps you test your site in all browsers

Browserstack helps you test your site in all browsers

3 years 9 months ago

I always forget what site this is when I need it the most, so I'm listing it here.  This site is the perfect solution to test your site in a multitude of browsers.  I am always hearing from clients some wierd design issue on ie7 or ie9.  This site lets you virtually use basically every browser loaded with developer tools.

Drupal 7 subfolder forwarding error in the .htaccess file

3 years 10 months ago

This was an odd problem.  All of the sites on our server are in sub folders.  So this site is actually cowleyworks.com/macsaveny.  The problem seemed to occur out of nowhere, but my guess is GoDaddy updated apache in some form.  So at around 3:00 half of my sites lost their background styles.

Jquery Slide to Top and Bottom of the Page

Jquery Slide to Top and Bottom of the Page

4 years 5 months ago

Pieced together from the internet. This code should give you that nice slide action to the bottom and top of the page.

Simple Node Pager for the Menu System in Drupal 7

Simple Node Pager for the Menu System in Drupal 7

4 years 6 months ago

Ive been working with drupal 7 for about a year...  Self taught.  I like it.  

Its very coder friendly... But at the same time can be very intuitive for clients... As long as you set the site up correctly...

Using db_query in Drupal 7

Using db_query in Drupal 7

4 years 8 months ago

Quick script showing how to use db_query in drupal 7.

Also shown is how to get the location module to sort by distance using "Use PHP code to determine latitude/longitude" given a zip code argument.

$zip = '';
if (isset($_GET['zip'])){
  $zip = $_GET['zip'];
}

Inserting a View anywhere in a page in Drupal 7

Inserting a View anywhere in a page in Drupal 7

5 years 1 month ago

Heres a simple bit of code that will let you insert a view anywhere in a node.  This is more efficient then making a page version of a view and giving it a path.

In my opinion this code is one of the most critcal snippets for any Drupal 7 developer.  Its a basic buiding block in any site I build.

You can still use your regular node formts/meta tags/etc.