We'd like to help you with your project.

We're based in St. Louis, MO, and we specialize in Drupal/web development (website, module and theme development) and mobile app development.

We also provide some awesome, inexpensive web services like Hosted Apache Solr Search and Server/Website Uptime Monitoring.

Like us on Facebook or follow us on Twitter.

Midwestern Mac, LLC

Below, you can read through the latest blog posts from Midwestern Mac, LLC. We blog about Macs, Drupal, web development, app development for the Mac and the iPhone, and whatever else suits our fancy!

Gzip/mod_deflate not Working? Check your Proxy Server

Recently, I was troubleshooting performance issues on a few different websites, and was stymied by the fact that YSlow repeatedly reported an F for "Compress components with gzip," even though online sites like GIDNetwork's Gzip test were reporting successful Gzipping of text components on the site.

Gzip Failed
Yslow results - not very happy.

After scratching my head for a while, I finally figured out the problem, hinted at by a comment on a question on Stack Overflow. Our work's proxy server was blocking the 'Accept-Encoding' http header that is sent along with every file request; this prevented a gzipped transfer of any file, thus Yslow gave an F.

I set up a secure tunnel (using SSH) from my computer to the web server directly, and then reloaded the page in FireFox, and re-ran YSlow:

Gzip Works Again - Grade A

Allowing Organic Groups Administrators the Ability to Unpublish/Publish and Schedule Content

One requirement of the Archdiocese of St. Louis' website is that group administrators are able to publish and unpublish the content inside their groups, and they should also be able to schedule posts for automated publishing and unpublishing at a later time.

To do this, I used the following modules:

After enabling these modules, I spent a while in the Permissions page, and also created a new user role, "administer nodes." Ironically, I didn't assign the 'administer nodes' permission to this role, because doing so causes a huge mess ('administer nodes' gives waaay too much power to anyone except the site admin—it's best to leave that beast unchecked in most cases).

Scheduling and Publishing options inside a group

Getting a Views Page Display to Appear Inside an Organic Group

I have been hitting my head against a wall for a few weeks now, trying to get a few different Views-created pages to appear as if they were normal pages inside an Organic Group (meaning they would appear inside og-menu-enabled menus for that particular group, and group blocks would also appear on the pages.

After reading up on the thread "Organic Groups and Views 2", I found that I could use an argument to help solve my dilemma. Here's how I set up an argument for a particular view:

On the page display (I could've also done this as a default), I added an argument ("Organic groups: Groups") with the following properties:

Drupal: Make a Context-Aware User Login Link (PHP Snippet)

Many of the sites I design don't require a user login form on every page, especially if there are only a few people that will ever need to login. Instead, I like to simply provide a "User Login" link somewhere on the page (most often in the footer), so it's unobtrusive but there for those who might not remember to type in /user after the URL.

This presents a new problem, though: if you put a link to "example.com/user," then the person who clicks the link will be taken away from the page he was viewing to login, then he'll be directed to his user account page.

Luckily, Drupal lets you set a login destination in the URL, so you can redirect the user back to the page he was viewing after he logged in.

To do so, create a block with PHP as the input format (or insert this snippet somewhere in your .tpl.php template files), and use the code below:

<a href="/user?destination=<?php echo $_GET['q']; ?>">User Login</a>

Now you have a handy little link that will redirect a user back to the page he was viewing before he logged in.

Pages

Subscribe to Midwestern Mac, LLC