Planet Drupal

Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 24 min 46 sec ago

Red Route: Rebuilding The Gallery Guide in the open

Wed, 02/03/2016 - 07:42

The first decent-sized Drupal site I built was The Gallery Guide - think last.fm but for art instead of music. My wife and I built it nearly 7 years ago, and it's still going, although it's looking a little creaky these days, and the income from Google ads is so small that I don't think it even covers its hosting costs. The point of building it wasn't to make money though - it was to learn about building websites by building a website, and to encourage ourselves to make the most of living in London by visiting more art galleries. At the time, I wasn't a full-time developer, and I don't think I would have become one if I hadn't worked on this project.

As with any project, there are things I'd do differently if I was starting again now. I look at some of the code that's in there and wince. There are far too many contributed modules, and the design is too cluttered (both visually and technically).

With the Drupal 6 end-of-life announcement, and my own move back to London from Cardiff, it feels like a good time to give the site an overhaul. Upgrade to Drupal 8, make it responsive, improve performance, and generally take a fresh look at it.

In the spirit of designing in the open and sharing what I learn along the way, I thought it would make sense to capture some notes on the process here.

There's a lot of existing content on the site, so I'm starting with a first pass at migrating it into Drupal 8, so that I can at least see some content and iterate from there. With the Drupal Upgrade module this is fairly straightforward. I've already used it to upgrade a simpler site, and it was surprisingly painless.

The first snag, as might be expected, is that a lot of the contrib modules used on the Drupal 6 site aren't ready for Drupal 8. This is a good opportunity to consider whether they're actually necessary. Some of them provided functionality that has been included in core, like Node Reference. For some of them, it may well make sense to use alternative, like Address instead of Location. And some of them maybe shouldn't have been installed on the site in the first place.

Similarly with the custom modules, there were some very inefficient database queries happening, partly because it was D6, but mostly because I didn't know any better at the time. As plenty of other people have suggested, the functionality in D8 makes it possible to do much more with core than you could before.

For getting some of the more complex fields in to the new site, I know I'll need to write some custom code, and this tutorial seems very helpful so far.

I also know that I'll be trashing my local development site a fair few times in the course of the process, so it makes sense to create an installation profile - this seems pretty similar to D7 profiles, and there's pretty good documentation.

Hopefully I'll have more progress to report soon.

Tags: DrupalDrupal8The Gallery Guidedevelopment
Categories: Elsewhere

Matthew Saunders: Drupal Association Election 2016 - Why am I Qualified?

Wed, 02/03/2016 - 03:39

I've described myself as a cuckoo. I was dropped into the nest of opensource folks 10 years ago, and ended up making it my family. I'm that fellow who took a different path in making a technology career. I think that describes a lot of us in the Drupal community though. My background is in Theatre and Visual Arts. However, I have a certification in non-profit management and my Master's focused on technology and governance.

drupaldrupal association election 2016
Categories: Elsewhere

OSTraining: Custom Block Types in Drupal 8

Wed, 02/03/2016 - 03:09

Blocks have had a major overhaul in Drupal 8.

Blocks are now broken down into two modules. The Block module simply handles the placement of blocsk into regions. The Custom Block module implements a new entity that allows you create block types and add fields to them.

In these two videos, taken from our upcoming Drupal 8 Site Building class, Rod introduces you to blocks in Drupal 8.

Categories: Elsewhere

Agaric Collective: How to organize Drupal Global Training Days workshops: Experiences and lessons learned

Tue, 01/03/2016 - 17:47

The Global Training Days is an initiative coordinated by the Drupal Association to introduce new people to the wonderful world of Drupal. The initiative is about providing free or low-cost training to facilitate people gaining familiarity with Drupal in just a day. Depending on the format, attendees can leave the workshop with a website already built. In this blog post, I will explain how to organize one and share experiences and lessons learned after organizing them in Nicaragua since 2014. It is my hope to inspire you to be part of the initiative and organize a workshop in your local community.

The basics

To get started, find out the next dates when the workshops would be given worldwide. They happen two days in a row (on Friday and Saturday) approximately every 3 months. Dates are set in the last quarter of the previous year and can be checked at https://www.drupal.org/global-training-days.

For the workshop itself there are two options to choose from in terms of time and curriculum. The first is a What is Drupal? half-day workshop where attendees learn the basics of Drupal. If you go this route it is recommended to spend most of the time explaining the different Drupal concepts, and how they relate to each other in order to build a site. Hands-on instructions where each attendee builds a site can be left out due to time constraints, but it is fine to have a demo where you show how to assemble a website using Drupal.

The second option is an Intro to Drupal full-day workshop where attendees learn the basic concepts and have the opportunity to build a simple yet functional Drupal site. For this type of workshop, you can spend the first half explaining concepts and the second half building the site. Remember the introductory nature of the workshop. Do not try to cover advanced site building concepts. Stick to Drupal core and build your site using using nodes, blocks, views, and core modules like Contact. In either version of the workshop, do not go over how to build themes or modules. If you try to cover too many topics, you might not develop them all appropriately. If you really want to cover these topics, it is better to organize a follow up workshop where they could be explained with more time.

Once you decide the date and type of workshop you want to present, sign up at this page. After doing so you will get an email from the Drupal Association. You will also be added to the list of organizers.

Plan ahead

The dates for the workshops are announced way ahead of time. Be an early bird and do not leave things to the last minute. Ask yourself these questions and plan accordingly:

  • Am I participating the two days (Friday and Saturday) or only one day?
  • Am I presenting a half-day or a full-day workshop?
  • Am I providing computers to attendees or they are required to bring a laptop?
  • Am I providing lunch for attendees or they are required to bring/buy their own food?
  • How many people can attend based on the facility’s capacity?
  • How many people can attend based on the number of speakers?
  • Does each speaker know which section of the workshop they are going to present?
  • If the workshop includes building a Drupal site, which tools will I use?
  • Where should I advertise the workshop?
  • What is the contingency plan in case the Internet service does not work?
Before the training

It may seem obvious, but make sure you have a place with the proper conditions to give a workshop. You will need:

  • a projector
  • a whiteboard or chalkboard, or flipchart and markers
  • a decent Internet connection
  • good room lighting
  • comfortable room temperature
  • zero sound pollution

The last item is very important as you do not want to yell to be heard. It happened to us once that the room next to the workshop laboratory was occupied by a group of loud children. This not only distracted the attendees, but also forced me to raise my voice to be heard. After speaking loudly for a couple of hours my voice had disappeared.

Even without noise pollution, giving back-to-back trainings two days in a row poses quite a challenge to keeping your voice audible. Make sure you have multiple speakers and take turns presenting. Use a microphone if available. It helps to preserve your voice, and helps participants who might not hear very well.

Once you have the venue figured out, be realistic about how many people you can effectively manage. Organizing a workshop takes lots of effort. It is fine to try to teach as many people as possible, but quality is preferred over quantity. In our experience, teaching small groups is more effective because you can dedicate more time to answer all questions each attendee might have and provide a personalized learning experience.

Make sure you get a confirmation of the venue at least 3 weeks before the training so you have time to promote the workshop. In Nicaragua, we always make the announcement in our official Drupal group and on the community’s Twitter and Facebook accounts. But experience has shown us that only a minority of the attendees find out about the event through these channels. In our case, about 90% of attendees discovered the event after seeing an invitation posted to a non-Drupal specific Facebook group of Nicaraguan developers. The 10% remaining is a combination of word of mouth (past participants recommending the workshop to others), people I meet in various tech meetups, and the channels mentioned before.

When deciding where to advertise the workshop, find the right pond and remember to fish where the fish are. If you have some spare dollars, feel free to invest in paid social media advertisement. No matter where you decide to promote the workshop, include the following information in the announcement:

  • Date and times.
  • Name of venue and address.
  • A photo of the building where the workshop will take place! We have experienced people being unable to find the venue. So, play it safe, be verbose with directions, and add a photo of the venue.
  • Whether or not it is required to bring a laptop.
  • Whether or not lunch will be provided.
  • If registration is required, the url where people can register.
  • A note that no previous knowledge is required and that anyone (not only tech people) can join! :-D

Prepare the tools you will use in the training. In Nicaragua, we prefer to use Patrick Drotleff‘s amazing service https://simplytest.me This allows us to focus on building the Drupal site, instead of configuring the myriad of local environments that attendees may have. In our experience, configuring local environments on each attendee’s computer takes too much time. For example, most of the participants that come to our workshops use Windows. Trying to set up a LAMP environment could be surprisingly complicated in this operating system. Even out of the box solutions like XAMPP might not be able to start the web server due to port conflicts. Skype is a recurrent culprit. Starting a MySQL server might also fail. If that happens, skip it altogether and install using SQLite. More often than not, we go the fastest route and use disposable Drupal installations. Keep in mind that you are teaching Drupal site building, not server configuration.

"Anything that can go wrong, will go wrong." Murphy’s law will manifest more often than you would like. Be prepared and have a contingency plan for as much as you can. During one of our workshops, our favorite tool https://simplytest.me was down, but we were prepared with packages for local installation. In another instance, the venue was changing Internet provider and we had no Internet at all. Again, local installations came to the rescue. In such cases, save time by asking people to work in pairs or small groups so you do not have to configure a lot of computers. Bring a copy of your slide deck in a thumb drive so you can present offline in case it is needed. In Nicaragua, not only the tech is community vibrant. Volcanoes are too! With a handful of active volcanoes that produce tremors very often, we need to make sure to have clear instructions on how to leave the facility if necessary. Do your homework and be ready in case anything goes wrong.

On the day of the training

Take with you a laptop, a VGA/DVI/HDMI cable and adapter, and a back up projector if available. Have a copy of your slide deck for offline presenting and all the tools you might need in case the Internet decides to visit Saturn. Arrive early at the venue, set up your computer and projector for the presentation, and write the wi-fi password on the board. If you are providing computers, make sure any tool you intend to use is installed and working.

Take lots of photos (with participants' permission) and share them on social media. Be sure to record the training for posterity. This is not to show off, but to inspire others to organize workshops in their local communities. Make sure to use the official #DrupalGTD hashtag when sharing content. And please respect those who might not want to appear online! In our trainings, after finishing presenting theory and before starting to build sites we ask the attendees for a group photo which we later share on Facebook and Twitter.

We drupalers are fond of freebies. We enjoy stickers, T-shirts, trial online subscriptions, or anything that comes in an event as swag, right? Let’s share this passion with attendees. In our trainings, we use to have a table with lots of stickers for people to take from. In one occasion we also gave away T-shirts. And we have got in contact with online education providers to give attendees free trial access to their content. Chris Shattuck from Build a Module has been so kind in offering free access to his amazing library of content for 8 days to every attendee of our workshops. He also gave us some 1-month free memberships to raffle. And the friendly folks from Knp University provided free access to Drupal-related material to attendees of the November 2015 edition of the workshop. When organizing a workshop make sure to have some treats to your attendees and partner with education providers so they can keep learning when the day is over. Also, show attendees how to stay connected with the broader community by helping them create a drupal.org profile and teaching them how to get involved.

A final comment for this section has to do with attendance. Do not feel bad if the number of people who show up is not the same that the number of people who registered. In fact, almost every time those numbers will not match. Sometimes you will have many attendees and in other occasions only a few. Do not let this disappoint you. Remember what motivated you in the first place to organize the event. Share your knowledge with others, no matter the number of attendees. Personally, I would present any workshop or session as long as at least one person shows up. Everyone’s time is valuable and each attendee sets aside time to listen to you. That is an honor I take with great responsibility, and you should too.

After the training

After you have enjoyed the Global Training Days experience give thanks to everyone who made the workshop possible. This includes the attendees, co-presenters, venue providers, sponsors, and educational partners. In Nicaragua we post pictures and thank-you notes on Twitter and Facebook. And in those thank-you messages we also include the next dates of the workshop for those who missed it this time.

Of utmost importance is to make an evaluation of the workshop. Meditate on things that went well, but also on things that went wrong and can be improved. At the end of our workshops we ask for feedback from the attendees. We also take time to improve the slide deck based on the concepts that attendees had difficulty understanding. This often translates to changing the copy, images, and examples used to explain the different concepts.

After all the hard work, give yourself a pat on the back, and share your story with others. You can write a blog post like this or simply post pictures of the workshop online. The Drupal Association is also interested in feedback from you and the attendees so do not hesitate in providing it.

My wish list

The Drupal Association provides a lot of support and material to promote these events. Unfortunately, this content is only available in English at the moment. I would love to see this content translated to every language spoken by a member of our community. In Spanish for example, there is a great community that could help with the task of translating the content. The same can be said for communities which speak other languages. Eduardo Garcia is running for Director at Large within the Drupal Association and he has interesting ideas about making our community more inclusive for non-English speaking members.

Another wish of mine is collaboration in curriculum building. When the Nicaraguan community started to participate in the Global Trainings Days initiative back in 2014, we found little content that could be used in the workshop. The Drupal Association offers a curriculum in case you need it, but it is in English and our audience speaks Spanish. Because of this, we basically had to start creating a curriculum from scratch. The curriculum we use in Nicaragua is far from perfect, but the content has improved a lot over time. This has taken a lot of time and effort, yet there is no need to repeat the process again. Because of this, we have made our content available under a Creative Commons Attribution - Non Commercial - Share Alike license for anyone to use and adapt to their needs. So far we have available a slide deck and a video recording of the theory part of one of the workshops. Unfortunately some videos of the recording do not have audio, but we are planning on making another recording in a future edition. Also, I have started working in a written version of the workshop. This document is in a very early stage, but I will continue adding to it as time permits. It would be great if other communities would use this documentation and provide feedback to improve it. Collaborating in building a curriculum in different languages would be amazing. If you like this idea start working on the curriculum in a new language and promote it to get feedback from others.

Measuring success

There are various parameters that you could use to measure the success of your workshops. For example, the number of attendees and the number of people who keep engaged with the local community thereafter. In Nicaragua, we have organized 10 workshops since 2014 and over 120 people have attended. Some keep engaged while others do not. But numbers can be cold, so we measure success in non quantitative ways. For example, seeing people smile when they understand the basic concepts of Drupal or viewing their excitement after being able to build a website during the training.

Sometimes, we are able to make a more significant impact on the life of attendees. For instance, we are aware of people who could land a Drupal job after attending the workshop and continuing to learn on their own. The fact that we are making an impact on their lives is our best reward. Here are two testimonials of people who got a job after attending our workshops.

Hello everyone. My name is Ada Hernández Acosta and I am from León, Nicaragua. Attending a Drupal workshop presented by Lucas Hedding and Mauricio Dinarte set a milestone in my professional and personal life. At the workshop I learned the basic of Drupal: nodes, taxonomies, views, modules, themes, and more. I also learned the benefits of using Drupal including its security and no cost for usage. Moreover, a worldwide community is actively working on creating new modules, themes, and security updates. After attending the workshop I developed a strong interest in Drupal and decided let Drupal take part in my life. Today I work at MTech, LLC building websites on Drupal. Now I am also a member of this great community and I am able to make contributions to modules I use on the sites I work on. Thank you very much.

Ada Hernández - Translation and code contributor

It was my first experience in something of this nature. I had just finished college and I wanted to learn new technologies. The Global Training Days workshop was a great opportunity for this. After attending the workshop I got an overview of Drupal that helped me a lot in the future. I learned basic concepts (nodes, taxonomies, users, blocks, etc.) each with real life examples; this was intuitive and easy to understand. That day I became part of the great Drupal community. Attending the workshop changed my life. After it I kept learning in the free classes presented by MTech, LLC where I currently work and continue learning everyday. I think these workshops are what make the Drupal community grow and help improve the lives of attendees.

Edys Meza - Code contributor

Final comments

Be flexible. Nothing related to the Global Training Day is set in stone. For example, if for any reason you cannot give the training on the day suggested by the Drupal Association, pick another day. It can be in the same week or the week before or after. A good reason to do this is to let yourself rest and have enough time to recover your voice between multiple workshops in the same edition of the initiative.

Community first, companies later. Although the Drupal Association primarily has invited companies to give workshops to promote themselves, growing the Drupal community and sharing your knowledge should be the focus. In Nicaragua, we started to give the training as a local community initiative. It was Drupal Nicaragua, not a company who started giving the workshop in 2014. Later, both Agaric and MTech sponsored the events and education providers partnered with us. Of course, we are very grateful to them for their ongoing support!

Keep calm and enjoy the experience. Undoubtedly there will be mistakes, particularly the first few times you organize the workshop. In Nicaragua, we have given 10 workshops so far and none has been perfect. What is important is that you learn from the mistakes and improve for the next edition. Sometimes we face many difficulties, but we are able to work through them. At the end of the workshop, you will be rewarded by the smiles of people who have learned to build a simple yet functional website in a matter of hours. :-D

This is how the Nicaraguan Drupal community organizes Global Training Days. It is my hope that after reading through you get inspired to give a training in your local community. When you are ready to take the challenge, pour your heart into it, upload some photos of the workshop once it is finished, and share your experience so that the entire Drupal community can benefit from it. If you have already participated in the Global Training Days please share your story in the comments below. Have fun!

Special thanks to Alina Mackenzie and Lizz Trudeau for their thorough reviews and suggestions to this blog post. Also to Lucas Hedding who has helped move the Nicaraguan Drupal community forward by creating documentation and organizing events. His contributions to the local community are invaluable. And thanks to the amazing BADCamp organizers for providing me financial support to attend the camp the last two years. I have learned a lot during these events and the acquired knowledge has greatly improved the curriculum used at the Global Training Days workshop. The effort that you pour into the camp and keeping it free is inspiring and greatly appreciated. Keep up the good work! :-)

Categories: Elsewhere

Acquia Developer Center Blog: Drupal 8 Module of the Week: Drupal Console

Tue, 01/03/2016 - 17:28
Jeffrey A. "jam" McGuire

Each day, more Drupal 7 modules are being migrated over to Drupal 8. New ones are also being created for the Drupal community’s latest major release. In this series, the Acquia Developer Center is profiling some of the most prominent, useful modules, projects, and tools available for Drupal 8. This week: Drupal Console.

Tags: acquia drupal planetDrupal Consolescaffolding
Categories: Elsewhere

InternetDevels: Drupal 8 improvements (Part 2)

Tue, 01/03/2016 - 16:58

We love discussing the new features of the amazing Drupal 8 — so we are back at it again. In Drupal 8 improvements - Part 1, we talked about the WYSIWYG editor out-of-the-box, excellent inline editing opportunities, the ease of adding and displaying inline images, better previews, and mobile responsive interfaces.

Now here is the promised Part 2 of this overview, with more great Drupal 8 improvements that deserve to be mentioned.

Read more
Categories: Elsewhere

Annertech: Drupal + Panels + Panelizer + Paragraphs + (Fieldable) Panel Panes - if it begins with P, use it

Tue, 01/03/2016 - 12:09
Drupal + Panels + Panelizer + Paragraphs + (Fieldable) Panel Panes - if it begins with P, use it

This was the user story: "As a site admin, I want to be able to add different types of content chunks on any page with customisable backgrounds, so that we have control over the style and layout of our website". Yes, it's a pretty big user story, but bear with me.

Categories: Elsewhere

Code Enigma: WYSIWYG flexibility with the Shortcode module

Tue, 01/03/2016 - 09:32
WYSIWYG flexibility with the Shortcode module Language English Boost your WYSIWYG with Shortcode module

Learn how to create custom shortcodes in 3 simple steps.

Tue, 2016-03-01 08:32By salva

Giving editors full control over the elements they want to place in their contents is not always an easy task. When there's a need to embed rich media content on a Drupal site through a WYSIWYG editor, it's important to find a balance between the markup to allow editors to use (for security), and the simplicity and convenience of the tools that allow for such embedding.

This article describes how the shortcode module for Drupal 7 can be used to cover complex requirements when it comes to embedding media content in WYSIWYG areas, with the minimum amount of code, and with a great user experience for editors, while maintaining secure filters on text formats.

So what's that shortcode thing?

For those of you who don't know, the shortcode module is a token-based text format that allows editors to enter special markup on WYSIWYG fields, without requiring any special permissions to insecure html tags. 

To illustrate this, let's say an editor wants to include a link in a content page, and make it look like an actual button. With the [button] shortcode, offered out of the box by the shortcode module, this editor could do this by simply entering this text in the textarea:

[button href="someurl" text="some text"]

And the shortcode module would do the rest to transform that into:

some text

Or whatever markup is configured for that particular shortcode (your site could be using the tag, for example), instead of having to configure new WYSIWYG styles or templates just for simple visual enhancements. Not bad, right? But, what are the actual benefits of using shortcode, compared to writing a custom filter for your text formats? Well:

  1. Shortcode module is a text format in itself. It comes with some shortcodes by default, which you can enable / disable individually. You can see the default ones on the project page.
  2. It's an API-like module, which means you can easily add new shortcodes for your needs without having to create new filters, therefore you avoid cluttering your text formats configuration page with multiple filters that are fundamentally the same. Also, you don't have to worry about regular expressions to replace the tokens with real content, and at the same time, maintain consistency in the codebase by using the same approach for all your token-replacement functionality.
  3. It has a WYSIWYG button plugin out of the box for each shortcode, via the Shortcode for WYSIWYG module. WYSIWYG integration out of the box, without writing a single line of Javascript.

In one of our recent projects, our client wanted to embed Shopify widgets in some of their pages. These widgets require some javascript to work, as well as a relatively complex html tag structure. We were already using the oEmbed module to embed content and widgets from a number of external sources. Unfortunately, Shopify didn't seem to support oEmbed at the time.

Luckily for me, Shortcode was exactly what I was after: API-like, token-based, and with WYSIWYG integration out of the box. Problem solved! In just a couple hours, without having any previous experience with the module, I had a nice-looking WYSIWYG plugin like this:

Implementing a custom shortcode

Without further ado, let's show an example of how you can implement your custom shortcodes, with WYSIWYG integration, in just a few lines of code. In 3 (optionally 4) simple hooks, we can get a shortcode token up and running. Let's start with the first one:

hook_shortcode_info(): Standard Drupal "info" hook implementation. All we do here is specify a title for our shortcode, and some callbacks the core module will need to transform our tokens into markup.

Our implementation:

/** * Implements hook_shortcode_info(). */ function stem_wysiwyg_shortcode_info() { $shortcodes['shopify'] = array( 'title' => t('Shopify Content'), 'description' => t('Allows embedding a shopify widget with the required Javascript'), 'process callback' => 'stem_wysiwyg_shortcode_shopify_process', 'tips callback' => 'stem_wysiwyg_shortcode_shopify_tip', 'attributes callback' => 'stem_wysiwyg_shortcode_shopify_attributes', ); return $shortcodes; }

 

The "process callback" is the function that will be used to transform the token into markup.  "tips callback" allows us to return the text that is displayed in the text format info, below all the Drupal textareas. Finally, the "attributes callback" is where we return the attributes that can be specified for our shortcode. In the button example from the beginning of the article, these would be the "href" and the "text" attributes.

I'm skipping the "tips callback" for simplicity, as it's not mandatory. You can find examples of it in the module itself, which has a shortcode.api.php file, well documented. As for the "attributes callback", this is what we had to implement for our Shopify widget:

/** * Attributes callback for the 'shopify' shortcode. * * @see stem_wysiwyg_shortcode_info(). */ function stem_wysiwyg_shortcode_shopify_attributes($form, &$form_state) { $form['shopify-shop'] = array( '#title' => t('Shop (data-shop)'), '#type' => 'textfield', '#default_value' => 'shopname.myshopify.com', '#states' => array( 'visible' => array( ':input[name="shortcode"]' => array('value' => 'shopify'), ), ), ); $form['shopify-product_handle'] = array( '#title' => t('Product Handle (data-product_handle)'), '#type' => 'textfield', '#states' => array( 'visible' => array( ':input[name="shortcode"]' => array('value' => 'shopify'), ), ), ); /* Rest of form omitted for brevity */ return $form; }

 

All we have to do here is return a standard Form API array, as if we were building the form ourselves, except for shortcode we don't care about the processing of it. We just specify the attributes we need to gather. This hook is optional, since it's not required to gather any data for your shortcodes, although it's certainly something you'll implement for custom tokens if you want WYSIWYG integration!

Finally, for our process callback, this is what we did:

/** * Process callback for the 'shopify' shortcode. * * @see stem_wysiwyg_shortcode_info(). */ function stem_wysiwyg_shortcode_shopify_process($attrs, $text) { // Prepare attributes for shopify embed. $attrs = shortcode_attrs(array( 'embed_type' => 'product', 'shop' => 'myscience.myshopify.com', 'product_name' => '', 'product_handle' => '', 'buy_button_text' => t('Buy now'), 'has_image' => 'true', ), $attrs );   $shopify_embed = <<; return $shopify_embed; }

 

As you can see, there's nothing too complex in there. We just merge the default values for our previously declared attributes, with the values entered alongside the token, to get the settings for each specific instance of the token.

After that, the complete markup is generated to include a full Shopify widget on the page, without having to allow editors to include "" tags or any other dangerous elements. All of that, with complete WYSIWYG integration that works beautifully, and with a few lines of code. Let's use it:

 

And that would render a functional Shopify widget:

As you can see, it couldn't be easier to implement a plugin. If you're still here, that means you are actually looking for a solution like this. If not, it's always good to have it as an alternative in your toolset.

 

BlogFloat Image with Filtered HTML, WYSIWYG and TinyMCE BlogOverriding styles combo in CKEditor BlogDrupal and Search API: Unleash the power of Aggregated fields Case studyThe National STEM Centre
Categories: Elsewhere

DrupalCon News: Call for Content has Closed for DrupalCon New Orleans

Tue, 01/03/2016 - 07:02

Thank you to all that submitted!  We have a wealth of strong session proposals, training course submissions and worthy grant and scholarship recipients.  Look for more details in the coming days on the content that we have received and are reviewing for your DrupalCon New Orleans.

Categories: Elsewhere

OSTraining: Randomly Show Drupal Content or Users in Views

Tue, 01/03/2016 - 04:51

One of our members wanted to randomly sort their Views results. Fortunately, it's very easy to do this because it's a core feature in Views.

Categories: Elsewhere

ActiveLAMP: Extending Drupal: all about the service container

Tue, 01/03/2016 - 03:00

The biggest thing that got me excited with Drupal 8 is the first-class use of services & dependency-injection throughout the entire system. From aspects like routing, templating, managing configuration, querying and persisting data, you name it – everything is done with services. This is a great thing, because it grants developers a level of flexibility in extending Drupal that is far greater than what Drupal 7 was able to. I’ll walk you through a few strategies of extending existing functionality, leveraging the power of Symfony’s DependencyInjection component.

Read more...
Categories: Elsewhere

Jeff Geerling's Blog: Coming soon: Highly-available Drupal 8 on a Raspberry Pi Cluster

Mon, 29/02/2016 - 23:21

I'm going to bring the Raspberry Pi Dramble with me to php[tek] on May 25 in St. Louis this year, and I'm hoping to also bring it with me to DrupalCon New Orleans in early May (I submitted the session Highly-available Drupal 8 on a Raspberry Pi Cluster, hopefully it's approved!).

Categories: Elsewhere

TimOnWeb.com: Default Search API Sorts Per View in Drupal 7

Mon, 29/02/2016 - 22:16

It's been a while since I've written a post here (especially, Drupal-related). But today I have something interesting to share.

There's a module called Search API sorts (https://drupal.org/project/search_api_sorts) that provides custom sorts and a global sort block for Search API. The module itself is ok, but ...

Read now

Categories: Elsewhere

DrupalEasy: How Do I Become a Web Developer?

Mon, 29/02/2016 - 17:16

If you look at what the experts are forecasting for jobs, it’s hard to find a list of promising careers that doesn’t count web developer in the top 20.

  • The US Department of Labor puts web developer in the Bright Outlook Occupations category, which means it is “expected to grow rapidly in the next several years, will have large numbers of job openings, or is a new and emerging occupation.”

  • Online finance magazine The Street puts web designers at #17 on the list of "Careers to Pursue if You Want the Best Work-Life Balance".

  • US News slots web developer at 20 in the 25 overall best jobs for 2016, and number three of the 9 Best Technology Jobs of 2016, due to an above average opportunity for upward mobility, low stress level rating, and high flexibility.

The average salary is not bad either, with the Bureau of Labor Statistics putting web developers at around $63,000 per year, (compared to just over $32,000 per year in general for people over the age of 25 in the United States.) Rapid growth, low stress and high wages – a vocational trifecta! So why aren’t more people pursuing careers in web development?

Part of the reason might be that it is relatively new (compared to say systems analyst or software engineer,) there is not widespread agreement of specifically what a web developer is, (are designers developers?) and there is no clear documented educational or career track outlined (degree or no-degree; coding expertise or not?)

Add to it the breakneck pace that web technologies are advancing, their gargantuan role in supporting global commerce, culture and government; competition among frameworks and content management systems (should you learn Sharepoint, Wordpress, Drupal?); and then throw in the community cultures of Open Source technologies – and you get a lot of things to figure out. It’s confusing just contemplating it. There are endless options and no steadfast requirements; so how do you know how to even get started?

Well here is some help, at least if you’d like to consider riding the Drupal wave.

As technologies go, Drupal has been growing in worldwide adoptions as the go-to CMS for the top enterprise, media, academic and government sites globally, and with the introduction of Drupal 8, it is sure to attract even more attention from organizations needing a scalable, secure solution for simple to complex sites. With this kind of growth, there is, and will continue to be, huge opportunity for new blood in the Drupal Community in a variety of niches from front-end developers (yes, in Drupal most designers are developers) to project managers.

We’d also like you to consider the quality and collaborative culture of the Drupal Community, which is legendary in the Open Source universe. The culture within Drupal puts contributing and collaborating at a priority level that rivals the quality of the technology side of Drupal. We are really friendly! And, finding your way is always easier with some help from like-minded friends.

In addition, as compensation goes for web developers, Drupal Developers make out pretty well in comparison to other frameworks:

drupal junior developer in United States $64,000

 

joomla junior developer in United States $57,000

 

wordpress junior developer in United States $53,000

 

sharepoint junior developer in United States $57,000

 

View Larger Salary Graph

So, if we've you’re convinced you; the process is now a bit more defined. With a Drupal career, there are several ways you can become a professional, but they all involve three key efforts:

  • Learn: Get skills
  • Engage: Get connected
  • Practice: Get experience

For the learning part, depending on your background and/or the amount of time you have to devote, make sure you find training to learn Drupal in a way that ensures you are endowed with Drupal best practices. DrupalEasy Academy (shameless self-promotion) is the leader in comprehensive Drupal career training, with a 5-year track record of developing top-shelf Drupal talent through our 12-week Drupal Career training. Our next instructor-led online session starts March 21st.

To engage, register on Drupal.org, find some groups that interest you (topics, industries, geography) and begin by learning about what is new, what is being developed, and where you can go locally to meet Drupal professionals. There are meetups in most metropolitan areas, and camps all over the world. Once you start getting a little comfortable with the technology, there are also a lot of ways to learn and meet others by helping to improve the Drupal project. Visit the Getting Involved Guide to help you find your inlet.

To practice, take what you learn, draw on who you meet for some help, and build a site. It’s also a great way to figure out in which area you’d like to specialize. For our Drupal Career Online students who are not already working, we try to match them up with organizations that are looking for interns or junior developers. Sometimes they get paid, sometimes they don’t, but we’ve found that those graduates who devote themselves to building experience in this way have the greatest success.

The important thing to know about success as a Drupal developer, is that the Learn, Engage, Practice process is a career-long commitment. If you want to keep getting better, (which, don’t we all?) you will keep the process going, since that is what ultimately develops your path to success.

For more information and resources on becomeing a Drupal web developer, visit DrupalEasy Academy and check out our how to start a career in Drupal and career resources pages. You can also register for our free online Taste of Drupal information session on March 9 at 3:30 pm EST.

Categories: Elsewhere

Drupal.org Featured Case Studies: The Telegraph Travel Guides App

Mon, 29/02/2016 - 17:03
Completed Drupal site or project URL: http://www.telegraph.co.uk/travel/travelnews/10586491/Telegraph-Travel-Guides-ap...

The Telegraph Media Group is the proprietor of The Daily Telegraph, a British, daily-morning, English-language broadsheet newspaper that is read throughout the United Kingdom and internationally. In addition to The Daily Telegraph, the Telegraph Media Group also publishes advice to travelers online in their app, The Telegraph Travel Guides. The guides are written by local experts, and the free app offers innovative functionality and intuitive advice covering what to do and where to stay, eat, drink and shop.

The Telegraph's editors and writers wanted a modern and simple UI for the Travel Guides App. Their previous CMS was outdated, and content population was a time-consuming process run through Google Spreadsheets. The team also wanted to improve the stability of their Travel Guides App.

Key modules/theme/distribution used: Administration menuChaos tool suite (ctools)DateDrupal PSR-3Entity APIEntity cacheFeaturesHierarchical SelectjQuery UpdateLibraries APIPrepopulateReferencesReferences dialogStrongarmURL fieldViewsViews Field ViewOrganizations involved: Cameron and Wilding LtdTeam members: michael_otolorinitarato
Categories: Elsewhere

NikLP @ Kineta Systems: Drupal 8 tips: Multilingual blog view with no duplicates, but no post omissions

Mon, 29/02/2016 - 16:31

Scenario: I'm building out a multilingual site in Drupal 8. As the site contains a blog, which is obviously built on a view, this throws up a couple of interesting issues. The blog author is fluent in two languages; sometimes, he will post in English (for the wider audience) and occasionally in his native Italian (maybe for a homeland-specific post). Either way, I'd still like the blog to display an entry for each post, so there are no omissions regardless of language.

So, this poses the question - if any post could be in either language, how do I get the blog to be shown in the user-selected language, but show any/all posts written in the other language if they are untranslated (i.e., fall back to Italian if no English translation is available, and vice versa if viewing in Italian)?

A standard blog view, based on a Blog content type and view would be nominally be filtered thus: Content: Type (= Blog) & Content: Publishing status (= Yes) and ordered with: Content: Authored on (desc)

The problem with this unaltered approach is, Views will pull out all blog posts regardless of translation. So essentially, if your last post is translated into two languages, both translations will appear and count as 2 of your (say) 10 most recent posts, which is effectively duplicate content - at least, to the reader.

Solution: Prevent the duplicate appearance of nodes by setting a filter on the view to show only the default translation. Then, request that the view be rendered only in the current language, which will set the view rows as such but use the fallback language if there's no translation.

So, the technical steps for this: Add a new filter by clicking Add and typing "def" into the search field and selecting the "Default Translation" filter under the "Content" category. As an entity can only have one default translation, this ensures they're only shown once. Secondly, set the rendering language preference under "Language" to "Interface text language selected for page". This will attempt to display the views row in the current language and fall back if that's not available.

References

Many thanks to Berdir via http://drupal.stackexchange.com/questions/192782/how-do-i-get-views-content-items-in-my-language-but-fall-back-to-default-if/192805

Blog Tags: DrupalPlanetViewsTranslationMultilingual

Categories: Elsewhere

Tim Millwood: DrupalCon New Orleans 2016 - Proposed sessions

Mon, 29/02/2016 - 11:53
This year I have proposed three sessions for the North American DrupalCon based on the topics I have...
Categories: Elsewhere

Jeff Geerling's Blog: Blog post id enumeration can lead to unwanted information disclosure

Mon, 29/02/2016 - 04:05

With the rampant speculation there will be a new Raspberry Pi model released next week, I was wondering if the official Raspberry Pi blog might reveal anything of interest; they just posted a Four Years of Pi blog post on the 26th, which highlighted the past four years, and mentioned the excitement surrounding 4th anniversary of Pi sales, coming up on February 29th, 2016.

Glancing at the blog's source, I noticed it looks like a Wordpress blog (using httpie on the cli):

$ http https://www.raspberrypi.org/blog/four-years-of-pi/ | grep generator
<meta name="generator" content="WordPress 4.4.2" />

Having set up a few WP sites in the past, I knew there was a simple way to load content by its ID, using a URL in the form:

Categories: Elsewhere

Joachim's blog: Module Builder announces split, due to functionality differences

Mon, 29/02/2016 - 00:28

For Drupal 8, Module Builder is undergoing some big changes. It still builds hooks, a README file, an api.php file, permissions, an admin settings form, but now also builds plugins, services, routing items, and its ability to scan your codebase to learn about hooks invented by any of your modules is now extended to plugin types too. And it's actually been available for Drupal 8 for quite some time, but up till now only as the Drush plugin version.

I've now updated released the D8 version of the module, so you can use an admin UI in Drupal which lets you select the components you want in a form. Unlike Drupal 7 though, the options you enter for your module to generate are stored in a config entity, so you can generate code and then go back and tweak the settings and generate it again, as often as you like.

The big change isn't any of these though. The big change is that Module Builder is being split up.

For a very long time, the Module Builder codebase has been three things in one. Back when I added Drush support (in 2009, according to the git log), it made sense to gradually refactor the code into three parts: the Drupal module UI, the Drush commands, and the common code that does the actual work of generating code based on some parameters (such as which hooks you want, the module name, etc).

That core code has undergone a lot of changes. It's gone from just working with hooks, to a framework that's extensible with new component types. So for example, it's possible to request simply 'an admin form', and the generating code knows to produce the code for the form, the admin permission, and the router item. So that's one component that in fact produces form functions, hook_permission(), hook_menu() on Drupal 7, form class, permissions.yml, routing.yml on Drupal 8. Because Module Builder also works on multiple versions of Drupal (the code to produce Drupal 5 code is even still in there, if you have cause to try it, let me know if it still works!).

Having this multiple-version code within a Drupal module that's only for single version is a source of problems and confusion. The 7.x-2.x version of the project contains a module that's only for Drupal 7, but also the core code and the Drush plugin that both work on all versions. It also increases maintenance work, if we want to the older versions to keep receiving improvements to the generating code.

Hence the split. Module Builder is being divided into three parts:

  • The core code of Module Builder has been moved to a separate library, which is called Drupal Code Builder to distinguish it.
  • The Module Builder project is from now on just Drupal module, which requires the Drupal Code Builder library.
  • The Drush plugin will be moving too, and will also require the Drupal Code Builder library.

So to summarize, the situation is now as follows:

  • To build modules in a Drupal UI, on Drupal 8, you need:
  • To build modules with Drush, on any version, you need:
    • Module Builder 7.x-2.x, installed as a Drush command plugin (again, see the README). But note this will shortly be changing when the Drush command moves out of the d.org project too.
  • To build modules in a Drupal UI, on Drupal 7, you need:
    • Module Builder 7.x-2.x. I will probably release a 7.x-3.x at some point which requires the Drupal Code Builder library, so that the Drupal 7.x UI gets new features that are released in the library.

I'll be writing a post soon about how Drupal Code Builder works, so if you're interested in making Drupal Code Builder make something new, look out for that.

Categories: Elsewhere

Gizra.com: Cross-Site Scripting attack detection

Sun, 28/02/2016 - 23:00

When we develop a website we should take care of many things like design, responsiveness, speed, QA - and of course, security.

One of the major security concerns in websites and web applications is Cross Site Scripting (XSS). You definitely don't want somebody to run their own malicious code in your website. And to avoid it - you would like to have some kind of "vaccine" from such "disease".

We all know about Drupal's check_plain(), filter_xss() and similar functions that sanitize user generated text, but unless we are actively checking for XSS, how can we be sure we've added them on all the right places?

Well, we found a nice solution for it that can be easily applied in your projects as well.

XSS on the title and body fields of an article

Continue reading…

Categories: Elsewhere

Pages