JQuery and AJAX content

I ran into a little problem with links in the content that was loaded into the page with jQuery. It turns out that jQuery attaches (binds) its functions to whatever objects (anchors tags in this case) you specify when the page is loaded.

Mobilizing Drupal

320 x 480 Safari screenshot

Here is a gallery site in Drupal that displays a Views grid of photos on the front page. It actually displayed fairly well on the iPhone since it is 960 pixels wide (which is what the iPhone assumes by default), but I wanted to serve a special style sheet to iPhones. Here's how I did it.

Mobile styling

screenshot

Click here to see the demo.

When writing code I always try to keep things simple and with smartphones, this is a really good idea. Compared to a desktop or laptop, a smartphone is a puny thing: much less screen area, and less bandwidth and processing power. Good reasons to keep those HTML and CSS files as small as possible.

Going mobile

Smartphones are the future

Since the iPhone seems to be the device of choice now (at least among my friends) I thought I would see if I could design a web page specifically for the iPhone, i.e. so it would look like an "app."

A little Facebook API

If you head over to http://developers.facebook.com you can get code that you can paste into your site. The feeds are served in iframes.

On this page, using my "As is" input format, I pasted the code for Activity Feed and the code for the "like" button.

Making one page look different in Drupal

Here is a demo page showing how to make one page a a Drupal site look different from the rest. One way to do this would be to add page-specific css to your style sheet (i.e. style.css in your theme's folder), but I don't want to add bloat to my theme just for one page.

Making a page with Views and Panels

A 5-minute screencast which describes how a page which lists some of the content on my site was set up using the Views and Panels modules.

A simple request

You know the story. You build a Drupal site. It's amazing. Then the client asks for 2 simple features to be added. And you can't deny that they are reasonable requests. If only you'd known about them when you started!

Views displayed in an accordion

This page features an accordion which contains 3 Views, each of which displays a list of articles tagged with the taxonomy terms "Drupal," "JQuery," and "CSS." (See the accordion at the bottom of the page.)

Adding elements to a page with jquery

If you go to one of my Magnifier pages, you will see, between the title and the image, the link "Back to Magnifier index."

This particular link is not provided by Views or by Drupal, but is added to the page by jquery. It's a situation that comes up surprisingly often - wanting to add something to a generated page.

It's fairly simple. In fact, it's just one line of jquery.

Syndicate content