Feed aggregator

Appnovation Technologies: Simple Website Approach Using a Headless CMS: Part 1

Drupal Planet - February 6, 2019 - 15:00
Simple Website Approach Using a Headless CMS: Part 1 I strongly believe that the path for innovation requires a mix of experimentation, sweat, and failure. Without experimenting with new solutions, new technologies, new tools, we are limiting our ability to improve, arresting our potential to be better, to be faster, and sadly ensuring that we stay rooted in systems, processes and...

InternetDevels: Content Moderation module for Drupal 8 content workflows

Drupal Planet - August 15, 2018 - 21:41

Each can enjoy the advantages of working with Drupal CMF in terms of filling a website due to content improvements. Easy content publishing in Drupal 8 is a great advantage of its usage and explains its popularity.

Read more

Mediacurrent: The Marketer’s Guide to Drupal 8: 10 Reasons Enterprise Marketers Choose Drupal

Drupal Planet - August 15, 2018 - 20:29

As marketers, we understand the importance of having a system that promotes ease and efficiency when it comes to implementing marketing processes. You want to create content once and use it over and over in different ways to create contextual user experiences. 

Drupal provides you with a variety of powerful, integrated tools to not only help you understand who your visitors are and what they want to accomplish, but to also dig deeper into their interactions, engagements, and habits with your site. 

Here are just a few reasons why enterprise marketers adopt Drupal. 

1. Enormously scalable - you can’t outgrow Drupal!

Some of the biggest, most visible, and highest-trafficked sites in the world run on Drupal, including, The NBA, Johnson & Johnson, and The Weather Channel. Drupal has proven itself on enterprise websites with over 1M pages and over 20,000 requests per second. In short, you can’t “outgrow” Drupal but can continually add new content and features to your enterprise website.

2. Easily execute your content marketing strategy

A big part of a marketing strategy is content creation, so it is important that marketers are easily able to add new pieces to their website. Drupal allows marketers to quickly add blog posts, videos, and landing pages to their website by filling out a “form” with all of the relevant information and then publishing it. For example, if I want to add a post to the Mediacurrent blog, I can be in and out in less than 7 clicks. In-page editing with Drupal 8 makes the publishing process even faster.  

3. Integrate with Marketing Automation 

Every major marketing automation platform has a custom module created for easy integration into a Drupal website. How do I know? Mediacurrent developed most of them - including the Hubspot, Pardot & Silverpop module!

4. Establish an efficient workflow

A planned workflow is the underpinning of every efficient business process. Whether a business is processing leads, updating a web page, evaluating a capital purchase, or approving new hires, certain actions must take place in order for the function to be completed. Workflow involves the passing of content between people in a chain that abide by a predefined set of rules.  Drupal allows you to easily create a workflow that is customized to your company's processes and team.

5. Create dynamic digital experiences….easily

Drupal fully integrates content, community, and commerce in a single platform. If you’re staying competitive, you’ve likely made a significant investment in creating a dynamic website that really tells the story of your brand and what you have to offer. With Drupal as the backbone for your digital strategy, the options for creating personalized web experiences are endless. Drupal’s architecture makes it the ideal platform for creating and delivering segmented content. 

6. Don’t waste your marketing budget on licensing fees

As open source software, the Drupal package has no license fees, it’s free for you to download, modify, etc. Which means your marketing budget goes towards the things that make your site unique, not towards fees for a large software company.

7. Bridge the gap between IT And marketing

When building a Drupal site, the amount of coding required to maintain or build the site is up to you. A full-featured site can be built fulfilling many business requirements with point and click ease. For us “non-coding” marketers, Drupal allows us to go into each page and easily edit the content while still maintaining the consistency of our branding—without the need to know HTML or CSS.   

8. Benefit from the thriving development community

When a business chooses Drupal, a vast community of support becomes available. Whether it be Drupal’s extensive project issue queues, thousands of nationwide meet-ups and Drupalcamps, or IRC channels, the chances are the problem encountered has been faced before, documented, and has a community willing to help you solve it.

9. You’ll have search engine optimization nirvana 

Drupal gives you control over everything you need to optimize your website for search engines. That includes custom page titles, meta descriptions, URLs, copy, and it plays well with Google Analytics.

10. Security - it’s good enough for over 1 MILLION websites

When deciding on a software solution for your company's digital needs, security is often one of the top concerns. Open source software, like Drupal, has the added bonus of having thousands of talented individuals work on a particular problem. With entire teams and methodology devoted to ensuring its steadfast reputation as a secure CMS. Drupal also have an official “SWAT team” that is well-versed in online software best practices and serves as a resource for all custom module maintainers and code contributors to utilize when submitting custom projects. What passes today as secure code may not stay the same tomorrow when new vulnerabilities surface. There's peace of mind in knowing not only is your online software secure, but that it's also in an active state of safeguarding against security attacks, both past and present.

Because Drupal is not tied to a proprietary vendor’s roadmap, it’s advancing based on the work of thousands of developers around the world. Drupal organically evolves at the speed of the web, offers the cost savings and agility of the open source model, and gives you the ability to integrate content across a range of channels and campaigns.  

In the next blog of the series - we’ll hear from the Chief Marketing Officer at Acquia, about how she is leveraging Drupal 8 to achieve her business goals. 

Agaric Collective: Drupal 8 Content Migrations Training at Drupal Europe

Drupal Planet - August 14, 2018 - 23:41

Agaric is facilitating a full day training at Drupal Europe in Darmstadt, Germany to help you understand how to import content into your to Drupal 8 website.

This training is open for attendees with intermediate experience with Drupal- familiarity with installing a Drupal site and installing modules. We will use the Migrate API and related modules, which allows users to migrate content without writing any code.

With two instructors and a small group size we will ensure no one gets left behind. Instead everyone will get the attention they need.

Attendees will learn to:

  • Import data from CSV and JSON files.
  • Transform the data to populate taxonomy, date, image, file, and address fields.
  • Get content into Paragraphs.
  • Debug migration errors.

For a sneak peak of what you will learn, attend our Drupal Migration Q&A on Friday August 17th at 14:00 UTC (10 AM ET) on Zoom at https://zoom.us/j/3307127772

Regular training price is €476, however we are offering an early bird registration price of €276 from now through Sunday, August 19th. Space is limited so we do encourage registering early to take advantage of the price and ensure your spot.

As a web development cooperative that champions free software, we're passionate about migrations. It is a way to better understand Drupal's codebase, tap into the power of new features and build community. We have successfully migrated multiple sites to Drupal 8, including large projects with custom modules and hope to share that experience with you.

*/

Register for Migration Training


Not able to make it to the training? No worries, we offer trainings on a regular basis. Sign up for our low-traffic, announcement only list to stay informed of future trainings. These will not be sent more than a few times a year.

Subscribe to our Training Announcement list * indicates required


Email Address *


First Name


Last Name


Acquia Developer Center Blog: A Dozen Reasons Why You Should Attend DrupalEurope in Darmstadt, Germany this September

Drupal Planet - August 14, 2018 - 20:59

DrupalEurope, which will be happening from September 10 through 14, 2018 in Darmstadt, Germany, describes itself as "both a technology conference and a family reunion for the Drupal community." 1600+ attendees are expected.

The buzz around this event has been unusually high, especially in the greater Acquia metaverse, for 12 reasons. Here they are.

Tags: acquia drupal planet

OpenSense Labs: Interactive Screens: Drupal for Building Digital Signage Solution

Drupal Planet - August 14, 2018 - 20:47
Interactive Screens: Drupal for Building Digital Signage Solution Shankar Tue, 08/14/2018 - 19:17

Possibly the greatest ever digital signage advertising was created for British Airways which had it all. The advert, connecting to live flight information, displayed a child pointing up to the sky as an aeroplane flew above him. This was so cleverly done that the advert showed the flight number and its destination as well.

What a great blend of entertainment and education using the latest technologies! Source: British Airways

The digital signage system is scalable and its usefulness can be extracted to a great extent like digital menu boards for restaurants or the interactive digital movie posters for movie theatres. Drupal has the power to be a remarkably scalable digital signage solution for different sorts of organisations thereby reducing costs, speeding up time to market, and building engaging experiences for the people.

Digging Deeper Into The Terminology: Digital Signage

Digital signage refers to a centralised content dissemination platform for serving digital content on screens. It can be leveraged to display information through television programming, menus, advertising and other messages.

It can be seen in the form of digital signboards, billboards, and other such display devices for displaying visual information. It is connected by a content management system like Drupal that sends the digital content to be displayed. The information displayed can be anything ranging from static data and charts and graphs to images and video streaming.

Digital signage is a centralised content dissemination platform for serving digital content through television programming, menus or advertising on screens.

It can be commonly seen in outdoor marketing campaigns to display promotional content. Moreover, industries that rely on real-time information delivery to its employers or customer such as stock exchanges, airports, and sports stadiums can use digital signs to a great extent.

Digital Signage Can Be Used In Awesome Ways

Its uses can be seen through the eyes of organisations to understand the different ways it can be implemented. Some of the biggest brands have harnessed its immense potential.

Netflix, one of the largest over-the-top media service providers, carried a promotional campaign that relied on the humbled animated GIF. Instead of using a long video clip, they opted for reaction-based clips which were just a few seconds long. These videos were tied into the events that were actually happening around the globe.


Swedish pharmacy Apotek Hjärtat developed a controversial billboard using a built-in smoke detector. Every time a smoker passed by, the billboard would cough loudly at them before displaying a series of products to help people stop smoking. Although it turned heads, questions were raised whether such an overt messaging is effective or not.


Coca Cola’s Small World Machines Initiative had a grand ambition and offered a live link between India and Pakistan. Coke machines were placed in both the nations where people could interact with one another through the screen like touching hands, drawing peace, love, and happiness symbols together.

A Trio Of Major Merits Through Digital Signs

Enormous possibilities of digital signs are pretty evident with so many big brands using them to a great effect. Using digital signs can prove beneficial in many ways.

  • Enhances customer engagement: People love colourful and moving images rather than static images which help in enhancing user engagement.
  • Makes a good impression: Content can be updated remotely within seconds. For instance, such quick updates can help retailers to form a good impression and adjust to customer demands without having to deploy employees or new signs printed.
  • Revs up revenue: Digital signs can help increase your sales and revenue. In 2014. Taco John deployed digital menu boards and witnessed a 12% increase in sales.
How Can Drupal Be The Perfect CMS For Digital Signage Solutions?

Well, it all boils down to the CMS that would be relaying digital content on to the screen to attract people. Drupal is one of the big players in the content management systems that can be the perfect fit for creating digital signs.

Content Creation

Your CMS should allow the content creation to be done intuitively and support all the common file types. Drupal comes with intuitive tools for content creation, workflow and publishing for streamlining content authoring.

Remote Access

With Drupal, on-the-go team members can assess, edit and approve content from mobile devices to keep content and promotional campaigns flowing on to the screens regardless of where they are and what device they are working on.

Content Revision

Drupal helps in enabling a swift and simple way to track all the alterations and revisions which is a must-have if you have multiple editors and need to handle a history of content changes.

Content Workflow

Drupal allows you to administer custom, editorial workflows for all the processes involved in the content production. It lets you view the stage your content is in - from creation to assessment to publication.

User Controls

Authentication and user permissions in Drupal helps in handling editorial workflows efficaciously and previews show how the content will look on screen before the content editors would finally approve and relay them on to the screens.

Content Scheduling

Drupal has the provisions for scheduling the content at your own convenience. It is possible to schedule a campaign to be published at a certain time. In case, a campaign is no longer required or outmoded, it can be unpublished as well.

Security

Drupal is one of the most secure CMS platforms among the leading players like Wordpress, Joomla and Magento. In a report published by Sucuri called Hacked Website Report, Drupal turned out to be the least vulnerable to security attacks in comparison to Wordpress.

Scalability

Your CMS should be able to grow with you and accommodate more screens. Drupal is a highly scalable solution with high traffic sites like Grammy, NBC Olympics, University of Oxford and many other renowned names performing astoundingly well even during the busiest of times.

Support And Maintenance

Drupal is an open source solution and you can rest assured that the Drupal community comprises of numerous vendors who are adept at providing round the clock support and maintenance.

At Opensense Labs, we have designed the Bucket and on-the-go models of support and maintenance services. We offer support in the day-to-day operations. Our support hours run parallelly with business hours but are extendable as per your needs.

Use Cases

The University of Iowa, which is powered by Drupal, kicked off a Drupal Digital Signage Service to offer new digital capabilities inside the campus.

Drupal’s flexibility in content management and delivery in combination with Intel Compute Sticks, mini-computers that serve each screen or sign, proved rewarding. This helped in offering wireless connectivity to the Drupal-based content as it is relayed on to the screens in real-time.

Source: University of Iowa

The digital signs provided key information for students like the time at which a bus would arrive or leave, emergency alerts, advertisements for student groups, computer lab availability, university news, and events etc.

The University reported rapid adoption of the service as many colleges and divisions within the University used the free and user-friendly solution on several screens. Stakeholders used templates and drag and drop tools and widgets for customising and governing the screen content.

The University’s move to expand the use of Drupal to digital signs proved beneficial in many ways. An IOWA NOW news story stated that “the backend is incredibly user-friendly. It’s the same system our websites run on, and so very intuitive. The web-based platform allows us to update information and slides from anywhere and anytime”.

Being an open source software, Drupal incurred no licensing fees. Hardware costs were lower too. Thanks to the project team’s discovery that the digital signs could be run on small, energy-efficient compute sticks. Moreover, wireless connectivity eliminated the expense of data ports and cabling.

Source: University of Iowa

The Drupal Digital Signage system, rather than using a webpage, used a specialised software application. This made the displaying of content as simple as plugging the URL of a sign into a browser. Users were granted access permissions for specific signs and by utilising templates and a drag-and-drop interface, they could display the content or widgets in numerous regions of the screens. That content, displayed on the screen, could also be shared with other units.

Furthermore, the digital signs, being accessible to all screen-reading technologies, saved staff time. Being easy to learn, training time got reduced.

Content editors only needed to enter news or events into a familiar interface. The content would go to both their websites and digital signs simultaneously without having to perform double entry.

Another use case can be seen through Open Y Drupal distribution which was developed by the YMCA of Greater Twin Cities. The objective was to build a platform that would enable all YMCAs to operate as a unified brand through a common technology. Open Y, built on top of Drupal 8, helps in delivering a multi-channel experience for websites, mobile applications, digital signage and fitness screens.


The website of Open Y allows customers to schedule personal training appointments, make online donations to their local YMCA, or look up for monthly promotions. Leveraging the merits of Drupal 8’s API, Open Y integrates all of their systems with Drupal. This comprises its integration with Open Y’s Customer Relationship Management (CRM) and eCommerce partners but also stretches to fitness screens and wearables like Fitbit.

So, Open Y can use Drupal as a data repository to relay content such as alerts or promotional campaigns to digital signage screens, connected fitness consoles and fitness tracking applications. It, thus, puts Drupal at the core of its digital platform to offer seamless and personalised experiences to its members.


The web-integrated digital signage system for displaying content was demonstrated in a session in DrupalCon Vienna 2017. In this system, the  Open Y Drupal distribution was used to serve as a proxy between resources that would provide information about the scheduled activities. In addition to this, it was leveraged to govern the content and to supplement it with both the marketing content and time and location sensitive messaging.

Future Of Digital Signage

According to the statistics given by the Statista, the statistics portal, the digital signage market worldwide was valued at 19.61 billion U.S. dollars in 2016 and the display market was estimated at 6.07 billion U.S. dollar in 2015.

Future of digital signage is bright as is for Drupal and together they can work wonders. Source: Statista

This number is going to see a significant rise by 2023 as the market value is poised to reach 32.84 billion in 2023. Digital signage technology is not just here to stay but grow multifold.

Conclusion

Digital content distribution can surely be taken to next level by making it engaging through digital signage solutions. Drupal can be the perfect choice of CMS for relaying content on screens.

We provide Drupal services with top-of-the-line expertise. Contact us at hello@opensenselabs.com to explore Drupal as a superb platform for building digital signage solutions thereby providing a whole new level of customer experience.

blog banner blog image Blog Type Articles Is it a good read ? On

ComputerMinds.co.uk: Localising dates in twig templates

Drupal Planet - August 14, 2018 - 17:14

A client noticed the dates on their news articles were not being translated into the correct language. The name of the month would always appear in English, even though all the month names had themselves been translated and showed correctly elsewhere. The problem turned out to be down to the twig filter being used in the template to format the date. This is what we did have:

{% set newsDate = node.getCreatedTime|date('j F Y') %}
{% trans %} {{ newsDate }}{% endtrans %}

So this would produce something like '1 March 2018' instead of '1 März 2018' when in German. This was because twig's core date() filter simply isn't aware of Drupal's idea of language.

I switched out the date() filter and used Drupal core's own format_date() filter instead, which uses Drupal's own date.formatter service, which is aware of language. It ensures the month name is passed through t() to translate it, separately to the rest of the numbers in the date. So it now looks like this:

{% set newsDate = node.getCreatedTime|format_date('custom', 'j F Y') %}
{% trans %} {{ newsDate }}{% endtrans %}

Having done that, I realise the original code was the equivalent of doing this:

t('1 March 2018');

(I'm less of a front-end coder, so putting it in PHP makes it more obvious to me than twig code!)

So the date actually was translatable, but only as the whole string -- so unless the translators had gone through translating every single individual date, the German month name was never going to show!

What I needed was the twig equivalent of using placeholders like this PHP example:

t('My name is @name, hello!', ['@name' => $name]);

When you use variables between twig's trans and endtrans tags, they really are treated by Drupal as if they were placeholders, so this is the twig version:

{% trans %} My name is {{ name }}, hello! {% endtrans %}

This helped me understand twig that little bit more, and appreciate how to use it better! Regardless of formatting dates, I now know better how to set up translatable text within templates, hopefully you do too :-)

Drupal Europe: How Publiq is using blockchain to tackle urgent challenges for publishers

Drupal Planet - August 14, 2018 - 16:40
Drupal Europe: Publishing + Media Special Focus

What industries come to mind when you hear blockchain? Banking? Trading? Healthcare? How about publishing? At Drupal Europe publishers will gain insights into the potential blockchain technology offers and learn how they can benefit. Meet Gagik Yeghiazarian, founder of the nonprofit foundation Publiq, and learn how he wants to fight fake news and build a censorship-resistant platform — using blockchain.

The publishing world is changing. Publishers no longer solely control media distribution. Big players like Facebook and Google are middlemen between the publishers and their readers, and technology built to entice publishers — Google’s AMP (Accelerated Mobile Pages) and Facebook Instant Articles — has strengthened social platforms as distribution channels. Additionally, publishers have lost money making classifieds business as employment and real estate markets create their own platforms and portals to reach the audience.

Photo by Ian Schneider on Unsplash

As a result of these developments, publishers are losing direct relationships with their readers as well as critical advertising which traditionally supported the editorial and operational costs. The platforms act as middlemen, using the content of the publishers for collecting data and selling them to advertisers. The publishers are left out in the cold.

Critically, publishers are also facing a crisis of confidence. As social platforms are used to spread fake news and poor content, mistrust in journalism grows.

The nonprofit foundation Publiq wants to face these challenges with a blockchain-powered infrastructure. It aims at removing unnecessary intermediaries from the equation and helping to create an independent, censorship-free environment. Gagik Yeghiazarian, CEO and Co-Founder of Publiq, is convinced: “Blockchain infrastructure allows content creators, readers and other participants to build a trusted relationship.”

You can learn more about Publiq and its blockchain infrastructure at Drupal Europe in Darmstadt: Gagik Yeghiazarian’s session “Blockchain Distributed Media — A Future for good publishing” will give you a glimpse into this new technology and a real-world application of it.

While you’re at Drupal Europe, be sure to check out the exciting blockchain panel discussion where Gagik, Ingo Rübe of Botlabs, and Taco Potze of Open Social, will share insights and use cases for blockchain technology. Don’t miss this!

Drupal Europe
Publishing & Media — Track Chairs

PreviousNext: Testing Drupal with WebDriver browser mode vs Headless browser mode

Drupal Planet - August 14, 2018 - 10:49

There is not a lot of documentation available about what's the difference between running a browser in WebDriver mode vs Headless so I did some digging...

by Jibran Ijaz / 14 August 2018

Apparently, there are two ways to run Chrome for testing:

  • As WebDriver
  • As Headless
WebDriver:

There are two ways to run Chrome as WebDriver:

Using Selenium:

Run Selenium standalone server in WebDriver mode and pass the path of ChromeDriver bin along with the config e.g. Selenium Dockerfile

This works fine with Nightwatch standard setup, \Drupal\FunctionalJavascriptTests\JavascriptTestBase and also with Drupal core's new \Drupal\FunctionalJavascriptTests\WebDriverTestBase.

Using ChromeDriver:

Run ChromeDriver in WebDriver mode e.g. chromedriver Dockerfile

This works fine with Nightwatch, JTB, and WTB.

Headless: Using Chrome

Run Chrome browser binary in headless mode. e.g. Chrome headless Dockerfile

Nightwatch is not working with this set up, at least I was unable to configure it. See https://github.com/nightwatchjs/nightwatch/issues/1390 and https://github.com/nightwatchjs/nightwatch/issues/1439 for more info. \DMore\ChromeDriver can be used to run the javascript tests.

Using ChromeDriver

Using Selenium ChromeDriver can be run in headless mode something like this:

const fs = require('fs');
const webdriver = require('selenium-webdriver');
const chromedriver = require('chromedriver');

const chromeCapabilities = webdriver.Capabilities.chrome();
chromeCapabilities.set('chromeOptions', {args: ['--headless']});

const driver = new webdriver.Builder()
  .forBrowser('chrome')
  .withCapabilities(chromeCapabilities)
  .build();

DrupalCI is running ChromeDriver without Selenium and testing Nightwatch and WTB on it.

Conclusion

The question is which is the best solution to run Nightwatch and JTB/WTB tests using the same setup?

  • We had seen some memory issues with Selenium containers in the past but we haven't run into any issue recently so I prefer this and you can swap Selenium container to use different browsers for testing.
  • We have also seen some issues while running ChromeDriver in WebDriver mode. It just stops working mid-test runs.
  • I was unable to get Headless Chrome working with Nightwatch but it needs more investigation.
  • Headless ChromeDriver setup on DrupalCI is quite stable. For JTB this would mean that we could use anyone from \Drupal\FunctionalJavascriptTests\DrupalSelenium2Driver and DMore\ChromeDriver.

Please share your ideas and thoughts, thanks!

For more info:

Tagged Testing, nightwatchjs, Functional Testing

Agiledrop.com Blog: AGILEDROP: Drupal is Easy with Michael Anello

Drupal Planet - August 14, 2018 - 09:11
Agiledrop is highlighting active Drupal community members through a series of interviews. Learn who are the people behind Drupal projects.  This week we talked with Michael Anello. Learn about his volunteering, how successful DCO is and on what contributors he is most proud of.   1. Please tell us a little about yourself. How do you participate in the Drupal community and what do you do professionally? I am an active Drupal community member, volunteering for the Drupal Association's Community Cultivation Grants committee, the Drupal Community Working Group, and the Florida Drupal Users'… READ MORE

Palantir: Drupal Chicago: The Decoupled Ouroboros

Drupal Planet - August 14, 2018 - 06:36
Drupal Chicago: The Decoupled Ouroboros July 11, 2018 brandt Mon, 08/13/2018 - 18:36 Caxy Interactive, Chicago, Illinois Drupal Chicago (official meetup site) Federated Search with Drupal, SOLR, and React (AKA the Decoupled Ouroboros)

Join Palantir's Avi Schwab for a discussion at the Drupal Chicago Meetup. He'll be going over a recent Palantir project and how we bring content from disparate sites (D7, D8, Wordpress) into a single index and then serve results out in a consistent manner, allowing users to search across all included properties. Avi will discuss how we got started with React, our process for hooking up to SOLR, and how we used Drupal to tie the whole thing together.

  • Date: Wednesday, July 11, 2018
  • Time: 5:30 - 7:30pm
  • Location: Caxy Interactive, 212 West Van Buren Street, Chicago, IL
Mon, 06/25/2018 - 12:00

Palantir: Decoupled Days 2018

Drupal Planet - August 14, 2018 - 05:36
Decoupled Days 2018 August 17 - 19, 2018 brandt Mon, 08/13/2018 - 17:36 John Jay College of Criminal Justice, New York, New York Decoupled Days (Official Site)

Decoupled Drupal was a hot topic at DrupalCon Nashville, and Palantir is very excited to be Silver Sponsors of this year's Decoupled Drupal Days. Keep an eye out for Jes ConstantinePatrick Weston and Avi Schwab; they'll be attending the event and would love to hear about your recent decoupled projects. 

Federated Search with Drupal, SOLR, and React (AKA the Decoupled Ouroboros)

Avi and Jes will be presenting on Friday and giving an overview of a recent Palantir project. He'll explain how we bring content from disparate sites (D7, D8, Wordpress) into a single index and then serve results out in a consistent manner, allowing users to search across all included properties. He'll also go over how we got started with React, our process for hooking up to SOLR, and how we used Drupal to tie the whole thing together. More details can be found on the official site

  • Date: Friday, August 17, 2018
  • Time: 2:45 PM
  • Room: Aten Design Group Lecture Hall

 

Mon, 08/13/2018 - 12:00

Gbyte blog: Get image URL from media field in twig

Drupal Planet - August 14, 2018 - 02:23

Apparently there are still pretty common Drupal 8 theming tasks that cannot be accomplished with the great twig_tweak module. This by the way was me giving a plug to a great little module, which makes half of all your theme preprocess hooks unnecessary.

If you would like to get the URL from an image that is trapped inside of a media entity however, you can either extract it using the aforementioned preprocess function like so:

DrupalEasy: Market Driven Recruiting: Affinity Hiring, Train as Needed

Drupal Planet - August 14, 2018 - 01:33
Drupal Career Online Case Study: Rosewood Marketing

Like their arboreal namesake, Rosewood Marketing is amazingly sound and particularly suited for very specific applications. Where the Rosewood tree serves to form the structure of certain fine musical instruments, billiard cues and chess pieces, Rosewood Marketing serves as a bridge for dozens of Amish and Mennonite small businesses to mainstream society. Their growth and development over the 22-year span of their success is not just in their marketing prowess, but in their inherent, sincere understanding of their client culture.    

If you really think about it, Rosewood has perhaps one of the most focused and secluded market segments in the US, which interestingly enough allows them to bring a type of diversity to the Drupal Community we don’t often consider. They do this amazingly well in their approach to business development and hiring. They first truly match new employees to their market and their company culture, and then leverage training programs to ensure the team has the skills and best practices in technology and communications to meet their business standards.  A person hired as a graphic designer receives training in tools such as Photoshop, InDesign, design principles and customer service. An online marketer receives training in analytics, SEO, and PPC, while a new manager learns time management.

Others become web developers, and as our luck would have it, DrupalEasy students and graduates. Of Rosewood’s 16 member staff, two are Drupal Career Online graduates and one new hire has just been enrolled in the upcoming Fall 2018 session.  Our new Rosewood student already has experience in Drupal 7, but needs to move forward in Drupal 8. Adrian Nolt, a 4-year employee of Rosewood and a Fall 2017 DCO graduate, explains, “Even though Stephen has...Drupal site-building experience, I recommended that he take DCO in order to acquire a common training foundation as our other Drupal developers...For me as a primarily self-taught Drupalist, DCO filled in knowledge gaps, and I would like for Stephen to experience the same joy.”

Stephen Ebersole, who was hired recently, works remotely for Rosewood, with his primary residence in Georgia, and currently living in Honduras serving his church. He, like most Rosewood employees, is a member of a Mennonite community.  Adrian explains, “Since Rosewood's target market is businesses run by members of the Plain Communities...besides the native understanding of our target market, we feel that while Drupal may be hard to learn, it is easier to pick up than people skills and a solid work ethic.”  

Adrian highlights the importance of this native understanding by explaining, “Many members of the Plain Communities are devout Christians with strong convictions...If a Rosewood team member does not...appreciate why his or her client will, for example, give up internet access in order to free himself from unnecessary temptations, he or she will not be able to make recommendations that align with our client's values. This understanding is more important to our ability to serve our clients well than expertise in a specific technology.”

Adrian continues, “...as soon as an employee has sufficient proficiency to perform basic tasks, he or she begins working on paid work, even if it means billing our clients at a reduced shop rate for a time. We believe that learning by doing is one of the most efficient ways to learn..though... can leave holes in a person's knowledge. For some of us, taking DrupalEasy's DCO course is about filling in the gaps and providing a common foundation for working together. However, it is also one of the fastest ways I know to get a Drupal beginner up to speed and productive with Drupal.”

The team at Rosewood has used video courses, but they have found for their purposes,  says Adrian, that “...many are too basic or not opinionated enough to apply to most real-life Drupal development practices.” He continues, “For example, they may teach installing Drupal 8 from a tarball, but we had already committed to a composer-driven workflow for Drupal 8 as the safest long-term bet, and I was looking for a course that teaches a professional development workflow. DrupalEasy DCO has proven to be the well-rounded, just-deep-enough training we were looking for, and as long as Drupal remains one of our specialties, we expect to consider it as part of our Drupal training regimen.”

Adrian feels the most valuable aspects of the DCO include clarifying the intersections of fields, blocks, entity types, content types, and relationships, which he says can be an "ah-ha" moment to someone just getting started. He also appreciates becoming familiar with command-line, git, local development, and views, as it is a must for success in Drupal 8, which he feels is a huge hurdle for those getting started. He adds “...the value of DCO lies in how it connects all the pieces, such as workflow, data architecture, module development, theming, and the business of Drupal, together into one comprehensive introduction to the Drupal ecosystem.”

Rosewood’s clients are primarily in the agricultural industry, or are builders, retailers, craftsmen, and small manufacturers, including small businesses such as  Vierbike, MM Weaver and Blue Ridge Furniture. The company is now going with other CMS options for simpler sites, but Adrian emphasizes,  “Drupal continues to excel at use cases that require structured data and over 30 pages. We feel that having Drupal in our tool bag allows us to provide outside-the-box marketing solutions to our clients simply by combining modules and configuring the user interface. On other platforms, competitors may need to resort to custom code or make compromises in order to use an out-of-the-box solution.”

As far as their training philosophy, that is evolving as well, according to Adrian, “In the past, we prescribed training when a person was hired or when they needed to learn something new. However, we have begun budgeting training dollars and time into our annual budgets in order to continually grow as professionals and as a company.” He continues, “Hiring and training people is a way to scale our service-based business to serve more clients. Continued education adds to our in-house skill set to allow us to serve them in more ways and more efficiently. Happy clients = successful Rosewood.” He adds, “We don't know the future, but judging by the past, we will continue to hire and train employees.”

The Fall 2018 session of Drupal Career Online starts September 3rd.  Group rates and government discounts are available. If you‘d like more information, join us for our no-cost mini-webinar Taste of Drupal on Monday, August 27.  

Drupal Europe: Drupal Europe: Publishing + Media Special Focus

Drupal Planet - August 13, 2018 - 22:48
Digital Assets Management in multi-channel publishing environments

Drupal Europe offers up a plethora of cases and solutions to help you with your DAM integration.

Multichannel publishing by Oleksiy Mark on Shutterstock

With so much to organize and store, publishers typically use Digital Asset Management Systems (DAM) to manage their assets. Add multiple channels to the mix and you have big operational hurdles. Thanks to the Media Initiative, Drupal now has a well-defined ecosystem for media management and its architecture is designed to play well with all kinds of media, media management systems, and web services that support them. The system is highly adaptable — the media management documentation outlines 15 modules shaping Drupal’s new ecosystem for media assets.

The Drupal Europe program offers several sessions to help you learn more about solutions building on this foundation. Case studies of demanding media management projects around the publishing industry include:

Blockchain — why should publishers care?

How Publiq is using blockchain to tackle urgent challenges for publishers

What industries come to mind when you hear blockchain? Banking? Trading? Healthcare? How about publishing? At Drupal Europe publishers will gain insights into the potential blockchain technology offers and learn how they can benefit. Meet Gagik Yeghiazarian, founder of the nonprofit foundation Publiq, and learn how he wants to fight fake news and build a censorship-resistant platform — using blockchain.

The publishing world is changing. Publishers no longer solely control media distribution. Big players like Facebook and Google are middlemen between the publishers and their readers, and technology built to entice publishers — Google’s AMP (Accelerated Mobile Pages) and Facebook Instant Articles — has strengthened social platforms as distribution channels. Additionally, publishers have lost money making classifieds business as employment and real estate markets create their own platforms and portals to reach the audience.

Photo by Ian Schneider on Unsplash

As a result of these developments, publishers are losing direct relationships with their readers as well as critical advertising which traditionally supported the editorial and operational costs. The platforms act as middlemen, using the content of the publishers for collecting data and selling them to advertisers. The publishers are left out in the cold.

Critically, publishers are also facing a crisis of confidence. As social platforms are used to spread fake news and poor content, mistrust in journalism grows.

The nonprofit foundation Publiq wants to face these challenges with a blockchain-powered infrastructure. It aims at removing unnecessary intermediaries from the equation and helping to create an independent, censorship-free environment. Gagik Yeghiazarian, CEO and Co-Founder of Publiq, is convinced: “Blockchain infrastructure allows content creators, readers and other participants to build a trusted relationship.”

You can learn more about Publiq and its blockchain infrastructure at Drupal Europe in Darmstadt: Gagik Yeghiazarian’s session “Blockchain Distributed Media — A Future for good publishing” will give you a glimpse into this new technology and a real-world application of it.

While you’re at Drupal Europe, be sure to check out the exciting blockchain panel discussion where Gagik, Ingo Rübe of Botlabs, and Taco Potze of Open Social, will share insights and use cases for blockchain technology. Don’t miss this!

Drupal Europe
Publishing & Media — Track Chairs

OPTASY: How to Get Gatsby to Work with Drupal: Building a Gatsby Site with a Decoupled Drupal Back-End

Drupal Planet - August 13, 2018 - 20:48
How to Get Gatsby to Work with Drupal: Building a Gatsby Site with a Decoupled Drupal Back-End radu.simileanu Mon, 08/13/2018 - 13:48

Just imagine: putting together the powerful UI creation tools of a static site generator — more of a modern front-end framework rather —  built for high speed, like Gatsby.js, with Drupal 8's content modeling and access system! Putting their powers together into a blazing-fast website! But how to get Gatsby to work with Drupal?

How do you build a plugin that fetches data from API-first Drupal? In short: a static, conveniently simple, yet robust Gatsby site powered by a powerful, decoupled Drupal back-end?

You've got the questions, we've got the answers...

OpenSense Labs: Content Staging With Drupal Deploy Module

Drupal Planet - August 13, 2018 - 13:22
Content Staging With Drupal Deploy Module Gaurav Kapoor Mon, 08/13/2018 - 11:52

There might be instances where an editorial team comes across challenges in the process of publishing its content. These include:

  1. Living a number of articles at the same time.
  2. Sending the final copy of approval on a website to different people but not living it. 
  3. Publishing a number of articles on different websites/subdomains. 

Luckily, the Drupal Deploy module allows content staging and publishing without the user requiring to log into the target site. This is very handy when there are a number of people involved or multiple sites, in case of media and publishing websites especially.

What is Content Staging?

Content Staging is an in-house development environment where a team is involved in creating various kinds of content. This includes all the stages a piece of content has to go through before actually going to the production site. 

Exploring Drupal Deploy Module

The Deploy module allows users to easily stage and preview content for a Drupal site in different environments. The module automatically manages dependencies between entities and is designed to have a rich API which can easily be extended to use in a variety of content staging situations.

It allows: 

  • Cross-site content staging

To stage content between different Drupal sites.

  • Single-site content staging

Provide a workspace preview system for single-site content staging.

  • Fully decoupled site

Create a decoupled Drupal site.

The Deploy module is designed to allow users to easily stage content from one Drupal site to another. How To Use Drupal Deploy Module? Installation

Deploy module has various Drupal and PHP dependencies so the best way to install it, is by using composer.

composer require 'drupal/deploy:^1.0'
Exploring Deploy Suite

Once we run this command in our Drupal website we get all the modules and PHP libraries required to run the Deploy suite. Let’s have a quick look at all of the modules: 

  • Conflict: It provides resolution for conflicts which merge due to changes in translatable fields in non-edited content entity translations, changes in fields to which the user does not have access, fields with no edit access, fields not part of the entity form display, changes in entity metadata, revision ID, changed timestamp.
     
  • Key-value Extensions: A very important module which helps in speeding up the Deployment process. It extends the core key-value API with a backend for lists and sorted sets that you can do range queries on.
     
  • Multiversion: Multiversion will convert all core content entities on your site to be revisionable. Since Deploy suite is built around the revisionable entities, it is an important module in the process of Deployment.
     
  • Replication: This module provides the functionality and services to assist with replicating content between workspaces on a single site (using the Workspace module) or between workspaces across different sites (using the Relaxed Web Services module).
     
  • Workspace: Provides the ability to have multiple workspaces on a single site to facilitate things like the full-site preview and content staging.
Single-Site Content Staging

The Distributed Management of Content deals with the workflow involved in the content creation with a decentralized approach. The process can be very complicated and requires different levels of managerial checks. Deploy module, in that case, can turn out to be the best solution.

To use the Deploy content staging we have to enable the Deploy module which automatically installs all the required contributed modules, perform database operations and supply required default configurations for the modules.

To use Deploy it is worthwhile to check its out-of-the-box configurations and plan Deployment strategy for your website, accordingly.

  1. Go to Admin Structure Workspace to check the workspaces provided by default. This becomes important later during the content transition stages. We have a Live and stage workspace and also functionality to add more of the workspaces as per our requirement. By default, the Live workspace is active and Stage inactive. It means that all the content added will be available on the Live Workspace.

    We also have an ability to set target workspaces on content updation as well which content entities to replicate.
     
  2. Following settings can also be accessed via admin toolbar on any page of the website. To continue with the deployment process, go ahead and select ‘Stage’ as the active environment from workspace switch option in the admin toolbar.
  3. Now since we are currently on Stage workspace, all the content added will only be visible to those with access to View content in a particular workspace.
     
  4. Go ahead and add 10 articles via Node → Add → Article interface. As soon as all the articles are added they start appearing on Homepage for the user with access to the content. If we check website anonymously we won’t be able to see any of those articles and will get a 'Page Not Found' error. 

    At this particular time, all the content editors and stakeholders can have a look at the content, modify it or even remove it. 
     
  5. To deploy all articles on Live workspace go to Admin → Structure → Deployment Start New Deployment.Provide a Deployment title and a description to keep a track record of all the Deployments.

Once we Deploy to Live, all the articles are available on the Live workspace after the next cron run.

Advantages
  1. Publish multiple articles at the same time, without accessing them individually. 
     
  2. Deploy provides various kinds of permission such as Access content on a particular workspace.
     
  3. It also detects for changes done on the Live workspace directly and provides an interface for conflict resolution and content synchronisation between various workspaces.
     
  4. You can create workspaces as per your requirement, For example, providing workspace for each content editor and then comparing the overall impact. Based on that you can very easily deploy content from various workspaces to the Live Workspace.
Cross-Site Content Staging  

Deploy module can be used with the Relaxed module to extend all the capabilities of Deploy suite for multiple websites. We can configure as many remotes as we want and then Deploy content on various websites.

  • Relax module can also be installed via composer using the following command.
composer require 'drupal/relaxed:^1.0'
  • After enabling the module, the relaxed remote endpoint can be configured from Admin → Config → Relaxed → Settings.This endpoint will be used by the remote websites to interact with the workspaces available in your local.
     
  • To interact with remote endpoints they have to be configured in Admin → Config → Services → Relaxed → Add.
  • Once you have set up the Remote, you can then Deploy content to remote workspaces as well.

Drupal allows Distributed Content Management strategy to be applied to large volumes of content to facilitate efficient workflow. Specifically, the system allows different content and editors to be part of the same system without much replication, and Deploy module just helps build the architecture right.

blog banner blog image Blog Type Tech Is it a good read ? On

Agaric Collective: Daily Business Operations Using Free Software

Drupal Planet - August 12, 2018 - 21:08

People often ask about the free software tools Agaric uses to manage our cooperative business. In this article, we share some of the free software tools we use for office tasks and administration as well as communications. These are Agaric's chosen resources -- the tools we use today for our daily business operations.

Agaric uses free software whenever possible. We build websites using Drupal, a free software content management system, and we are long time participating members of the Drupal Community. When we cannot use free software, we actively search for and contribute to groups working towards solutions.

Here is our reasoning behind the choice to use Free Software whenever possible:
The Need for Accountable Technology - Part 1

You may also wonder why we say "Free Software" and not "Open Source" since the code in both instances is essentially the same. We use the term "Free Software" because it includes the ethical principles about respecting user's freedom. Free software ethics say that users deserve control over the code they use, whereas using the term "Open Source" cites only the goal of letting users participate in the development. We support the ideals of software protecting your rights and not leaving you vulnerable.

What is Free Software?

A program is free software if the program's users have the four essential freedoms:

  1. The freedom to run the program as you wish, for any purpose (freedom 0).
  2. The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1).
  3. The freedom to redistribute copies so you can help others (freedom 2).
  4. The freedom to distribute copies of your modified versions to others (freedom 3).

Access to the source code is a precondition for this. To determine whether the source code is free, see what license it carries and then check the GNU project's list of licenses.

We do a few tasks that we do not have free software for. So, we use non-free programs for them. Sometimes we use specific non-free software that a client insists on including in the web site. By using non-free programs we sacrifice some of our freedom; some activists would refuse to do that. We do not like the compromise, so we help develop free replacements for those programs. Whenever possible we use software that reflects our values.

GNU/Linux OS

Free operating System - similar in features to Windows and Mac.
We have chosen to use GNU/Linux as our default system for our local development. When we take on a new student we install a GNU/Linux distribution. We always give the option of installing a different distribution, or if a student wishes to do so, they may. These are the favored GNU/Linux distributions in use by our cooperative team *members:

These are not the best versions of GNU/linux in regards to being completely free, you should consult the list of free distributions on the Free Software Foundation website.
* Currently one team member is using the proprietary but BSD-based Mac OS X, which is compliant with the Unix 03 / POSIX standard which GNU/Linux distributions also meet.

Browsers

Firefox: As developers we have to test client sites in all browsers, but for working and building sites, we use Mozilla FireFox. Although the source code of Firefox is free software, they include some icons, trademarks and logos in the download that make it non-free. You can easily remove these as has been done with IceCat, the GNU version of the Firefox browser. It has great performance, developer tools and community. The plus side of having a community around the software we use is having access to a large pool of people with experience and guidance as we learn and build together.

Tor Browser: As citizens we are not fond of being tracked so we use a free anonymizing web browser that does not allow tracking. It is called Tor.

File Storage and Calendar

Nextcloud: Agaric uses a hosted version of NextCloud on MayFirst.org that is inclusive of:

  • document and file storage
  • image galleries
  • desktop and phone document synchronization
  • calendar
  • contacts
  • document editors
Finance, Accounting and Bookkeeping



 

GNUcash: Accounting software that we use for our bookkeeping.
You can see a review of GNUcash vs Quickbooks and decide if it works for you. We have found a few bookkeeping cooperatives that do accounting!

Communications

As a team we rely on different tools to communicate with each other and with clients about daily activities and long term project goals. We have a distributed team at locations around the world and must maintain contact especially when pair-programming or during a migration which calls for all-hands-on-deck, as well as sharing some long informational text notes and documents that include administrative information.

FreeNode: IRC - Internet Relay Chat - Realtime Text Chat: Yes, we still use IRC and you can find us on irc.freenode.net server in the #devs-r-us channel

Our preferences here are as varied as our team members: some use irssi via a remote, always-on virtual server, many use desktop clients, such as HexChat or Konversation, and still others prefer the web-based solution "The Lounge".

Email

MayFirst.org hosts Agaric.com email

Email Client: Thunderbird: An email client from Mozilla, which also makes Firefox, and is available for your phone. It also has an encryption plugin called EnigMail that works well and is not super tricky to get set up.
Hosted Email: RiseUp: Encrypted services run by anonymous volunteers and you must be invited to have a membership.
Mayfirst offers three web-based email solutions.

  1. Roundcube which has a friendly and simple web interface, making it the easier of the two programs to use.
  2. SquirrelMail is an option that is Javascript-free!
  3. Horde, on the other hand, offers more than just email - you can share calendars, to dos and more with other members of your group.

Hosted Email

Protonmail: An email service that is hosted and encrypted.

Email Lists:

We use email list servers for mailing lists based on groups and topics. It allows group mailing to people that sign up for a specific list.

MayFirst Email Server
RiseUp Email Server

Social Media

Mastadon: Publish anything you want: links, pictures, text, video. All on a platform that is community-owned and ad-free.

Social.coop: A community similar to Twitter, the main difference is that it is owned by the members. For as little as $1 a month you can become an owner/member and take part in shaping the future of the platform. You can find and follow Agaric in social.coop, a coop-run corner of the fediverse, a cooperative and transparent approach to operating a social platform

Live Streaming

MayFirst Live Streaming: MayFirst membership includes live streaming.

Conference Calls and Online Meetings

Some Agaric team members are using Jitsi recognizing that it is a work in progress and there may be technical failures at times - such as we have also found using Google Hangouts - lag time, cut-offs, poor sound quality and issues with screensharing... At times we have found that we need to use a proprietary solution that seems to work reliably as we continue to support development efforts and bug fixes with Jitsi. At the heart of Jitsi are Jitsi Videobridge and Jitsi Meet, which let you have conferences on the internet, while other projects in the community enable other features such as audio, dial-in, recording, and simulcasting.
You can self host an instance of Jitsi or choose a hosted version. You can use http://meet.jit.si or an instance is also available for public use at https://meet.mayfirst.org We do encourage you to become a MayFirst member and have access to all of the free software tools they offer. The Jitsi project needs volunteers to use and test Jitsi so it can get better swiftly!

Currently Agaric is using, and paying for, the proprietary Zoom audio/video conference call service and software. We would love a recommendation to another stable choice that is free software.

Phone Calls and Text Messages

Signal: Agaric uses signal to encrypt SMS Text messages and Phone calls. Encrypted Phone and Instant messaging found to be secure and recommended by Edward Snowden as the only truly encrypted messaging app that is not able to be decrypted by anyone. Note that security is an arms race and this could become false at anytime.

Collaborative Note Taking

Etherpad: When hosting an online meeting we usually open a shared note pad so that everyone may contribute to getting the important bits logged. Etherpad text is synchronized as you type, so that everyone viewing the page sees the same text. This allows you to collaborate on documents with large or small teams seamlessly! We use the hosted version, but you are welcome to host it yourself. We have tried a few online pads and settled on Etherpad as the most reliable.

Collaborative Ongoing Discussion

With some collaborators, particularly people involved with the Drutopia initiative, we use Mattermost rather than IRC. Mattermost can be more useful for ongoing discussions; it is similar to Slack and offers a threaded conversation. The community version is free software.

Notes and ToDo Lists

TomBoy A tiny app that lets you take note while it conveniently makes hyperlinks out of titles and allows synchronization over SSH and more.

Password Management

KeePass A password management system that takes most of the worry, distraction and thinking out of storing and retrieving your login information for multiple projects and sites.

Text Document Editing, Spreadsheets and Presentations

Libre Office: A suite of office tools similar to Microsoft Office, Documents, Spreadsheets, Slides. We use LibreOffice tools that come as core software in the distributions of GNU/Linux we are using. You may have heard of OpenOffice, it is now called LibreOffice. It consists of the basic publishing and calculating software for doing office tasks. These are the ones we use most often:
1. LibreOffice Calc - Similar features and functions of a calculating software to make spreadsheets, such as MicroSoft Excel
2. LibreOffice Writer - Similar features and functions of a word processor such as MicroSoft Word
3. LibreOffice Impress - We use this tool to build slide decks and presentations using text/graphics and videos, it is similar to Microsoft PowerPoint in features.

Project Management and Issue Tracking

*GitLab: This tool is a web-based and self-hosted Git-repository manager with wiki and issue-tracking features. We also use Gitlab for cooperative development on our projects.
*Although GitLab isn't fully free software, it does offer a self-hosted version that is. The Enterprise hosted version has extra features and is proprietary.

Redmine: A free program that you can run locally or on your own server for use as a project management and issue tracking tool. Before finding GitLab we used a self hosted instance of Redmine which is free software.

Resources and Free Software Directories


You can contribute to groups working towards solutions, there are many roles and you do not have to be a developer. As an example, *IndieWeb and Jitsi are projects that we make time to support with development, testing, outreach and feedback.

*With IndieWeb, you can take control of your articles and status messages can go to all services, not just one, allowing you to engage with everyone. Even replies and likes on other services can come back to your site so they’re all in one place.

Tools we love and sometimes use Decision Making and Voting

Loomio: A hosted service available at http://loomio.org
Loomio offers distributed decision making system where you can make groups that can have discussions and make decisions without an in-person meeting. Decide yes or no, or that you need more information.
Note that Loomio also has built a great cooperative resource on at their other URL - http://loomio.coop

Customer Relationship Management

civiCRM: Agaric is working with the developers at MyDropWizard to take a look at civiCRM with Drupal 8.
civiCRM is a free software to manage client relationships and memberships. We have not deployed it yet.

Framasoft: A large collection of free software tools where we use the calendar and polling software most often. We are experimenting with several other FramaSoft tools and may adopt them in the future.

If this has been a helpful read, please pass it on and let us know in the comments how it helped you. A follow-up post will list the tools we use for development purposes. Please be sure to mention any free software you have found and are using now.

>> Get on the mailing list to receive invites, or share this link with a friend Show and Tell Mailing List
-->

Drupal.org Featured Case Studies: Graywolf Press

Drupal Planet - August 11, 2018 - 01:04
Completed Drupal site or project URL: https://www.graywolfpress.org

Graywolf Press is a world-renowned independent publisher. Their books and authors have been awarded the Nobel Prize for Literature, the Pulitzer Prize for Poetry, the National Book Critics Circle Award, and the National Book Award.

Graywolf had a Drupal 7 powered website, but the design was dated, not responsive for mobile devices, and poorly reflected the brand. Online content wasn’t reaching their target audience or expressing the sense of community and mission of the organization. On the backend, editors were having a hard time working with limitations of their content tools, and critical data integrations were failing.

ComputerMinds.co.uk: Keeping dynamic HTML classes easy to find

Drupal Planet - August 9, 2018 - 22:30
The Problem

I imagine many of us have been there: there’s some CSS class in your markup, and you need to do something with it. Maybe you want to remove it, change it, or perhaps alter its style declarations. “Easy peasy,” you think, “I’m a developer. I got this.” And so you should.

Next, if you’re anything like me, your first instinct is to fire up your search tool of choice and search your codebase for that string. You’d expect that would lead you to where that class is getting added to your markup, along with anywhere CSS rules are applied to it… right?

Except it doesn’t. Phooey. That class string doesn’t appear anywhere except in your browser's dev tools. At this point, you either toss your developer pride overboard and hack a fix in some other way, or you search for assorted variations of your string in ever shorter segments until you find something resembling this:

$classes_array[] = 'some-' . $class;

Aha! It was helpfully obfuscated for you. And of course, you could hardly expect to simply search for that class name and find its CSS rules. That would be too easy! So naturally, they were written in SASS like this:

.some-#{$class} {
   // Some declarations…
}

Now that’s just what it might look like in PHP and SASS, but I’m sure you can imagine what it might look like in your templating language, javascript, or whatever CSS-pre/postprocessor you might abuse.

The point is, you’ve gotta slow down and tread a little more carefully here; this isn’t a simple find-and-replace job anymore. There are a few reasons why such code might have been written:

  • The latter half of that class might originate from a fixed list of options exposed to your content editors.
  • Perhaps there’s some other logic in play, that has intentionally been kept out of the CSS: your element gets a class based on its region or container, for example.
  • Your colleagues are actively trying to make your life difficult.

If you’ve never been in this situation - good for you! Future-you called and asked that you avoid munging together parts of a CSS class like this if you possibly can. Do it for future-you. Don’t let them inadvertently introduce bugs when they fail to spot your class-munging!

The solution

“But what if,” I hear you cry, “I need to generate a class dynamically. How can I keep future-me on side?”

Well, dear reader – I hear you. Sometimes you really don’t want to explicitly list every possible variation of a class. Fair enough. So I have a proposal, one that I’d like a nice name for but, y’know, naming things is hard. Maybe the “Searchability class” pattern. Or “CSS search placeholder classes”. Or “CSS class search flags”. Suggestions on a postcard.

Anyways, returning to our earlier PHP example, it looks like this:

$classes_array[] = 'some-%placeholder'
$classes_array[] = 'some-' . $class;

Producing markup like this:


That is: wherever you add a dynamic class into your page source, additionally put a recognisably formatted, static version of that class alongside it. That would also include anywhere you generated classes in JavaScript or any CSS-pre/post-processing madness.

Obviously, you don’t need these placeholder classes in your actual CSS (if you wanted to edit the static CSS, the regular class will already show up in searches) but if you are doing this in some dynamically generated CSS, then you’ll want to drop the static version of the class in as a comment. So our Sass example would become:

// .some-%placeholder
.some-#{$class} {
  // Some declarations…
}

Once this becomes an established practice within your team, instead of fumbling around trying to find where a given class may have come from, you’ll be able to spot those placeholder strings and search for those, and relatively quickly find all the relevant bits of code.

So I think this is something we’re going to try to adopt/militantly enforce upon ourselves at ComputerMinds. As a Drupal shop, something like %placeholder makes sense, as that syntax is used elsewhere in core to denote dynamically replaced parts of a string. It also has the advantage of being slightly tricky to actually use in a CSS selector (if you don’t already know, I’m not going to tell you). You really don’t want any styling attached to these.

So there you have it – the “Searchable CSS class placeholder flags for generated class names” pattern. We’ll keep working on the name.