Drupal News

DrupalCon Amsterdam: Convince Your Boss to Send You to DrupalCon Amsterdam

Planet Drupal - Mon, 07/07/2014 - 5:00pm

Attending DrupalCon is a great investment in skills, professional development and relationships. And it's also a lot of fun!

Here is your chance to demonstrate the value of attending DrupalCon to your employer.

We’ve developed a set of materials to help you demonstrate the value of attending DrupalCon to your employer.

Why Attend DrupalCon?
  • Learn the latest technology and grow your Drupal skills
  • Build a stronger network in the community
  • Collaborate and share your knowledge with others

Resources About DrupalCon - includes program summary, demographics, budget worksheet PDF Letter to your employer template Word or GoogleDoc Trip report template PDF Request a Certificate of Attendance Available following the conference.
Categories: Drupal News

Károly Négyesi: Easier configuration development for Drupal 8

Planet Drupal - Mon, 07/07/2014 - 8:56am

With config_devel, when you are editing a migration, you can just enter the name of the file being edited at admin/config/config_devel and on every request the module will check for changes and import the file into the active storage. The other direction works as well: say you are working on a contrib module and have a view. Provide the path of the file (this time in the auto export box) and on every change Drupal will automatically export. Once satisfied, just commit. Or perhaps you just want to follow what's in a config file as it's being edited -- provide sites/default/files/some.config.name.yml and it'll be right there on every save.

Both import and export are doable manually with the config module core provides. But I think the automatism makes life easier and I hope the module will be popular among D8 developers. Finally, let me thank beejeebus for cooking up the module originally and handing it over to me despite he knew I will rewrite it from the ground up.

Categories: Drupal News

SitePoint PHP Drupal: The Drupal 8 version of EntityFieldQuery

Planet Drupal - Sun, 06/07/2014 - 2:00am

Even though Drupal 7 core fell short of a proper way of handling its brand new entity system (we currently rely on the great Entity module for that), it did give us EntityFieldQuery. For those of you who don’t know, EntityFieldQuery is a very powerful querying class used to search Drupal entities programatically (nodes, users, etc).

It provides a number of methods that make it easy to query entities based on conditions such as field values or class properties. If you don’t know how it works, feel free to check out this documentation page or this great tutorial on the subject.

In this article I am going to talk about what we have in Drupal 8 for querying entities. There is no more EntityFieldQuery, but there’s an entity.query service that will instantiate a query object for a given entity type (and that implements the \Drupal\Core\Entity\Query\QueryInterface). We can access this service statically through the \Drupal namespace or using dependency injection.

First up, we’ll look at querying node entities and then we’ll see how to load them. The same techniques will work with other content entities as well (users, comments etc), but also with configuration entities, and that’s really cool.

The entity query service

As mentioned, there are two ways we can access the entity.query service that we use for querying entities. Statically, we can do this:

Continue reading %The Drupal 8 version of EntityFieldQuery%

Categories: Drupal News

flink: Earl's chicken

Planet Drupal - Sat, 05/07/2014 - 7:27pm

Here’s a little history I pieced together about, Drupal, the Views module and the human condition.

It must have been 4 years or so ago that the new Field API for D7 crystallises, requiring modifications to Views. So someone adds lines of code to make this happen. They don’t think much about those lines or the performance impact these may have. They don’t put a “hook” in to allow developers to alter the behaviour of those lines. Why would they? It’s a pretty trivial change. In fact it never crosses their minds to add the CPU cycles spent by that code to the view's performance stats.

4 years go by.

Nobody is aware that if you piled up the seconds collectively wasted in that code across all Drupal sites using Views over a period of 4 years, it would amount to like,…. like higher than the Eiffel tower. So to speak…

Until a couple of weeks ago some RdeBoer employs XHProf to find out why a client’s site is a little sluggish. And he finds those lines of code. And although there’s no hook as such to bypass those lines, he finds a way without hacking the Views module to neutralise those lines, offering a simple switch on the UI. Like a Turbo button, it makes selected Views run faster.

The customer is delighted. Now their site is finally speedy enough to go live! Another client quotes the results as “amazing”.

Encouraged by the happy customers RdeBoer tarts up his module to share it with the Drupal community. Now everyone can enjoy similar speed improvements. He writes a little blog post about it.

In a comment to that post @merlinofchaos confirms that those lines were indeed added with the introduction of the Field API. And that not showing how much time is spent in those lines is an oversight.

RdeBoer smiles. Takes a sip of his wine. 4 years... Isn’t life funny?

@merlinofchase goes back to the garden and throws another shrimp on the barbie. Metaphorically speaking. Might have been chicken. Have you seen Earl’s chicken? The photo above that’s his chicken. He cooked that last week. I would love a bit of that chicken. With its juices dripped over the veggies. Yummo!

Meanwhile @someViewsDude has a not-so-constructive go via Twitter, email and the module’s issue queue ...

My friend and colleague Susan concludes her writings with a beautiful phrase: “Breathe and do the next right thing”.

Maybe we can all sit around Earl's barbie. Try his chicken. It looks delish.

File under: Planet Drupal
Categories: Drupal News

Drupal 8 and iOS: Use Caching with NSURLRequest

Planet Drupal - Sat, 05/07/2014 - 6:45am
Use Caching with NSURLRequest

I am Vivek Pandya and I am working on Google Summer of Code 2014 project to build an iOS application for Drupal 8 site. In this article I am sharing my experience about caching retrieved data from Durpal 8 REST web service with in iOS7 application.

While writing iOS application that loads data(JSON) like a list of articles it is better to use cache mechanism provided by NSURLSession api. An NSURLRequest instance specifies how local cache is used by setting NSURLRequestCachePolicy values: with NSURLRequestProtocolCachePolicy, NSURLRequestReloadIgnoringCacheData, NSURLRequestReturnCacheDataElseLoad, NSURLRequestReturnCacheDataDontLoad etc.

The default cache policy for an NSURLRequest is NSURLRequestUseProtocolCachePolicy. While working with REST endpoint HTTP is default protocol so when NSCachedURLResponse does not exist for the request the NSURLSession will fetch data for that request.

If cached response exist than NSURLSession api will make HEAD request to the resource and check for cached data's validity by examining various response header like “Last-Modified” , “Cache-Control” etc. And if it finds data to be stale one it will load the data again otherwise returns cached data.

But, before using this cache mechanism at iOS side we have to make our Drupal site pages cacheable to do so navigate to “admin/config/development/performance” and set time limit value for page cache. Save the configuration. Now to verify whether Drupal has really enabled cache for pages or note try HEAD request with any REST api client like Postman, in response header you should be able to see “Cache-Control : max-age=<seconds>” here seconds should be same as you specified in configuration. See the picture below to get more clarity.

Now while creating request object with iOS SDK set it's caching policy to NSURLRequestProtocolCachePolicy. Now run the code , first time it will take normal time to load the data but next time onwards it will only reload the data if it has been changed or max-age value has expired.

For more details please refer to URLLoading system guide by Apple.

 

Tags:
Categories: Drupal News

Drupal core announcements: Drupal 8 core sprints, August 7-10

Planet Drupal - Fri, 04/07/2014 - 11:56pm
Start:  2014-08-07 (All day) - 2014-08-10 (All day) UTC Sprint

Summer is in full swing, but we know you enjoy Drupaling with your peers in the summer as much as any other time of the year! Plus, this summer is an important time to help get Drupal 8 done, so there is no good reason to skip getting together. We are holding two Drupal 8 sprints at the same time on August 7 to 10: one in North America at TCDrupal, and one in Europe at Drupalaton. Sprinters from both events will collaborate on Drupal 8 issues.

Twin Cities DrupalCamp (North America)

Twin Cities DrupalCamp hosts a four-day Drupal sprint, with a focus on unblocking the release of Drupal 8 and other topics like multilingual, accessibility, and Drupal.org. The last day of the event provides a mentored sprint which is ideal for Drupalers new to sprinting or the issue queues. The camp itself features keynotes from Holly Ross and Chris Shattuck, free Drupal training on the first day, and five parallel session tracks on the middle days. The event is in Minneapolis and Bloomington, MN and the early bird ticket is $35. If you need funding to attend, contact the organizers.

Sign up for TCDrupal sprints Drupalaton (Europe)

Great location for a summer camp in an affordable hotel right on the beach of the biggest warm water lake in Europe (with a tiny private island), Drupalaton sprints provide a relaxed environment to work and have fun together. The camp programme focuses on providing longer hands-on workshops with featured speakers Ruben Teijeiro, Campbell Vertesi, Adam Juran and Gábor Hojtsy. The event is in Keszthely, Hungary and the ticket is 50 EUR. There is a funding pool for sprinters who would not attend otherwise; contact the organizers.

Sign up for Drupalaton sprints

P.S. Even if you cannot attend in August, keep in mind we have 9 consecutive days of sprints coming up in September in Amsterdam around DrupalCon.

#node-431758 h3 { display: none; } #node-431758 h3.content { display: block; }
Categories: Drupal News

Lullabot: DrupalCon Session Selection

Planet Drupal - Fri, 04/07/2014 - 10:59pm

The session selection for DrupalCon Amsterdam has just been completed and will be announced next week. In this episode Addison Berry is joined by Steve Parks (steveparks), Pedro Cambra (pcambra), and Michael Schmid (schnitzel) to talk about how this actually works.

Categories: Drupal News

Makak Media: PhoneGap and Drupal 7 Data Synchronization for My Caribbean Offers App

Planet Drupal - Fri, 04/07/2014 - 10:34pm

In our last blog post we launched the My Caribbean Offers app for Android and Apple iOS.

The app displays offers for all types of tourist related businesses from across the Caribbean and is currently free to download!

We thought we'd share what went into building the app, the modules used and processes involved.

Client side requirements

Phonegap with local database (SQLite in our case), jQuery for ajax operations (http requests)

Module requirements

Views, Services, Custom module to save node deletions

read more

Categories: Drupal News

LimoenGroen company blog: The power of sharing

Planet Drupal - Fri, 04/07/2014 - 8:39pm
Scientia potentia est - Francis Bacon, 1597

Napoleon beat his opponents for years, despite his much smaller army. His knowledge of warfare and the armies of his opponents made him win the wars every time, and ultimately he was able to dominate Europe.

Knowledge is power > Sharing is power

The phrase "Knowledge is power" does not come out of thin air – where you could also explain power as influence, wealth or fame. However, in the knowledge economy of today is just having knowledge not enough. It becomes powerful when you can convey that knowledge. In the Open Source community we see that one who shares the most has the most "power". The real change agents, the core developers; they get done a lot because they not only know a lot, but also share this knowledge. And that goes in many ways: by writing a blog, giving a presentation, or simply just by contributing code.

Contributing code

Open Source is only good if people not only use it, but also improve it. Drupal is great software, but it has bugs. In the core itself, but (especially) in its thousands of community modules. If we discover a bug during a project we could fix this locally and continue with our work; our problem is resolved. However, we won’t. We always make sure that the solution flows back into the community. That can be done in several ways:

Contribute a patch

Can we solve the problem? Great! We create a new issue in the issue queue of the relevant module and deliver the code change as a patch. Example of Martijn: https://www.drupal.org/node/1783678

Describe the problem

Are we unable to fix it ourselves? Then at least create an issue and describe how the issue can be reproduced. This helps another developer to fix this, or recognize them their own problem quickly. Example of Dominique: https://www.drupal.org/node/907504

Start een nieuwe module

Did we write a separate piece of code that might be interesting for others? We’ll then try to offer this as a separate project. The extra time it takes to make a piece of client code generic and configurable is not an issue, knowing that the community as a whole can now help to improve and maintain the code for us. Example of myself, commissioned by the European Space Agency: https://www.drupal.org/project/commons_hashtags

Featured Drupal Provider

By sharing so much code we became one of the 4 Featured Drupal Providers in the Netherlands.

Taking equals giving

At LimoenGroen (Lime Green) everyone gets 10% community time: every other week, our employees have a full Friday to do what they think is important. They experiment with new technology, write a blog, or "open-source" customer code.

To make sure that the client agrees, we add the following boilerplate text to any quote that we write:

Drupal is developed under an open source software license. All, in the context of this project developed software falls under the same license as Drupal itself: GNU General Public License, version 2 or later. The intellectual property is yours. To take full advantage of the benefits of the open source development model, we believe it is important that we have the ability to develop parts of the software generic and share this with the community (with the mention that this is developed for <CUSTOMER NAME>).Appeal to Drupal suppliers

Taking equals giving is what I truly believe in. Therefore, I call on every Drupal supplier to include the text mentioned above in your offers. By doing so, there will soon be more to take! Who's with me?

Categories: Drupal News

flink: Drupal Views Accelerator

Planet Drupal - Fri, 04/07/2014 - 2:46pm

When caching is not an option, Drupal sites employing the Views module may find their performances bound by it. Getting to the bottom of this issue on a number of sites we discovered that performance benefits are to be gained in unlikely corners of Views. We published a first version of the Views Accelerator module for everyone to reap those benefits. You’re invited to give it a burl. A couple of clicks on the UI could be all it takes to put a smile on the performance dial.

From simple to more complex analysis tools

Did you ever pay attention to that spinning circle while your browser is fetching your page? While that wheel spins anti-clockwise your browser is waiting for a reply from the server to your mouse click. Then as the server response streams in, the wheel reverses direction and the browser builds up your page. Details of each and every file processed during that phase and how long it took can be found under the Network tab of your browser console.
But when it comes to improving that left-churning part, no amount of browser analytics can help you. This is when you bring out the big guns. Like XHProf, or for D8, the Symfony-based WebProfilerBundle.
And you get ready to get your hands dirty, as you may have to dig deep.

When caching doesn’t cut it

But why take the trouble to analyse all this? Why not tell your customer to throw a pile of caching technologies at the under-performing site?
Because depending on the nature of your site, caching can be ineffective and even lead to functional errors.

The reason is personalisation/customisation.

Increasingly websites recall specific details about us to give us an enhanced browsing experience tailored to our preferences. Sites remember stuff we chose before. Brands, price ranges, travel destinations. Taking advantage of GPS/WiFi technology sites know where we are when we visit them. A map may place our current location at its centre and only show nearby points of interest — rather than the whole world.

Websites are moving from off-the-rack, one-size-fits-all to bespoke.

To cache is to assemble time-consuming pages once, to then dish out copies to everyone who ordered that same page. Caching does not cater for every guest bringing their own dietary requirements to the table.
Bespoke is indigestible to caching.

That’s when you have to take caching off the menu and look for alternative ways to speed up a site. So we cooked up Views Accelerator.

Identifying server-side slow spots

Tasked with making a customer site perform quicker we booted up XHProf. The culprit of slow performance was soon identified as a map featuring hundreds to thousands of nearby points of interest, centred on the visitor’s current location.

But it wasn’t any of the map engines or their APIs (Google, Openlayers, Leaflet) that were soaking up the seconds. Neither was it the database. It was Views. A little-known corner of Views.

Those familiar with the Views UI cockpit may know the tick box Show performance statistics on the admin/structure/views/settings page. With that checked, a preview prints out Query build time, Query execute time and View render time.

It’s like the developers of the Views module themselves felt those three numbers sum up all there is to Views performance.

But there is a fourth component… and it can slow your site down more than the other three together. XHProf proved it.

The performance opportunity

Between the query-execute and view-render phases, the code passes through a post-execute stage. This is where the raw results from the database are groomed for final rendering and theming. All results go through post-execute, even when this may not be necessary....

And with that we cue to the Views Accelerator project page. Featured there is a summary of a case study, proving how flicking on the module can boost Views speeds by 60%.

Views Accelerator is unconventional in its approach and is still in its infancy. Time will tell how the module matures in the community. We welcome feedback to help us improve the module.

Enable Views Accelerator on a test site. In Analysis mode it tells you how every view on every page you visit performs. Then in Accelerator mode it shows you those figures again. Hopefully the second time round those figures are a little leaner, making the user experience a little richer. If not, then your views may already be close to optimum. That’s reassuring too, isn’t it?

No gain, no pain. There is no reason not to give Views Accelerator a go.

Image taken from Time Magazine:
The $19 million Bloodhound SSC that is designed to shatter the world record on land with speeds over 1000 mph.


File under: Planet Drupal
Categories: Drupal News

InternetDevels: Migrate - module for data import in Drupal

Planet Drupal - Fri, 04/07/2014 - 7:00am

Sometimes while website development it is necessary to transfer data from one database to another. Often it is either migration to a newer Drupal version (from 6.x to 7.x) or transfer of content to Drupal from another platform. Migrate module makes a very convenient tool for importing data in such cases.

Read more
Categories: Drupal News

Drupal Easy: Drupal Web Developer Career Series Part 2: Trailblazer Stories and Advice

Planet Drupal - Fri, 04/07/2014 - 6:28am

This is the second of four (ok, it was three, but there is so much good information!) weekly blog posts that encapsulate the advice, tips and must-do elements of career building in the Drupal Community from the panel of experts collected for DrupalEasy’s DrupalCon Austin session; DrupalCareer Trailhead; Embark on a Path to Success. It will be listed with other career resources for reference at the DrupalEasy Academy Career Center.

-->

read more

Categories: Drupal News

Drupal core announcements: Drupal.org User Interviews: looking for core developers

Planet Drupal - Fri, 04/07/2014 - 2:44am

Hi all,

I am looking for a few core developers, willing to take part in 45-60 minute user interviews next week. These interviews are part of the User Research we are doing now, they will help inform the future Drupal.org redesign.

If you have time and desire to talk to us about Drupal.org, let me know!

Thanks.

Categories: Drupal News

ThinkShout: Desire Paths, Part 2: Your Website is Telling You a Story

Planet Drupal - Fri, 04/07/2014 - 12:00am

You want your website to tell your organization’s story. To do that, you need to listen to the stories your website is telling you.

I have the opportunity to work with a lot of great nonprofits, including one that supports women with breast cancer. While conducting a site audit, we noticed that they had higher mobile traffic than many of ThinkShout’s clients. It had grown from 5% of the site’s total in 2010 to 30% so far in 2014.

Digging a bit deeper, we found that many of the mobile visitors go directly to a section focusing on breast cancer in young women, including "survivor stories":

  • This section generated 50% of all pageviews for mobile users, as opposed to 27% of non-mobile traffic.

  • 73% of mobile site visitors came directly to these pages through search, as opposed to 44% of non-mobile searchers; visitors coming to the site through search on their computers largely landed on the home page.

  • Top search terms on mobile include "breast cancer stories," “breast cancer in young women,” and “young breast cancer survivors.” Those terms are 2 to 5 times more likely to have been used by mobile visitors than by those coming to the site on their computers.

Those numbers tell a story.

The news that you have cancer must come as a shock. Particularly when you’re young, it may seem to come out of the blue. It’s entirely possible that, when you first receive this jolt, you’re alone, having just left your doctor’s office or set down the phone.

The first thing I would want is some reassurance, confirmation at this juncture in my life that I’m going to be okay. Ideally, I’d talk to a loved one, but in the moment, I might turn to my smartphone: it’s immediately available, it’s connected, it could provide some answers.

Our client had created content that could meet that need, opening opportunities not just to reassure a key audience, but to connect them to a broader community of support and thereby further their mission.

By experimenting with layouts and calls to action specifically for mobile visitors – essentially, by doing our job – we have the chance to help people in a very real way.

And that’s why we all do this work, isn’t it?

Taking the time to create data-informed personas can help you hone a strategy for your content that goes beyond assumptions and guesswork.

Once you understand HOW users arrive at your site and examine WHAT they do after they get there, you can begin to parse out WHY they’re interested in your content in the first place – and implement the tactics that will tie their motivations to your organizational goals.

So, what are they doing?

As we’ve suggested before, a good website will nudge a visitor from her desire path – the reason she visited your site to begin with – to the desired path: a series of actions that will serve your organization’s mission.

It pains me to say it, but you need to start with a content audit. If you don’t understand what you have, you can’t understand how it’s being used.

Dozens of articles already cover site audits. Some of them even provide templates.

Don’t use them.

Or rather, use them in a way that serves your mission. Your website likely has hundreds or thousands of "pages" from highly trafficked to, sniffed at, forgotten, and abandoned. Microsoft once found that 30% of its webpages had never been visited. (That number is more impressive in real numbers: 3,000,000. Yes, three million pages essentially served no purpose at all.) More recently, an audit by the World Bank revealed that 31% of its reports had never been downloaded.

There’s always a reason a piece of content was added to your website. Somebody, at some point, thought it would be valuable. They may still have some emotional attachment to it.

Tough. Kill it.

Allyson Kapin recently pointed to a Harvard study that found that "the more complex a website is, the less appealing the website is to visitors." Microsoft discovered that removing poor quality content improved customer satisfaction. On a more basic level, psychologists have found that providing too many options can stall the decision-making process. When you go to the cereal aisle, do you want to spend time evaluating all of the possible cereal options? No, you just want the Golden Grahams. Everything else is a distraction.

When you put barriers in the way of your users, in the form of content they’re not interested in, they’re less likely to fight through to find the content they want. Yes, even if your organization thinks that content is central to your mission.

John McCrory created this handy dandy template to help you sort out what to keep and what to throw in the hopper:

If you need to run a full inventory, you might want to look into a tool like Screaming Frog or CAT (Content Analysis Tool). Or you can export reports from Google Analytics and combine it with data from social channels.

But you don’t need to care about everything. We suggest you:

1) Focus on your high-traffic content. You’ll need to decide what the cut-off should be, but in general, if a page represents less than .05% of your total pageviews, it’s probably not worth the time it takes to care about it. Your threshold may very well be higher than that.

You’ll want to analyze performance as well. Just because a page is heavily visited doesn’t mean it’s working the way you’d hoped. You may need to rewrite and reformat a lot of it. But there’s probably a reason people arrive there, and you should spend the time to figure out why.

On ThinkShout’s own site, for example, we know that there are a handful of older blog posts, mostly on technical subjects, that account for a high percentage of our site traffic. We’re not actively engaged in driving visitors to them, but they do present opportunities to encourage visitors to learn more about the work we do. For us, they’re old news. For our visitors, they may contain valuable information, and that’s a motivation we can tap.

2) Include any page in your site navigation, down two or three levels. Presumably, this content was once important to some stakeholder, somewhere. You may still cut it – hopefully, that stakeholder has already left your organization – but if it was important enough to include in your site architecture the last time around, you should try to understand why it’s there, even if it’s failing. This will help you not simply develop a strong argument to convince, say, your development director that her pet page is just getting in the way, but identify the pages that DO work and use them as exemplars to rewrite content deemed vital to the organization that may not be connecting with end users… yet.

3) Aggregate data for your primary content types. Task number one will catch that one event you did with Pharrell Williams in 2011 that still drives a lot of traffic to your site, but you probably have a certain number of content types – you can think of these as page "templates" – that handle the bulk of your content. You may have a blog, you may run events. If you’re already good at the structured content thing, you may have broken videos or media mentions into their own content types.

Kivi Leroux Miller talks about differentiating between your evergreen content (your main site pages, likely contained in your navigation structure) from your perennial and annual color (those blog posts and tweets). A lot of your content has a shelf life, so you need to make sure the wrapper keeps it as fresh as possible. Part of your content audit should examine how well the standard structure around your more temporal content is performing.

If you find that your audit still runs into hundreds of pages, Facebook’s Jonathon Colman has some great tips on how to use conditional formatting in Excel to highlight the areas that need the most attention. (Start on slide 131.)

Who’s doing it?

Now it’s time to tie content back to your users. You have a good idea how they arrived. By segmenting your traffic, you can study what they do next, all the way down to a page-by-page basis, if you’re feeling frisky.

A good place to start is the Google Analytics "Navigation Summary." This hidden gem of a report can be found under Behavior -> Site Content -> All Pages. In the upper left corner of the content, there are a series of tabs for “Explorer,” “Navigation Summary,” and “In-Page.” You want the middle one.

This report will tell you four things about any page on your site:

  1. How many users landed on this page ("Entrances")

  2. If it’s not a landing page, what their previous page was ("Previous Page Path")

  3. How many users exited from this page ("Exits")

  4. If they didn’t exit, the page they go to next ("Next Page Path")

Magic! But wait, there’s more. You can – and should! – use this page in conjunction with segmentation.

I don’t want to get bogged down in the details of Google’s Advanced Segments here. If you decide you want to take this on yourself, KISSMetrics has a good overview. Google itself made a slightly less helpful video.

When we begin a new project, we like to create segments that relate to the ways people arrive at a client’s site, in particular, engaged users.

You can define engagement in a number of ways: non-bounce visits, repeat visits, time on site – pretty much anything Google Analytics provides a metric for. If you have enough traffic, you can combine more than one of them to segment out a group of the highly engaged.

Combine engagement with mode and place of entry, and you’ll begin to flesh out your personas – and your content audit, if you set it up to track key audience segments for each top-level page. You might also consider using the information you generate in Page Tables for your evergreen content.

This sort of analysis sets the stage for much of the work we do here at ThinkShout. Getting back to the breast cancer organization, we created an advanced segment that looked only at mobile traffic, specifically mobile traffic that didn’t bounce (ie, they viewed more than one page).

Here’s what the segmentation looks like on the "Navigation Summary" report in the context of ThinkShout’s “Work” page:

We did this to answer two questions:

  1. If a visitor navigates on a mobile device to a particular page (or group of pages), and doesn’t bounce, what do they do next?

  2. How can we take advantage of that knowledge to try to capture the attention of more visitors?

By examining how the actions of engaged users differ from those you don’t capture, you can start to develop ideas about the calls to action, related content blocks, or other improvements to your information architecture that might make a particular group of users more likely to interact with your website – and your organization.

Next time, we’ll take a look at how you can make real improvements to your website based on the information you glean from your audience’s desire paths.

In the meantime, you can import three of ThinkShout’s commonly-used analytics segments:

You’ll likely need to edit these, based on your own URL structures, but they should be enough to get you started.

Categories: Drupal News

Wunderkraut blog: Bernt & co’s Drupal Gotchas Second Edition

Planet Drupal - Thu, 03/07/2014 - 11:47pm

Half a year ago I wrote a blog post about various stumble blocks I had run into in my first year as a Drupal developer. I called them gotchas because they were not necessarily bugs - they might just be Drupal’s way of doing things which may confuse people new to or experienced with Drupal. Sometimes they are annoyances - they could be called paper cuts too. The post got some attention - which was great because people started sending me tips about things they ran into. Now there is time for a new round!

Half a year ago I wrote a blog post about various stumble blocks I had run into in my first year as a Drupal developer. I called them gotchas because they were not necessarily bugs - they might just be Drupal’s way of doing things which may confuse people new to or experienced with Drupal. Sometimes they are annoyances - they could be called papercuts too. 

The post got some attention - which was great because people started sending me tips about things they ran into. Now there is time for a new round! 

First I’d like to start with an update to my previous post - good news! 

Outdated gotcha: Features module and taxonomy

In the comments Damien McKenna pointed out

Features v2 now uses the machine name and labels for permissions, roles and vocabularies, making exporting those much easier than it used to be.

Which is true. It was just that we were using the “Taxonomy Access Fix” module in that project, and it was not using the machine names. But that module has been updated to also use vocabulary names. Things do get better in Drupal! 

New gotchas I have foundGOTCHA 1: Trying to be consistent about naming? Not too fast! 

I can’t believe that I didn’t stumble into this one before, I have a feeling it hits a lot of people new to Drupal: When starting a new project, you might want to be consistent about naming, and give a custom project module and theme the same name. 

Well, buddy, that is asking for trouble! And different trouble every time to confuse you even more - a search of any error message that pops up might not give you the cause as the first result in Google. 

This duplicate naming problem can of course happen between your own custom modules and contrib projects you add from drupal.org. 

Andreas also adds that you will also run into trouble if give your site profile the same name as your theme (and possibly also module names). 

This is documented in Drupal's documentation, which you of course have read thoroughly: https://www.drupal.org/node/143020

Tips for best practice in naming: http://drupal.stackexchange.com/questions/851/best-practice-for-avoiding...

Gotcha 2: Where was that module again? 

In a direct response to the original blogpost, reddit user tranam mentioned: 

The biggest gotcha in Drupal, as far as I'm concerned, is having a modules folder, and a sites/all/modules folder. 

http://www.reddit.com/r/drupal/comments/1vuneh/bernts_drupal_gotchas/

Gotcha 3: Updating a module doesn’t 

Lauri mentioned this:

You're trying to update a module and it doesn't update. drush up, drush updb, disable, enable, delete, download, etc.. and it's still the same! Then a colleague points out the obvious: You have the module installed in more than one place, like /sites/all/modules and /sites/all/modules/contrib or even a submodule of another module.

To find out if this is your problem, you can run SELECT * FROM system  to see the actual path that drupal has associated with a specific module. 

Gotcha 4: The pesky feature that won’t revert (multilingual sites)

So you just pushed a git commit to a server, and you’re trying to revert the feature, but it just won’t happen. You have tried the magic cache-clearing/php-fpm reloading/cache-clearing incantation several times already, but no no no no go. 

Then you look at the feature diff, and you notice that .. you were looking at the feature page in a different language from it was made in. Aargh! 

Gotcha 5: Browser based language detection is killed by page caching

Florian told me abot this one: If you have page caching enabled the browser based language detection will not work due to a bug in core.

This dropbucket snippet might work for you though: http://dropbucket.org/node/728

Gotcha 6: Dragging and dropping around in panels don't work

Juho V tipped me about this one - and Sampo provided the workaround: 

[11.57.59] Sampo: Sulla on exposed formi tossa. Disabloi se view, draggaa toi paikalleen ja toimii.

Decrypted from Finnish it reads: You have an exposed form in there. Disable that view, drag it to it’s position and it will work. The exposed form is what breaks the drag and drop, so you better just disable that display. 

Gotcha 7: Administer Content permission is powerful but not that powerful

Mario notified me about this one: 

Administer Content permission sounds all powerful: But if you're not user 1 you can still not access unpublished content if it is not edited by yourself. 

You also need "Bypass content access control" permission - or you could use the “view_unpublished” module. 

Gotcha 8: Multiple meanings of “vid” in the database

This has baffled me, at least, when poking around in the database trying to figure out how to solve a case. And I am not the only one: http://drupal.stackexchange.com/questions/13266/what-does-vid-mean

marcvangend at Drupal Answers writes in http://drupal.stackexchange.com/a/13269 :

Unfortunately, vid can mean multiple things. That's not ideal, but I have not seen it causing problems (other than mild confusion now and then).

In the context of nodes, it means 'version id'. For every node in the node table, Drupal can save multiple versions in the node_revisions table. The version id is the unique identifier in the node_revisions table. (This is the vid you see in your query.)

In the context of taxonomy, vid means 'vocabulary id'. A vocabulary is a collection of related terms. Every vocabulary has a unique id.

In the context of the Views module, vid means 'view id'.

Gotcha 9: EntityFieldQuery executed from cron checks access right

Teemu reported this one: If you are running EntityFieldQueries from cron, you might not get the expected results because EFQ does indeed add it’s own access checks. 

Solution: 

$query = new EntityFieldQuery(); $query->entityCondition('entity_type', 'node') ->fieldCondition('field_something_id', 'value', $something_id) ->addMetaData('account', user_load(1));

The last line makes it sure its loaded as Dries. 

An alternative is apparently to use this one (which was added in Drupal 7.15):    

->addTag('DANGEROUS_ACCESS_CHECK_OPT_OUT') Gotcha 10: Blocking users does not block immediately

Reigo reported this experience: 

I once discovered a blocked user who had logged in before he was blocked, and he was still active! So after blocking, empty the session table.

Note: Emptying the session table will also log out ALL the site’s users - so you might think twice about that. One option is to remove the session for that specific user id. 

Gotcha 11: Want to disable the query pager? We’ll trip you up

If you have a query object and wish to return all items, you might try and set the limit to null or false to disable the pager. No go: 

https://api.drupal.org/api/drupal/includes%21pager.inc/function/PagerDef...

public function PagerDefault::limit

States: 

Specify the maximum number of elements per page for this query. The default if not specified is 10 items per page. $limit: An integer specifying the number of elements per page. If passed a false value (FALSE, 0, NULL), the pager is disabled.

Did you think that a disabled pager would return all results? Sorry, daften states this https://api.drupal.org/comment/13964#comment-13964

I would expect disabling the pager would mean everything is shown, instead nothing is returned.

Gotcha :) 

Gotcha 12: Views with date filter not returning what you want

I was struggling with a view with filters for a date field, that did not return what I wanted. I suppose the following conversation speaks for itself: 

[15:08:17] Ilmari: ha! [15:08:19] Ilmari: I got it [15:08:26] Ilmari: Guess what, its the granularity [15:08:32] Ilmari: It is set to "day" [15:08:38] Ilmari: instead of seconds [15:08:56] Ilmari: In the "settings" part of the filter (separate settings) [15:09:16] Ilmari: Filter granularity => Day [15:09:21] Ilmari: should be => Second [15:10:36] Ilmari: Did you find "Filter granularity" under "Settings" for the filter? [15:11:08] Bernt: I didn't find that [15:11:09] Ilmari: Pretty annoying that the default is a day [15:11:18] Ilmari: Content: Date - end date:value2 (yesterday) | Settings [15:11:25] Ilmari: --> "Settings" [15:11:32] Bernt: Oh hah there!! GRRRRRRR hitting my head in the wall [15:11:36] Ilmari: :D [15:11:36] Bernt: or on the desk, it is closer [15:12:02] Ilmari: I've encountered that exact problem several times, i always forgot to check those settings.. [15:12:22] Ilmari: ..and the default "day" granularity doesn’t really make sense, usually [15:12:56] Bernt: Thanks man [15:13:45] Ilmari: heh [15:13:50] Ilmari: Glad I could help this time [15:13:50] Bernt: Well, another GOTCHA for my list

So when you are working with a date field in views, remember to check what the granularity setting of the field is. Date defaults to day, which doesn’t work too well if you are more interested in now! 

Gotcha 13: Site name in a feature that depends on .. 

Florian reported this find: 

Don't export the site name in a feature that's a dependency of an installation profile, or you won't be able to install. 

It just happens that the installer checks the site name to test if Drupal has already been installed or not, so if you add that variable to a feature, then it thinks that the installation has already been done.

In the meantime, you can just set the title during an install task (that runs later in the process). 

Categories: Drupal News

Deeson Online: Google Webmaster Tools - Part 3: Getting Results

Planet Drupal - Thu, 03/07/2014 - 7:48pm

In part one of this series I gave an overview of Google Webmaster Tools.

In part two I had a look at a bit more detail at some of the areas that I have found useful to understand when reviewing a site's listings in Google. In part three, I am going to look at how, having analysed this data, you can help to improve your site's listing in Google.

As mentioned in part one I am not an SEO expert, so this shouldn’t replace consulting/using SEO experts, but it will hopefully help you to be able to cover the basics without having to spend loads of money.

Search Traffic

This section wasn’t covered in part two of this series, but is hopefully fairly self explanatory and will help you analyse where to perhaps focus your SEO. Search Queries: This shows the list of most searched terms that have driven traffic to your site. This can help you target various key pages etc, and help you think more about the wording of your pages, to try and help you get more natural listings in Google.

Crawl details

Having had a look at the various data within the crawl details sections, you should then be able to understand pages that are generating errors on your site and look at what needs to be done to fix them. Key errors that you should concentrate on are ‘Server errors’, ‘Soft 404 errors’ and ’Not found’ pages.

Sitemaps

Looking at the sitemaps section can be slightly addictive as you watch the graph (hopefully) increase as Google indexes more and more of your content. Sometimes you take a look at it (thinking that everything is working alright) and see a problem with the number of pages being indexed. We had a client that I was working with a while ago and when we looked at their sitemap in Google Webmaster Tools, the number of pages being indexed fell well short of the number of pages being sent to Google. Their sitemap.xml file contained around 240,000 URLs, but only around 10,000 were actually indexed. Looking at the site, it was set up to send Google a new sitemap.xml every day. By changing this to send it to them weekly, this increased to a regularly indexing of around 225,000 URLs. It seems that Google wasn’t able to index all the pages in just one day and kept starting again each day, so was never getting to the end of the list. Google says that they can’t guarantee to index all of your site, but to have over 90% over the pages indexed was a lot better than only 4%.

That's all folks!

Although I haven't covered Google Webmaster tools in great detail, hopefully you will now feel more confident looking through and using it. It is a great tool for analysing your sites to see how you can get better performance from them in terms of user experience and for your search rankings.

Read moreGoogle Webmaster Tools - Part 3: Getting ResultsBy Mike Davis | 3rd July 2014
Categories: Drupal News

Károly Négyesi: Double theta to compute delta

Planet Drupal - Thu, 03/07/2014 - 7:46pm

We are denormalizing into a field past migration; while usually I freak out writing directly to the field tables in this case it's justified because it's a custom module (never do this in contrib) and also because we are well aware of what does not happen when you do that. With that said, we have a query that roughly looks like this:
INSERT INTO {field_data_field_denorm_data}
(entity_type, bundle, deleted, entity_id, revision_id, language, delta, field_denorm_data_target_id)
SELECT 'user', 'user', 0, field1, field1, 'und', ????????????, field2
FROM table1
.... long complex query where a single field1 has several field2.

So yeah. But delta... delta is a problem. MSSQL has ROW_NUMBER(), MySQL does not and the usual replacement (user variables, @x:=@x+1) is documented to be incorrect and not reliable. There's a lesser known trick that can be used, however:
CREATE TABLE tmp
SELECT DISTINCT field1, field2
.... long complex query repeated

now, ALTER TABLE tmp ADD KEY(field1) in preparation, and then:

INSERT INTO {field_data_field_denorm_data}
(entity_type, bundle, deleted, entity_id, revision_id, language, delta, field_denorm_data_target_id)
SELECT 'user', 'user', 0, t1.field1, t1.field1, 'und', COUNT(*) - 1, field2
FROM tmp t1
INNER JOIN tmp t2 ON t1.field1=t2.field1 AND t1.field2 >= t2.field2
GROUP BY t1.field1,t1.field2

Double theta for the win.

Explanation (numbers copied from real data):
+-------------+----------+---------------------------------+
| t1.field1   |t1.field2 | group_concat(t2.field2)         |
+-------------+----------+---------------------------------+
|        4440 |      427 | 427                             |
|        4440 |      428 | 427,428                         |
|        4440 |      429 | 427,428,429                     |
|        4440 |      433 | 427,428,429,433                 |
|        4440 |      435 | 427,428,429,433,435             |
|        4440 |      436 | 427,428,429,433,435,436         |
|        4440 |      438 | 427,428,429,433,435,436,438     |
|        4440 |      439 | 427,428,429,433,435,436,438,439 |
+-------------+----------+---------------------------------+

Consider the user 4440. When t1.field2 is 427, when joining with t2, there's only itself when joined, so the count is 1 , delta is 0. When t1.field2 is 428 now we have two, namely 428 and 428, so the count is 2 and the delta is 1. And so on. The unsaid, implicit trick is that MySQL orders on what you group.

Categories: Drupal News

Don't Panic: A blog about Drupal: More reliable Drupal statistics?

Planet Drupal - Thu, 03/07/2014 - 7:23pm

Fact: Using the Update module for collecting data has been the standard since Drupal 6.0.
Another fact: Sites not using that module aren't submitting usage statistics to drupal.org.
Yet another fact: Third-party monitoring services are rendering the Update module rather useless.
Result: Misleading statistics on Drupal core and module usage.

When Drupal 6.0 was released the Update module started submitting statistics to Drupal.org, a great initiative. Though, you can disable this module for different reasons, thus creating misleading statistics on Drupal.org. The same goes for Drupal 7, you can disable the module there as well.

Categories: Drupal News

DrupalCon Amsterdam: Symfony Community: Come to Amsterdam!

Planet Drupal - Thu, 03/07/2014 - 6:00pm

Symfony components have a significant presence in Drupal 8, and for those in the Symfony wanting to make themselves even more knowledgeable and marketable, DrupalCon Amsterdam is a great opportunity to learn new skills and make great new friends.

Just a few weeks before SymfonyCon in Madrid, DrupalCon Amsterdam runs from 29 September to 3 October and will have its own Symfony track. It will be a great opportunity to learn Drupal 8: with Symfony2 components included in core, parts of Drupal 8 will look very familiar to developers who currently use Symfony, as will the object oriented programming methodology.

If you’re considering coming to DrupalCon Amsterdam, you probably know that Drupal skills have been in high demand for years. That trend is only expected to continue and perhaps even accelerate with the release of Drupal 8— and Symfony developers are uniquely equipped to learn the platform quickly and hit the ground running.

DrupalCon is the best place to learn Drupal 8

If you’re interested in learning more about Drupal 8, DrupalCon Amsterdam will be a fantastic opportunity. The world’s foremost experts on Drupal and Drupal 8 will be in attendance, giving interested developers plenty of opportunities to learn.

Every DrupalCon is attended by more than just developers: the Drupal community includes web professionals of all stripes. From project managers to designers, back-end experts and even UX gurus, DrupalCon Amsterdam is a great chance to learn from the people who are working on websites at every point in a site’s lifecycle.

Plus, DrupalCon is always a good time. Expect a lot of smiles, laughs and even a few hugs (OK, maybe a lot of hugs).

If you’re interested in Drupal or Symfony, come to DrupalCon Amsterdam. You will be glad you did!

Categories: Drupal News

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer