Mediacurrent: Extending Rain’s Base Theme and Style Guide

Rain logo

Mediacurrent created the Rain Install Profile to build fast, consistent Drupal websites and improve the editorial experience. Rain expedites website creation, configuration, and deployment.

In the last developer tutorial, we covered how to customize and develop Drupal sites using Rain’s base install profile. This week, we will dive into theming to help frontend developers update the look and feel of the Rain starter theme.

As usual, if you have a question or comment feel free to reach out at @drupalninja

Sub-theme or clone?

The first thing to note is that you can use the Rain install profile with or without the included Rain theme package. The “rain_theme” project exists as its own Composer project which is included by default but can be easily removed. That said, there are benefits to using the Rain Theme as a base theme or starter. The primary benefit is that Paragraphs are integrated with a dozen or so pre-built components that can be easily customized and save you time. 

If you do choose to leverage the base theme, you need to decide whether or not to use Rain Theme as a “parent theme” or as a starter. We highly recommend you do not. This way, you gain full control over the theme and do not need to worry about downstream updates. Leveraging Rain theme as a parent theme can cut down initially on files and code but parent themes in Drupal can be restrictive and cumbersome at times. Ultimately, the decision is yours. With the “clone” approach you can grab everything and rename it or grab only what you want. Anything you don’t use can be discarded.

Using the style guide

The Rain Theme project includes a KSS-based living style guide that has a host of pre-built Twig components that can be integrated with Drupal theme templates.

KSS Style Guide

KSS style guide Example

In the previous step, we mentioned that we recommend cloning the theme so that you can fully control and customize any of these components. The idea is that developers waste less time rebuilding and re-styling the same common components on every new build. Instead, Drupal themers get a head-start while still having enough control of the theme to meet the design requirements of the project.

Working with the popular KSS node project is straightforward. For more information on how to compile and develop with KSS node, visit the project page at https://github.com/kss-node/kss-node.

Even if you are new to KSS, you will find making updates is easy. The “npm run build” command will compile all of your theme assets, as well as the style guide.

Component Integration

The main way components are integrated into Drupal templates is through includes found in Paragraph templates.

Rain Theme Paragraphs Twig Templates

Rain Theme Paragraphs Twig templates screenshot

Using the Components module to define the “@components” namespace, you can see an example below where field markup is passed in as parameters to the component Twig file. You will also that it’s in these templates where we typically attach a library (more on that in a bit). Of course, this is all ready to customize and any time you add or modify fields you will need to adjust templates or components accordingly. JavaScript and CSS are for the most part encapsulated in their corresponding component which keeps things organized. We do recommend you enable the “Twig debug” option in your Drupal services.yml to make it easy to find which templates are being used on any given page.

Rain theme quote paragraph template

Rain Theme Quote Paragraph template

Libraries

Out of the box, we have included many libraries that style components and include vendor libraries where appropriate. Note that these libraries reference compiled CSS and JavaScript found in the “dist” folder of the theme.

Rain theme libraries

Rain Theme Libraries screenshot

Additional Theming Helpers

In addition to the pre-configured templates, style guide and libraries included with Rain, we also ship a few helper modules to make theming easier. 

The “Twig Field Value” module makes it simpler to pull out values from fields and the “Twig Tweak” module adds several utility methods. For a full list of those functions with information visit the “Cheatsheet” documentation page on Drupal.org. As mentioned earlier, the “Components” module is also included and enabled by default in order to allow namespaces to be defined in our theme.

Wrap-up

In this article, we showed frontend developers how to leverage the Rain base theme and style guide. Our recommendation is to clone the theme folder and customize our pre-built components to match your project’s unique requirements. We also covered how to integrate Drupal theme templates with components and define custom libraries. Finally, we covered a few helpful theming modules that ship with Rain and save development time.

In the next (and final) Rain tutorial, we will wrap up this series with a focus on content creation for authors.

Was this information helpful? Let us know! https://twitter.com/drupalninja/

Drupal blog: The web I want for my kids

This blog has been re-posted and edited with permission from Dries Buytaert’s blog:

Coder Dojo

Volunteering as a mentor at CoderDojo to teach young people, including my own kids, how to write software.

Last week, I published an opinion piece on CNN featuring my thoughts on what is wrong with the web and how we might fix it.

In short, I really miss some things about the original web, and don’t want my kids to grow up being exploited by mega-corporations.

I am hopeful that increased regulation and decentralized web applications may fix some of the web’s current problems. While some problems are really difficult to fix, at the very least, my kids will have more options to choose from when it comes to their data privacy and overall experience on the web.

You can read the first few paragraphs below, and view the whole article on CNN.

I still remember the feeling in the year 2000 when a group of five friends and I shared a modem connection at the University of Antwerp. I used it to create an online message board so we could chat back and forth about mostly mundane things. The modem was slow by today’s standards, but the newness of it all was an adrenaline rush. Little did I know that message board would change my life.

In time, I turned this internal message board into a public news and discussion site, where I shared my own experiences using experimental web technologies. Soon, I started hearing from people all over the world that wanted to provide suggestions on how to improve my website, but that also wanted to use my site’s technology to build their own websites and experiment with emerging web technologies.

Before long, I was connected to a network of strangers who would help me build Drupal.

TEN7 Blog’s Drupal Posts: Case Study: Solhem Companies

Solhem Companies

Website Refresh – Making It Easy to Decide on Apartments from Afar

Solhem Companies develops, owns and manages award-winning residential and office properties in Minneapolis, Minnesota’s most desirable neighborhoods. TEN7 has been working with Solhem since the beginning.

Promet Source: 5 Reasons to Attend and Sponsor Open Source Events

“Is it worth it?”
 
This summer, I’ve been asked a lot of questions concerning Promet Source’s commitment to sponsoring Drupal Camps, as well as our eagerness to lead training events and be present at them in every way that we can. 
 
I get that at any given moment, most of us have more on our plates than we can handle. It’s difficult to justify throwing travel and a two or three day camp or convention into the mix.  
 
That said, my answer to the “Is it worth it” question is an enthusiastic, “YES.”
 
Here’s why:

 

Kanopi Studios: The top six website metrics you should pay attention to

If your website is the hub for your audience to interact with your brand, then presumably you are doing all sorts of marketing tactics to get them there.

Once they are there, how are you tracking them? How do you know your efforts are effective?

There are a few key metrics you should be tracking to help you to optimize your marketing efforts, understand how the site is doing, continuously improve your website, and to allow you to report to others in your company about where the focus of marketing needs to lie.

First off, you need to determine what your goals are per marketing activity. How are you performing on these goals now? What are doing to affect those goals? How will you measure it? Identify not only your main conversions, like a form completion or a purchase, but soft conversions like a newsletter sign-up or a PDF download.

Next, either review your metrics based on these items or put in these metrics to track moving forward. 

Here are some commonly reviewed and important items to track. Most of these will be familiar to you, but #6 can be a game changer!

1. Time on Site

This metric allows you to see an aggregate of how long your audience spends on your site. If your site is centered around exploration and information, you will want this number to increase over time.

2. Bounce Rate

Your bounce rate is the percentage of users who visit your site, but only visit one page and then leave. Google Analytics defines it as the user only visiting the site for 0 seconds, then they exit. This means they see one page of your site, but the analytics does not have enough time to trigger a duration of their session. 

Several reports lean towards an “Acceptable” bounce rate can range between 26 to 70%. But this is a large range across multiple industries. Look deeper to learn what is considered “acceptable” in your industry, because a high bounce rate absolutely depends on your industry and the goals of your site. For example, if you are a restaurant and the visitor simply visits to grab your phone number, then you have reached your goal!

This should be looked at in combination with the other analytics in this article, since looking at the bounce rate alone will not tell you an accurate story. Researching a good bounce rate for your website type and industry is fantastic, but also look to see where you are today and then focus on reducing it (if appropriate).

3. Number of Pages visited

Again, if your site is more informational and built to provide a “next step” for exploration with your users, than you will want this metric to increase. If the number is closer to 1, but you focus all your traffic to a single page, than you should look deeper into that single page’s analytics, before you are concerned with this number.

4. New vs Returning Visitors

In Google Analytics, there is an overlap in these numbers. “New Visitor” is a unique visitor visiting your site for the first time, on a specific device. If you visit a site once on your phone, then again on your desktop, you will be counted as 2 new visitors.

Once the visitor visits your site again, on a device they already used, they will be counted as a, “Returning Visitor” for the next two years (then the clock starts over again).

This could be a great metric to use when you are running a campaign in different areas or industries, for example. If you pay close attention, you can see which campaigns garnered more new traffic.

5. Traffic Sources

Analytics programs will report to you where your traffic is coming from, which illuminates the more and less popular sources. It will also provide you referral sites, which helps you to see your ROI if you partner with others to send traffic to your site.

Seeing how each traffic source performs for you will continue you on the path of honing what works well for you (and what does not).

6. Search

The most crucial advice we provide our clients is to track your in-site search.

This is done as an admin in your “view settings” for Google Analytics. The reason this is so very powerful is it provides you exactly what your visitors want from your site.

A behavioral studies from the Nielsen Group and other research findings show that more than 50% of people visiting a start page on a website go straight to the internal search box in order to navigate. Those figures prove that search box becomes essential navigation tool on every website.

From this data, you can organize, adjust or create your content plan. You can revamp your navigation or the order at which content is laid out on your site. You can write relevant FAQs or shift your focus from one audience group to another. The reason this can be so compelling for your business is because you are directly answering the needs of your audience. 

These will get you started!

Many more metrics exist which can help you to analyze your effectiveness in your marketing tools and traffic sources, but these six are the best ones with which to start. Once you have defined what is important for you, continue to review your analytics over the course of time so you can continually optimize your site’s effectiveness.

Your website is a living and breathing entity that needs nurture and care to continue its growth and work harder for your business. If you need help with a strategy to define your metrics, contact us. We’d be glad to help. 

The post The top six website metrics you should pay attention to appeared first on Kanopi Studios.

Mediacurrent: Rain Walk-Through for Authors & Admins

Rain logo

Mediacurrent created the Rain Install Profile to build fast, consistent Drupal websites and improve the editorial experience. Rain expedites website creation, configuration, and deployment.

In this article, we will walk through each of the main features that ship with the Rain distribution. This tutorial is intended to help content authors and site administrators get set up quickly with all that Rain has to offer.

Have a question or comment? Hit me up @drupalninja on Twitter.

Content Moderation

A question we often hear when working with a client is, “how can Drupal help build a publishing workflow that works for my team and business?”

Drupal 8 marked a big step forward for creating flexible editorial workflows. Building on Drupal 8’s support for content moderation workflows, Rain comes pre-configured with a set of Workflow states. The term “states” refers to the different statuses your content can have throughout the publishing process – the four statuses available by default are “Draft”, “Needs Review”, “Published” and “Archived.” They can be easily enabled for any content type. As with everything in Drupal, these states and workflows are highly configurable. 

Once enabled, using content moderation in Drupal 8 is straightforward. After you save a piece of content, initially it will default to the “Draft” status which will remain unpublished. The “Review” status also preserves the unpublished status until the current edits get published. What’s great about Workflow in Drupal 8 is that you can make updates on a published piece of content without affecting the published state of that content until your changes are ready to be published. The video below demonstrates how to enable workflow and see draft updates before they are published.

To review any content currently in a workflow state you can click on the “Moderated Content” local task which is visible from the main Admin content screen (see below).
 

Admin content screen

Revisions

As a best practice, we recommend enabling revisions for all content. This allows editors to easily undo a change made by mistake and revisions keeps a full history of edits for each node. By default, all of Rain’s optional content features have revisions enabled by default. As illustrated below once you have made a save on a piece of content, the “Revisions” tab will appear with options for reviewing or reverting a change.

Rain Drupal Content Moderation - Revisions

Media Library

Coming soon to Drupal core is an overhauled Media library feature. In the meantime, Drupal contrib offers some very good Media library features that are pre-configured in Rain. The Rain media features are integrated with most image fields including the “thumbnail” field on all content type features that ship with Rain.

The video below demonstrates two notable features. First is the pop-up dialog that shows editors all media available to choose from within the site. Editors can search or browse for an existing image if desired. Second is the drag-and-drop file upload which lets the editor user drag an image onto the dialog to immediately upload the file. 

 

Media Library

WYSIWYG Media

Media is commonly embedded within the WYSIWYG editor in Drupal. Rain helps improve this experience by adding a button which embeds the Media library feature to be used within WYSIWYG. The key difference between the Media library pop-up you see on fields versus the pop-up you see within WYSIWYG is that here you will have an option to select the image style. The video below illustrates how this is done.

 

embed media

WYSIWYG Linkit

Another WYSIWYG enhancement that ships with Rain is the integrated “Linkit” module that gives users an autocomplete dialog for links. The short video below demonstrates how to use this feature.

Content Scheduling

A common task for content editors is scheduling content to be published at a future date and time. Rain gives authors the ability to schedule content easily from the content edit screen. Note that this feature will override the Workflow state so this should be considered when assigning user roles and permissions. The screenshot below indicates the location of the “Scheduling options” feature that appears in the sidebar on node edit pages.

node edit


Clean Aliases

Drupal is usually configured with the ability to set alias patterns for content. This will create the meaningful content “slugs” visitors see in the browser which also adheres to SEO best practices. Rain’s approach is to pre-load a set of sensible defaults that get administrators started quickly. The video below demonstrates how an admin user would configure an alias pattern for a content type.

XML Sitemap

By default, the Rain distribution generates a sitemap.xml feed populated with all published content. For editors, it can be important to understand how to exclude content from a sitemap or update the priority for SEO purposes. The screenshot below indicates where these settings live on the node edit page.

xml sitemap

Metatag Configuration

The default configuration enabled by the Rain install profile should work well for most sites. Metatag, a core building block for your website’s SEO strategy, is also enabled for all optional content features that ship with the Rain distribution. To update meta tags settings on an individual piece of content, editors can simply edit the “Meta tags” area of the sidebar on the edit screen (see below).

Metatag in Drupal

Google Analytics

Enabling Google Analytics on your Drupal website is a very simple process. The Rain distribution installs the Google Analytics module by default but the tracking embed will not fire until an administrator has supplied a “Web Property ID.” The Google Analytics documentation shows you where to find this ID. To navigate to the Google Analytics settings page, look for the “Google Analytics” link on the main admin configuration page. Most of the default settings will work well without change and the only required setting is the “UA” ID highlighted below.

Google Analytics

Enabling Content Features

Rain comes with many optional content features that can be enabled at any time. This includes content types, vocabularies, paragraphs, search and block types. Enabling a content feature will create the corresponding content type, taxonomy, etc. that can then be further customized. Any paragraph feature that is enabled will be immediately visible on any Rain content type that has enabled. Watch the video below to see an example of how to enable these features.

Enabling Content Features

Wrapping Up

Mediacurrent created Rain to jump-start development and give editors the tools they need to effectively manage content. All features that ship with Rain are optional and highly configurable. We tried to strike a balance of pre-configuring as many essential modules as possible while still allowing site administrators to own the configuration of their Drupal site.

In the next tutorial, we will “pop open the hood” for Drupal developers to explain in technical detail how to build sites with Rain.

wishdesk.com: Registration Confirm Email Address: simple module for Drupal

We love to say that Drupal has modules for absolutely everything. Some modules are simple but still important because they cover specific details in the website’s work. They are like the missing pieces of the puzzle that makes your website more user-friendly, secure, reliable, and so on. One of them is Registration Confirm Email Address, which that we will describe today.