Drupal Planet

Syndicate content
drupal.org - aggregated feeds in category Drupal Planet
Updated: 4 hours 7 min ago

Drupal Association News: Take Our Quick Survey on Webinar Topics

Thu, 2013-05-09 09:10

Last month, the Drupal Association launched a webinar series with the goal of providing more educational opportunities for the community. Our first webinar was on Spark and it was a great success with 500+ registrants. We are excited to do more!

But, as we mentioned in a previous blog post, before we move forward we want to hear from you. What topics do YOU want to learn about?

Personal blog tags: webinars
Categories: Drupal

EchoDitto Tech Blog: Speed up PHP on NFS with turbo_realpath on CentOS

Thu, 2013-05-09 08:54

If you run a website based on PHP, and have your source files on a network file system like NFS, OCFS2, or GlusterFS, and combine it with PHP's open_basedir protection, you'll quickly notice that the performance will degrade substantially.

Normally, PHP can cache various path locations it learns after processing include_once and require_once calls via the realpath_cache. There's a bug in PHP that effectively disables the realpath_cache entirely when combined with open_basedir. Popular PHP applications with Drupal and WordPress make heavy use of these functions to include other files, so you would very quickly notice the drop in performance in this scenario. If you want to isolate your websites from each other (or from the rest of the operating system), how can you retain any shred of performance?

This is where Artur Graniszewski's turbo_realpath extension really comes in handy. I won't retype his installation instructions, so follow the previous link to get it installed manually.

If you're running CentOS 5 or CentOS 6, check out yum.echoditto.com and you'll find source and compiled RPMs that will install alongside the RedHat/CentOS-supplied PHP packages. The RPM will create a basic configuration file at /etc/php.d/turbo_realpath.ini. Essentially, it enables the PHP module but defaults all settings off, so you will need to read the comments (taken from Artur's most recent post on turbo_realpath) to determine how you want to use it.

Configuration

We frequently use turbo_realpath on a per-VirtualHost basis with Apache 2.2 and mod_php. If you use PHP-FPM, you can apply similar settings in your FPM pool configuration files. If you install our RPM and don't edit /etc/php.d/turbo_realpath.ini, add something similar to the following to each VirtualHost:

<IfModule php5_module> php_admin_value realpath_cache_basedir "/var/www/vhosts/domain.com:/usr/share/pear:/usr/share/php:/usr/lib64/php:/usr/lib/php:/tmp:/var/tmp" </IfModule>

This is effectively the same using open_basedir; any directories referenced in realpath_cache_basedir will be the only ones the website is allowed to access, and they will be cached as determined by the realpath_cache_size and realpath_cache_ttl. If you look in php.ini, you may notice the default values for these are:

; Determines the size of the realpath cache to be used by PHP. This value should ; http://www.php.net/manual/en/ini.core.php#ini.realpath-cache-size ;realpath_cache_size = 16k   ; Duration of time, in seconds for which to cache realpath information for a given ; http://www.php.net/manual/en/ini.core.php#ini.realpath-cache-ttl ;realpath_cache_ttl = 120

You may want to increase these if you're finding your website is still not loading quickly. On our systems, we have bumped the realpath_cache_size and realpath_cache_ttl settings up to 1m and 300, respectively.

Speed and Security!

With turbo_realpath enabled, realpath_cache_basedir set to appropriate open_basedir-like values, and realpath_cache_size and realpath_cache_ttl increased from defaults, we're able to have isolated PHP sites and have better performance by caching the locations of included/required files effectively. Hopefully, our RPMs will help you on your system for a quick installation of the excellent turbo_realpath module!

References

Image from iAmFreeman

Categories: Drupal

LevelTen Interactive: Breaking up the Monolithic Drupal Site with a Subdomain Multisite

Thu, 2013-05-09 07:49

When building a Drupal website, do you ever notice that the site sometimes gets too complex and has too many modules installed? We run into this with clients that want a lot of features in their website such as commerce, forum, blog, knowledge base, and more.... Read more

Categories: Drupal

Six Mile Tech: Entity Rules - Exposing Rules' power without Rules' complexity

Wed, 2013-05-08 20:47

The new Entity Rules module for Drupal provides a new way to associate Rule components with events for different entities such as users, nodes and taxonomy terms.  This allows users who do not have access to the Rules UI to still configure when the Rule components are triggered for the Entity types that they can administer.  It also allows this user to specify values for the parameters that are sent to these Rules components.

Categories: Drupal

OpenSourcery: DrupalCon PDX: Pinball Pub Crawl!

Wed, 2013-05-08 17:48

As many of you know DrupalCon Portland is coming up in just a few short weeks. We here at OpenSourcery are very excited about this and we're looking forward to this rare opportunity to show off Portland to the greater Drupal community. 

In fact we are so excited about DrupalCon PDX that we're going to be throwing a Pinball Pub Crawl Party along with Network Redux. What is a Pinball Pub Crawl you ask?

The party will be from 5-10pm Thursday May 23rd.  

We'll start our evening off at OpenSourcery's offices where there will be free beer and free Hot Lips pizza. Greg Dunlap (heyrocker) will teach a brief "how to not suck at pinball" course (complete with special 'Pin Cam' AV projection technology) and you'll get a chance to put his advice into practice with free play on the four pinball machines at OpenSourcery. We'll also have foosball, ping pong, table games, a pinball tournament, and oh so much more!

But the night doesn't end there! Our free shuttle will then take you on to a Portland must – Ground Kontrol, a pinball and video game mecca for a private evening of free play from 7-10pm.   

Feeling more like a walk? Those who wish can make the journey to Ground Kontrol on foot, stopping along the way at a few of Portland's best local bars, all of which have their own uniquely Portland character and pinball to boot. 

If you're worried about getting here don't be! We will be running a free shuttle between the convention center, OpenSourcery, and Ground Kontrol from 4:30-10:30 pm!  Tickets are free and can be reserved here.  

Space is limited  and we expect the party to fill up qucikly so reserve your spot now. Only guests who have signed up in advance will be allowed into OpenSourcery and Ground Kontrol on the event night. Sorry, this event is for 21+ attendees only.

Categories: Drupal

Mike Crittenden: Making a Drupal bookmarklet

Wed, 2013-05-08 15:16
Down with copying and pasting!

Last weekend I built/launched Frugalzon, which is a little hand-curated list of cool stuff on Amazon for $10 or less. (It's still new and fairly empty, but give it time!)

The Drupal site itself is simple--one content type, one view, one taxonomy, that's pretty much it. The only interesting aspect comes in the form of content entry. Since the whole point of the site is to be hand-picked items, I couldn't just pull some Amazon feed of cheap products. I had to manually add each of the items on there (and I continue to add a few items per day) by choosing stuff I think is cool. To make this easier, I made a bookmarklet that scrapes the info off of whatever Amazon product page I'm looking at and pre-populates a node add form on Frugalzon with that data.

So there are two things at work here: page scraping and prepopulation.

Page scraping

The first part of the bookmarklet gathers up the relevant info on the Amazon product page I'm viewing. This includes:

  • Title
  • Price
  • Prime shipping or regular
  • Image URL
  • Page URL (with my affiliate code added)
  • Category

For finding this stuff, the easiest method is to just use your browser's dev tools. Inspect the elements to find a unique selector to match them, and then test it out in the console. This can get a little tricky sometimes depending on the markup, especially on a site like Amazon that has a few different possible product templates each with unique un-semantic markup.

Here's the JS in my bookmarklet that does all of this on Amazon.

var frugalzontitle = jQuery('h1').text().trim(); var frugalzonprice = jQuery('.a-color-price, .priceLarge').eq(0).text().trim().replace("$",""); var frugalzoncategory = jQuery('.nav-category-button').eq(0).text().trim().replace('All ', '').replace(',', ''); var frugalzonimage = jQuery('#holderMainImage img, #prodImageCell img').attr('src'); var frugalzonurl = document.URL; if (frugalzonurl.indexOf('?') > -1) { frugalzonurl += '&tag=frugalzon-20'; } else { frugalzonurl += '?tag=frugalzon-20'; } if (jQuery('#actualPriceExtraMessaging img').length > 0 || jQuery('#price img').length > 0) { frugalzonshipping = 'Prime'; } else { frugalzonshipping = 'Normal'; }

As you can see, Amazon includes jQuery in the page so we can use that (yay!). If the site you're scraping doesn't, then you can either load it in noConflict mode or just use vanilla JS selector hotness. You might also notice that I'm prefixing all of my variable names with "frugalzon" as a poor man's way of namespacing this.

So now we have all the data we need...what do we do with it?

Node prepopulation

There's a cool module called Prepopulate that lets you pass data to the node/add/whatever page as a query string and that data will prepopulate the form. So for example, going to /node/add/product?edit[title]=Something would make the Title field have a default value of Something when the page loads.

This works great, but it can get a little hairy with different field types (Image URL, taxonomy term reference, plain text, etc.) because each field type has a different array path in the $form array in Drupal. Luckily, this is documented and all you have to do is view the source to see what the name attributes of your form elements look like to know what to pass.

In the end, here's what my JS looked like to build the URL to hit.

url = 'http://frugalzon.localhost/node/add/product?'; url += 'edit[title]=' + encodeURIComponent(frugalzontitle) + '&'; url += 'edit[field_price][und][0][value]=' + encodeURIComponent(frugalzonprice) + '&'; url += 'edit[field_url][und][0][value]=' + encodeURIComponent(frugalzonurl) + '&'; url += 'edit[field_category][und]=' + encodeURIComponent(frugalzoncategory) + '&'; url += 'edit[field_shipping][und]=' + encodeURIComponent(frugalzonshipping) + '&'; url += 'edit[field_image][und][0][filefield_remote][url]=' + encodeURIComponent(frugalzonimage) + '&'; window.open(url, '_blank');

You'll notice that the Image field is passing in a URL which is handled via the filefield_sources module. Also, the Category field is a tag-style term reference field so whatever gets passed in there will be fine; you don't have to match up tid's to existing terms or anything.

Putting it all together

So now we have our bookmarklet code (here's a full gist) and we're set up to handle it on the Drupal side (using the Prepopulate module), so we just need to make an actual bookmarklet out of this thing.

I used this online tool for that. Paste in your JS and it'll crunch it and build a little link for you to drag to your bookmarks bar. This worked like a charm. Now, adding products to Frugalzon is as simple as clicking the bookmarklet on an Amazon product page and then clicking "Save" on the prepopulated node add form. Not bad!

Hey, maybe you should follow me on Twitter!

Categories: Drupal

Trellon.com: New CRM Core Releases, and What to Expect

Wed, 2013-05-08 14:30

Today, Trellon released new versions of CRM Core and CRM Core Profile. Both of these modules include new features that are important for anyone looking to build modules that use CRM Core as a backend for storing contact information.

These releases are part of our Garden Party roadmap, as part of the 'Live Music' stage. They are for site builders and developers looking to build modules and features that expand upon CRM Core's basic capabilities. With them, you have some more powerful tools for working with contact records stored in your Drupal site, and they include some usability enhancements based on feedback we received as part of the 0.91 release of CRM Core.

I wanted to share a little about what you will find, and why it is important.

read more

Categories: Drupal

Acquia: Drupal Camp Scotland 2013 Double-Header

Wed, 2013-05-08 10:36

This week's podcast features two Drupal Scots: Duncan Davidson (recorded live in a back alley right after Drupal Camp Scotland 2013) and Brian Ward (recorded via Skype, post-event). Duncan is the Scottish regional manager and UK Professional Services Manager for i-KOS and Brian is a developer at heehaw.digital in Edinburgh.

duncan-n-brian_final.mp3
Categories: Drupal

Lullabot: Announcing Our 5th Annual DrupalCon Party

Wed, 2013-05-08 09:30

DrupalCon Portland will be happening in a few weeks and, as usual, Lullabot will be out in force. Our entire team will be there and we'll be spending our days training (4 classes) and presenting (8 sessions). We'll also be hanging out at both the Lullabot and Drupalize.Me booths in the exhibit hall. As usual, we've got a lot going on.

Categories: Drupal

Drupal Association News: Sponsored blog post: Where should Drupal professionals focus for the next phase of growth?

Wed, 2013-05-08 08:51

As part of the Diamond and Platinum sponsorships for DrupalCon Portland, we've offered leaders at these sponsor companies the opportunity to guest blog on the Drupal Association site. In today's post, Robert Douglass of Commerce Guys takes a look at where Drupal is today, and the untapped opportunities for Drupal growth in e-commerce.

Personal blog tags: sponsor blogDrupalCon Portlandguest blog
Categories: Drupal

Aten Design Group: Project Review Wednesday: Content Reminder

Wed, 2013-05-08 07:52

There are currently 98 new Drupal contributors awaiting review of their first project. This is a great place to contribute to the community and learn about interesting upcoming projects, for example...

Module: Content Reminder What does it do?

Publishing content feels great. There's a sense of accomplishment and it's there for the world to see. However, that content oftentimes needs to be checked on and updated. Instead of letting a page languish, alone and forgotten, you can use the Content Reminder module to set up reminders to check on it.

Content Reminder adds a notification tab to each node, allowing a user to create a notification to be sent to a site's user with a customizable message and date upon which it should be sent. Now you can ensure that your site's content is fresh and relevant, not forgotten.

Zoom Look Useful? Review it!

If you would like to see this module readily available on Drupal.org, you should review it and help make that happen.

Review It

Pro Tip: If you've never reviewed a project application before, you can find instructions for reviewers on Drupal.org and the Code Review group is happy to help more people get involved.

Categories: Drupal

Pronovix: Drupal for the European Commission: BoFSession at DrupalCon Portland 2013

Wed, 2013-05-08 07:47

This is a guest post by Mathew Lowry from Intrasoft International. We suggested him to write this post as a preparation for a BoF session his colleague will be organizing at DrupalCon Portland. If you are working on a Drupal platform for government or for a bigger organization that wants to standardize on Drupal as a communication platform for a series of its departments, and if you are attending Drupalcon Portland, come and join us to discuss best practices and lessons learned.

Categories: Drupal

Acquia: Notes from Views Mini-Course, Part II: Creating Flexible Views with Drupal

Wed, 2013-05-08 07:45

Here are notes from the 2nd class in our Views mini-course.

Categories: Drupal

Microserve: Drupal.org - Contributing a Module & The Review Process

Wed, 2013-05-08 07:40

I recently went through the process of contributing my first Drupal 7 module, and while the process isn't too hard there were many things that would have been helpful to know at the start rather than finding out half way through the process. As a result of my experiences I've decided to put together this blog which covers many of the common pitfalls people run into and provides a collection of useful links to various bits of documentation on Drupal.org.

How It Works

When you first register at drupal.org you will only be able to create sandbox projects, once you've created your first sandbox project you will be able to apply for full project access. Applying for full project access means your sandbox project will have to go through a review by the community, once that's approved you will gain full project access and wont have to get any future projects reviewed.

Getting Started

The first thing you'll need is an idea of what the module you want to create will do, once you've come up with the idea check that there aren't existing modules that do the same thing and make sure what you are trying to do should be in its own module and not just part of another existing module. If your module is too similar to an existing module then your project application will be declined, and any hard work you've put into the module will have gone to waste. For more information on duplicate modules see collaboration rather than competition.

Creating a Sandbox Project

Creating a Sandbox project is fairly straight forwards, but be sure to check out tips for a great project page or for even more project page tips How to make your module description useful. Your project application may be delayed if the description of your project isn't sufficiently detailed.

When setting up Git for your new sandbox project if you follow the instructions provided you will end up with a master branch, unfortunately this isn't actually correct, Drupal requires that you work out of a major version branch (7.x-1.x for example) instead of master. You will need to change this before your project goes for review, read through Moving from a master to a major version branch to find out how to do this.

Coding Your Project

Getting your code to meet the standards expected by Drupal is quite easy, it does however involve reading through a lot of documentation, these are the bits I found most useful:

Once you've read through the above and written some code there are some handy tools available to check that your code complies with Drupal's standards:

  • The Coder module which checks your module code on your local Drupal installation.
  • ventral.org which can be used to test your code once it has been pushed to the repository on drupal.org.

If either of the above tools pick up any errors they will be brought up in your project application, and you will be expected to fix them however trivial they may seem.

 

Applying for Full Project Access

Before you apply make sure you check that the sandbox module you are going to apply with meets all of the requirements listed in the Project application checklist, also note you can only apply for full project access with one sandbox module.

When you're ready to apply for full project access read Apply for permission to create full projects for guidance. Once you've done this you will need to obtain a review bonus. Although the documentation suggests obtaining a review bonus is optional in practice, it truly isn't if you want your module to be reviewed in any sensible amount of time.

To get the review bonus you will need to review three other modules, see Review bonus for guidance on how to do this. Make sure that your review of the other modules is sufficiently detailed as your review will not be counted if it's just a copy of the results from ventral.org.

Once you have your review bonus add the tag and you should find your module being reviewed shortly after. Note though if any major issues are found you will not only have to fix them but will have to re-earn your review bonus so it's well worth reading the standards documentation etc... beforehand as it will probably save you time in the long run.

 

Good luck with your module!

Categories: Drupal

LevelTen Interactive: Using Drupal 7 Entity Reference to help Create User Dashboards

Wed, 2013-05-08 06:55

Over the years, I have noticed a significant increase in the need for businesses to create user dashboards from which their customers are provided account details, up-to-date reports, downloadable documents and other important information. As more clients ask for user-driven websites that provide user-specific information, the need to relate or reference various types of content/data together is becoming commonplace.... Read more

Categories: Drupal

Drupal Easy: DrupalEasy Podcast 105: Men in Tights

Wed, 2013-05-08 06:38
Download Podcast 105

Bob Kepford (kepford) from The Weekly Drop joins Andrew Riley, Ted Bowman, and Mike Anello to talk about how Bob mines nuggets of Drupal goodness from the weekly Drupal firehose. Other topics discussed include Panopoly, open-source project statistics, the impending Google Reader apocalypse, Open Atrium 2.x, and a bunch of other mostly Drupal-related topics.

read more

Categories: Drupal

Amazee Labs: How Drupal "Views Auto-Refresh" really works

Wed, 2013-05-08 06:27

Views is a great module and as you'll probably know it is the most downloaded module in Drupal's history. The possibilities which Views provides you with are almost endless but there is one limitation. The generated output of a view is by default static. What if you want to have a dynamic activity stream as you know it from Twitter or Facebook?

Allow Drupal's unofficial slogan to answer that question: There is a module for that! The module in question is "Views Hacks" and contains another module called "Views Auto-Refresh". There is a blog post about how to implement this module in order to get it to work as you want to, but it seems like this post doesn't cover all of the aspects that are implemented in the "dev"-version. A follow up blog post offers a little more insight, but still not everything I needed.

On a side note: In this tutorial we will use the "dev"-version of "Views Hacks", because the alpha was buggy at the time, and the implementation of the JavaScript part is not in the Drupal way anymore.

Preparation

Let's get started with the implementation. I assume that you have downloaded, installed and activated Views, Views UI, Views Hacks and Views Auto-Refresh. Further I assume that you have created a view for which you want to use the auto-refresh feature.

I will demonstrate the implementation of Views Auto-Refresh by showing screenshots of the actual project.

Implementation

Make the following configurations:

  • First of all, you need to duplicate your actual view as a view page. Give it a semantic name like "autorefresh".
  • Give the page a unique path as displayed in the screenshot above.
  • Also give an easy-to-remember machine name.
  • Make sure that the view is using AJAX.
  • Add the Content: Post date (with operator) or any other timestamp as a contextual filter (we used the "Content: Updated date"). Views Auto-Refresh will provide the timestamp needed.

Now head over to your view and add a "Global: Text area" with the text format "PHP Code" and add following code:

<?php print theme('views_autorefresh', array('interval' => '30000', 'incremental'=> array( 'view_base_path' => 'frontpage/autorefresh', 'view_display_id' => 'autorefresh', 'view_name' => 'articles', 'sourceSelector' => '.view-content', 'targetSelector' => '.view-content', 'firstClass' => 'views-row-first', 'lastClass' => 'views-row-last', 'oddClass' => 'views-row-odd', 'evenClass' => 'views-row-even', ))); ?>   As you can see, there is a base path and a display ID.
The base path equals your defined page path, and the display ID equals the Machine name of the auto-refresh View. "interval" defines how often the auto-refresh View is being called while "view_name" is the machine name of the actual view.

The additional settings are the selectors and classes which will be addressed by the JavaScript of Views Auto-Refresh. I don't want to dig too deep since they should be self describing.

Now you might think that everything is done. But no, wait, we have to add the same code to the header of your original view. So do the same thing there as I have described it above. Please make sure that this view also uses AJAX, else it wouldn't work.

Further possibilities

In our project we use the jQuery library Isotope which sorts all the posts dynamically on loading or resizing. But you have to trigger the re-layout of the page if the Views Auto-Refresh has delivered some new posts. This is really simple and straight forward. You just have to add a Drupal behavior in your JavaScript like this:

/** * Add functionality to trigger reloadItems after an autorefresh */ Drupal.behaviors.triggerIsotopeAfterAutorefresh = { attach: function(context, settings){ $('.view-id-articles').bind('autorefresh.incremental', function() { //getting the content/context $isotope = $('.view-id-articles .view-content'); //reload all items by original order $isotope.isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' }); }); } }

As you can see, you can just bind the event 'autorefresh.incremental' to execute your own code. 'autorefresh.incremental' is fired every time the Views Auto-Refresh module loads the designated view.

Conclusion

After a few trial and error attempts, I finally figured out how Views Auto-Refresh really worked. There is a lot more to this module that isn't documented. So it is much more powerful than I can describe in only one blog post. So go on and give it a go.

Update 9.5.2013: As pointed out by Phil Dodd in his comment the Views Auto Refresh module has been moved to its own home at http://drupal.org/project/views_autorefresh.

 

Categories: Drupal

Mediacurrent: How to Prepare Your Website for Drupal 8

Wed, 2013-05-08 06:21

Drupal 8 may seem a long way off but we are approximately 6 months away from its target release date in fall 2013. Though Drupal 8 won’t be released until all critical issues have reached zero (Are you helping get there?) there are things you can do now with your Drupal site to prepare for Drupal 8’s release.

Categories: Drupal

more onion - devblog: Unraveling a Field-API mystery (or the journey of field item data)

Wed, 2013-05-08 04:23

During development of the pgbar module I often ran into Notices for something in $items. This time I said to myself: Let's get this straight once and for all. So I've inserted some debug code into my module to track which field related hook can manipulate data and in which order they are called. You can see the result in the dot-graph at the bottom.

Tags:
Categories: Drupal

Modules Unraveled: 061 The Walkthrough.it Project with Kristof Van Tomme - Modules Unraveled Podcast

Tue, 2013-05-07 22:00
Walkthrough.it
  • What is walkthrough.it?
  • I heard that this works with Selenium in the background
    • What is Selenium?
    • How does Selenium make this awesome?
  • How is this related to the Tour module in Drupal 8 core?
  • How do you record walkthroughs?
  • How do you play walkthroughs?
  • You recently finished a crowdfunding campaign on IndieGoGo, can you tell a bit more about
    that?
  • What things did you promised as part of the campaign?
    • WalkHub: walkthrough server distribution,
    • Walkthrough module for Drupal
    • really awesome t-shirts
    • WalkHub.net: GitHub for interactive tutorials
    • An iPad application with introductory tutorials for Drupal distributions
App
  • What is this iPad app for?
Drupal Module
  • Can you tell me a bit more about the Drupal module?
  • Will there be versions for both Drupal 7 and Drupal 8?
Grand prize: documentation of a distribution
  • You promised that you would document 1 distribution with walkthroughs if your IndieGoGo
    campaign would be a success. Do you already know which one will win?
Categories: Drupal

Powered By