Newsfeeds

Tandem's Drupal Blog: Lando + Envoy

Planet Drupal - 2 August 2018 - 9:34am
August 03, 2018 Learn to automate deploy steps with envoy on affordable hosting. Why Envoy Envoy is a task runner put together by the Laravel team. When I can I like to use hosts like Pantheon and Platform.sh that give me a wealth of tools, containers in production, and a lot less DevOps headaches when something like Heartbleed happens 😱...
Categories: Drupal

WizKids Announces Magic: The Gathering: Heroes of Dominaria Board Game Premium Edition

Tabletop Gaming News - 2 August 2018 - 9:00am
WizKids will soon be coming out with Magic: The Gathering: Heroes of Dominaria, their new board game set in the iconic land of Dominaria. They’re coming out with two versions of the game, too. One’s got everything you need to play and such. The other has all the same, except that the four figures from […]
Categories: Game Theory & Design

Mediacurrent: How to Build a Card Component

Planet Drupal - 2 August 2018 - 8:13am

One of the most popular components on any website I've worked on is the card component.  Depending on the website, the card component is used to group various pieces of content into a container which can be used throughout your website.  Here’s an example of a card component in one of our projects.

In some instances, a card can be a user profile, content teaser/excerpt, latest news or events.  Today we will build a card component which will contain the information for the latest events.  This card can be used in the /events page to list all the latest events taking place.  The card can also be used in other pages and it may need to be displayed slightly different than the original card, this transformation is called "variations" and is usually achieved by passing a modifier CSS class to the original component which we can use to write different styles for the card.  More on this later.

Let's get started

First, let's take a look at what we are building so we have a visual of the code we will be writing.

As you can see from the images above, our card takes different shapes but the information in it remains the same or similar.  This is a common practice to modify components based on where and how they are being displayed.

Let's build the cardIdentify component's fields

Before starting to write any code, let's take a close look at the card images to identify the fields or data elements the card needs.  From the images above we can see the following fields will be needed:

  • Image
  • Title
  • Subtitle
  • Excerpt
  • Label or category
  • Label for comments
  • Label for time posted

Typically, components are built following the Atomic Design approach which basically means breaking things down into small pieces (atoms) and then combining those pieces to build more elaborate components.

In the interest of time, we are going to skip building each piece as its separate component and instead we will build the card as a whole.  I recently wrote a blog post on building flexible headings which demonstrate the approach I usually take when building components.

Architecting the component fields

We know the fields we need but it is helpful to determine what type of fields they are and what they will be called.  The table below gives us a good visual of our fields architecture.

Writing the code

1. In your components or patterns directory in your project, create a new folder called `card`

2. Inside the Card folder create two new files
          -  card.html
          -  card.css (we're using CSS to keep things simple.  Feel free to use Sass if you'd like).

3. In your card.html we'll start with the basic structure of the card

<article class="card">...</article>

So we've created an article tag as the card's container.  Why <article>  and not <div>?  Well, since the card is intended to contain an event's info, if we place a bunch of cards together it makes sense that each card is an individual event article.

4. Next we are going to create wrappers for the two types of data the card will hold.  The two types of data as we have seen from the table above are: Image/media and text or content.  Let's modify our code so it looks like this:

<article class="card">
 <div class="card__media">...</div>
 <div class="card__content">...</div>
</article>

The reason for splitting the image and the rest of the content is that this allows us to move things around independently of each other to create different variations of the card.  More on this later.

Let's pause to review how content will be laid out

If we look at the card images above, we see that some of the fields are either on the image side and others are grouped together separate from the image.  Although we could potentially place fields in the image or content wrappers, it makes sense to place them in the wrapper where they visually appear.

For example, the date and label fields (Photos), look like they belong in the same group as the image.  The rest of the fields will go in the Content wrapper.

5. Let's start with the image wrapper:

<article class="card">
 <div class="card__media">
   <img src="http://placehold.it/300x300" alt="Card image" />
   <div class="card__date">
     <span class="date--day">27</span>
     <span class="date--month">Mar</span>
   </div>
   <span class="card__category">Photos</span>
 </div>

 <div class="card__content">...</div>
</article>

So let's focus in the fields inside card__media. We see we have our image, which in this case is rendering a placeholder image.  Then we have a wrapper to hold the date fields (day and month).  Again, wrapping these two together makes it easy to manipulate them as a single item rather than two separate fields.  Lastly, we have the category for this content (Photos).  Since all these fields seem to belong together, it makes sense to place them the way we have.  Later on, we will use CSS to place each of the fields in their right position.

6. Now let's place the remaining fields inside the .card__content wrapper.  We will temporarily hide the fields in the .card__media wrapper to focus on the other fields.  Modify your markup to look like this:

<article class="card">
 <div class="card__media">...</div>

 <div class="card__content">
   <header class="card__header">
     <h2 class="card__title">City Lights in New York</h2>
     <div class="card__subtitle">The city that never sleeps</div>
   </header>
   <p class="card__excerpt">New York, the largest city in the U.S., is an architectural marvel with plenty of historic monuments, magnificent buildings and countless dazzling skyscrapers.</p>

   <footer class="card__meta" role="contentinfo">
     <span class="card__post-date">6 min ago</span>
     <span class="card__comments">39 comments</span>
   </footer>
 </div>
</article>

So the first thing we did was add a `<header>` tag to wrap the title and subtitle fields.  The header tag is a great way to indicate the role content plays in our component.  In addition, using semantically correct markup makes this component SEO friendly as well as accessible.  Next we have the teaser content wrapped in a <p> tag and finally, we add another semantic tag which is `footer` to wrap the publish date and comments fields.

Why this markup?

I'd like to bring up a couple of things to your attention regarding how I arrived at the markup above.  First, we are using BEM for naming CSS classes (card__title, card__comments, etc.).  BEM is great for creating associations on your component fields.  By looking at the markup you know where each field belongs.  This makes it easier to identify where you would find the styles or other assets for the component within your project when you have tons and tons of components.  The class card and all the other field classes are unique not only to this component but in the entire project.  This gives us the peace of mind that our styles will not inadvertently affect other areas of the website.

Notice I created two containers within the card (`card__media` and `card__content`). This allows me to split the card content into groups I can manipulate individually and independently of each other.  This will come in handy when we need to create a long or wide card.  In addition, by grouping multiple fields into a single container it is easier to manipulate the fields with CSS as a group rather than individually.

Atomic Design

If you are familiar with Atomic Design, you know the recommended way for building components is to break things down into the smallest pieces possible.  For example, in the card structure above, each of the fields that make up the card can actually be its own individual component.  Then we would combine them all into a whole new component (card).  In the interest of time/work, I am not breaking the card component into atoms. However, if I were building the card for a project I would definitely do that as this allows for components to be reused and save time/work in the long road.

Putting the entire card together

Now that we have built each piece of the card, your **card.thml** file should look like this:

<article class="card">
 <div class="card__media">
   <img src="http://placehold.it/300x300" alt="Card image" />
   <div class="card__date">
     <span class="date--day">27</span>
     <span class="date--month">Mar</span>
   </div>
   <span class="card__category">Photos</span>
 </div>

 <div class="card__content">
   <header class="card__header">
     <h2 class="card__title">City Lights in New York</h2>
     <div class="card__subtitle">The city that never sleeps</div>
   </header>
   <p class="card__excerpt">New York, the largest city in the U.S., is an architectural marvel with plenty of historic monuments, magnificent buildings and countless dazzling skyscrapers.</p>

   <footer class="card__meta" role="contentinfo">
     <span class="card__post-date">6 min ago</span>
     <span class="card__comments">39 comments</span>
   </footer>
 </div>
</article>

Card Styles

Now that we have the markup ready for the card component, we can begin writing our Sass/CSS to style it.  I am not going to go into detail about the styles as I have commented the parts that may need some explanation and should be easy to understand.  The main take away from writing styles for components with unique names is that there is little to no CSS nesting.  This makes overriding styles an easy task if there is ever a need to do so.  In addition, styles written for a component like this, don't run into the risk of leaking into other areas of the website.

That's a lot of CSS but it's all necessary to achieve the look and feel of the card.  It is important to know that your markup file (card.html), needs to reference your styles file (card.css) for things to work.  This may be obvious but if you are following along that's an extra step that needs to be done.
Creating a card variation

If  you would like to see the card displayed wide or horizontally, modify your card wrapper to look like this:

<article class="card card--wide">...</article>
 

Notice that by passing the CSS class of `card--wide` to the original card component we are able to change the orientation of the card from long to wide giving us an alternative variation to use without having to rebuild the card from scratch.  These variations are pretty powerful and present many advantages.

If you look at the styles, you will notice there is a block of CSS in which the card--wide is changed to move the card's content to the right of the image.  This is a great way to provide alternative views of a component without having to recreate the markup or styles for a component.

In closing

Building components is one of my favorite things to do as a developer and there are many advantages to this style of theming.  It's important to think through how components will be used so you can plan ahead how to best build a component that can be reused.  Rushing through building components without having a full understanding of where and how a component may be used can lead to duplicating code or redoing your work to accommodate new project requirements.

Categories: Drupal

Pathfinder 2.0 Playtest Begins

Tabletop Gaming News - 2 August 2018 - 8:00am
Playtesting is a vital part of any game’s development. Something might seemingly work as-written, but once you get to the table and start trying to work with it, you might find the rules clunky or unclear or in other need for refining. With a game as beloved and big as Pathfinder, Paizo wants to make […]
Categories: Game Theory & Design

What Men and Women Consider Hardcore Gaming Are Not The Same - by Nick Yee

Gamasutra.com Blogs - 2 August 2018 - 7:37am
Motivation differences between male and female gamers who identify as "hardcore". This is based on our dataset from over 350,000 gamers.
Categories: Game Theory & Design

Bizdev and Marketing for Sausage Sports Club - by Chris Wade

Gamasutra.com Blogs - 2 August 2018 - 7:37am
Lessons learned on the business side of Sausage Sports Club, including tips on doing market research, shaping the perception of your game, getting the most out of social media, why you shouldn't go to conventions, and angling for platform support.
Categories: Game Theory & Design

Google Play Store Ranking Algorithm Changes. Improve Discovery Of Your App! - by Viral Patel

Gamasutra.com Blogs - 2 August 2018 - 7:36am
With the aim of improving the discovery of quality apps, Google made changes to its Play Store algorithm. A lot of the ranking criteria now tips towards user engagement.
Categories: Game Theory & Design

My Love and Hate Relationship with Conception Phase - by Anne Gibeault

Gamasutra.com Blogs - 2 August 2018 - 7:35am
As any production phases can be very, very demanding and stressful, but the most creative and painful period for me is the conception phase. This is both my dream period and nightmare at the same time.
Categories: Game Theory & Design

Registration Confirm Email Address

New Drupal Modules - 2 August 2018 - 7:25am

This modules extracts LoginToboggan's email confirmation feature. It adds a confirm email address field under email address field in registration form.

If you want your users to rewrite their email address during registration but don't want to install the whole LoginToboggan module, then this module is for you.

Categories: Drupal

Fantasy Flight Games Announces Arkham Horror 3rd Edition

Tabletop Gaming News - 2 August 2018 - 7:00am
I really missed out, naming this another Year of New Editions months ago, but it’s certainly seeming like it’s the case. In this instance, 3rd time’s the charm as Fantasy Flight has announced a 3rd edition of the classic Arkham Horror game. Hard to believe the first version came out in 1987. From the post: […]
Categories: Game Theory & Design

Nexus Arena Combat Board Game Up On Kickstarter

Tabletop Gaming News - 2 August 2018 - 6:00am
Two warriors enter. One warrior leaves… … maybe. In Nexus, two gladiators are locked in life-or-death combat. However, it’s not just some sandy pit they’ve been tossed into. This arena is alive and it’s not going to make things easy for either combatant. With traps, snares, pits, and all manner of horrific things that can […]
Categories: Game Theory & Design

Remove username

New Drupal Modules - 2 August 2018 - 5:45am

This simple module is removing the 'name' (username) field from the user management forms (create/register/edit accounts) by making the 'email' field required and copying the email address into the username field.

Categories: Drupal

CKEditor Imgur Addon

New Drupal Modules - 2 August 2018 - 5:25am

Integrates the CKEditor Imgur plugin to CKEditor for Drupal 8.

Allow user to upload image to https://imgur.com/ and use in in ckeditor. Uses imgur api to upload images, Before using it you have to fill your imgur client id in settings section.

This module requires the PanelButton module for CKEditor.

Categories: Drupal

jsonform

New Drupal Modules - 2 August 2018 - 2:31am

Integrate jsonform library with Drupal

Categories: Drupal

How a twitter campaign brought in 95 new game reviews - by Hannah Flynn

Gamasutra.com Blogs - 1 August 2018 - 10:23pm
Failbetter Games (Sunless Sea, Sunless Skies) created #loveindies as a way to celebrate indie games and drive players to leave valuable reviews and ratings. Hannah Flynn, Communications Director, shares what they learned.
Categories: Game Theory & Design

Agiledrop.com Blog: AGILEDROP: How to Embed Videos in Drupal 8

Planet Drupal - 1 August 2018 - 6:19pm
Videos have become a major part of the internet alongside images and of course text. They not only increase the engagement of your website but also making it more engaging. Historically, Drupal hasn’t been too media friendly and has been criticized for that compared to other CMS. But with Drupal 8 as well as its media initiative, those days are behind us. In this post, let’s take a look at how easy it is to embed a video on your Drupal 8 site. Start off by downloading the Video Embed Field module. Install the module and enable it (It requires the Drupal Media module to be enabled). Before we… READ MORE
Categories: Drupal

Debug Academy: How to quickly patch your Drupal site for today's Moderately Critical security release ( SA-CORE-2018-005 )

Planet Drupal - 1 August 2018 - 5:04pm
Author: Ashraf Abed

Do you manage a Drupal site? You are likely to have heard about today's moderately critical security update: https://www.drupal.org/SA-CORE-2018-005

There's no time to spare - what now?

This update is has one key difference from the other recent security updates. Those security issues resided within Drupal core's code, whereas this update is in an external vendor package which Drupal core relies on. I'll spare you some of the details - the tl;dr is that makes it harder for us to provide a single patch you can reliably apply. Knowing the version of Drupal core you're running does not necessarily give us enough information to generate a patch.

Here is how to apply the security updates to your website if you are already on Drupal 8.5:

  • SSH into your website
    • Git add and commit all files
    • Create a database backup with drush:
      • drush sql-dump > ../../2018-08-01-pre-sa-core-2018-005.sql
  • Using Composer, and on Drupal 8.5.x?
    • composer update drupal/core --with-dependencies
    • Unsuccessful? Try: composer update drupal/core --with-all-dependencies
    • Still no luck? OK - this should work:
      • composer require symfony/http-foundation:~3.4.14
      • composer require symfony/http-kernel:~3.4.14
  • Not using composer, but are on Drupal 8.5.x?
    • I strongly recommend using composer in the near future. Until then, manually update the two packages:
    • ​Now that we have the new versions of the two packages, we need to replace the unsecure versions of those packages in our project:
      • Open your project
      • Within your project, find for these folders:
        • http-foundation
          • This can usually be found in: YOUR-PROJECT/vendor/symphony/http-foundation
        • http-kernel
          • This can usually be found in: YOUR-PROJECT/vendor/symphony/http-kernel
      • Those are the two unsecure folders. Note their location, and delete those folders
        • ​This step will break your website until the remaining steps are completed. Because of which, you should always perform development work on a dev environment, not on the live website.
    • Remember the zip files we downloaded earlier? Find those on your machine now.
    • Unzip the two zip files. You should now have these two folders on your computer:
      • http-foundation-3.4.14/
        • Rename this folder to http-foundation
        • Then move the renamed into your project, replacing the old http-foundation folder
          • This is normally YOUR-PROJECT/vendor/symphony/http-foundation
      • http-kernel-3.4.14/
        • Rename this folder to http-kernel
        • Then move the renamed folder into your project, replacing the old http-kernel folder
          • This is normally YOUR-PROJECT/vendor/symphony/http-kernel
    • Save (git add and commit) the updated folders on your website
    • Clear your websites cache
    • Test your website thoroughly
    • If everything looks good, you should be able to deploy these changes to the live website before clearing its cache

These steps come with no warranty, implied or otherwise.

Those steps will allow you to patch your site, not fully update it. Once the patches are in, you can rest assured that your site should now be secure. Take 24 hours off, then schedule fully updating your website to the latest version very soon. Future patches are not guaranteed to be applicable to earlier versions.

Categories: Drupal

Drupal Association blog: Changes Coming for DrupalCon Seattle 2019

Planet Drupal - 1 August 2018 - 3:58pm

DrupalCon is evolving and improving to better meet your needs and those of the Drupal market. The goal of the project and the Drupal Association is to grow Drupal adoption and its impact in the world, and based on your feedback, we’re segmenting DrupalCon’s offerings -- which we affectionately call “tracks” -- to achieve this. This also comes with a different price point.

While the programming, speakers, sessions and more still make up the core of DrupalCon, for the first time, we’re retooling and creating more value to serve everyone in the Drupal lifecycle; builder/developers, agency owners, sales teams, content editors, marketers, end-user decision-makers….

The Backstory and Evolution

Growing adoption means inspiring and educating all decision-maker personas, so we’re creating programming and experiences uniquely tailored to each personas needs so that they can all find ways to participate in the continued evolution of the project.

Over the past few years, through surveys, evaluation forms, in-person comments, attendance data and meetings, the community provided valuable feedback and ideas about how DrupalCon North America could best target each of the differing attendees.

While making changes, we also want to make the experience for our alumni attendees even better. We pinpointed common themes and requests; namely more in-depth content, learning opportunities, and concentrated time for networking.

Serving Drupal's Personas

DrupalCon’s overall programming is now a siphoning of who you are and how your role uses Drupal. We’ll carve the Seattle conference center into 4 distinct areas; one for each persona track:

  • Builder Track
  • Agency Leadership Track
  • Content and Digital Marketing Track
  • Executive Summit

These tracks can better inform each group, allowing attendees’ time to be targeted and well-spent at DrupalCon as a whole. Each of these tracks will have their own space, their own journey and their own content -- with opportunities to come together in keynotes, social events, and the hallway track for the cross-pollination, community building, and DrupalCon’s culture of collaboration, which remain core benefits of attending the conference.

More About the Builder Track

As mentioned, in addition to expanding who DrupalCon serves, we also want to create a more valuable experience for returning attendees. The Builder Track will be for people who make the software and create the experience, with job roles including but not limited to: back end and front end developers, themers, QA specialists, technical leads and architects, site builders and other technical personas.

Here’s what’s new and different for this track, so that it better serves you:

  • Sessions will include multiple topic tags; content will be more accessible to attendees instead of in strict silos; no missing out!
  • Due to feedback, we have expanded our one-day programs to run on Monday and Tuesday, and our session, BoF and keynote content to full days on Wednesday and Thursday.
  • Adding new summits to provide expanded vertical networking opportunities in strong and emerging industries.
  • Increasing our offering of hands-on trainings and labs throughout the week to up-level knowledge.
  • We will work to provide more meaningful interactions at Drupal Association hosted social events.
  • More featured speakers -- offering new and relevant information from both inside and outside of Drupal.
  • Additional grants and scholarships so that a cross-section of contributors can attend.
  • An increase in the Speaker Inclusion Fund to ensure diverse voices and perspectives on our stages.
  • All-day free coffee (you read that right!)
In Dollar Terms

With all of this value comes another change that we haven’t made in three years, even as our costs to hold and host the event have escalated year over year: ticket prices. After careful consideration and analysis, the prices for 2019 have increased. Prices now align with industry standards in the North American market, yet remain the most affordable across the board. For context, Linux Open Source Summit starts at $950 and O’Reilly’s conferences start at $1,795. DrupalCon remains at or lower than similar events.

New Ticket Pricing:

Supporter Price

Conference Price

Early-Bird $595 $795 Regular $695 $894 Last Chance $795 $995 On-Site $1,095 $1,095

Supporting Partners’ organizations do a lot financially for Drupal, Drupal Association and DrupalCon. We recognize that many are also sponsors of DrupalCon and send numerous employees to attend every year. As a thanks for funding Drupal.org and the Engineering Team, we’re providing Supporting Partner organizations with a lower pricing tier on DrupalCon tickets moving forward.

To learn more about becoming a Supporting Partner, how fees fund Drupal.org, and how to get the supporter rate, click here.

Easing the Transition

While we are creating more value for DrupalCon attendees, we know it can be a challenge when pricing increases, so for 2019, we have an Individual Alumni Rate. If you have attended DrupalCon twice or more in recent years -- self-funded -- you have the opportunity to register with a different pricing structure. Those who attended both Nashville and Baltimore (or Nashville and Vienna) -- and who have provided us with their email contact information and opted in to our communications -- will be emailed this offer. If you are not opted in to DrupalCon communication but believe you qualify, you can go directly to https://seattle2019.drupal.org/registration. If you are logged in and you qualify, your Drupal.org username will allow you to access the registration button.

Supporting Partner organization employees who are sponsored by their employer to attend are not included in this rate; their early-bird rate is on par with the alumni rate.

Alumni registration opens Wednesday, August 1; General Registration opens Saturday, September 1 -- as does the Call for Papers.

Mark Your Calendars

We are committed to DrupalCon as the go-to event that accelerates the creation of Drupal digital experiences, and the place to collaborate with the largest open source community. The Drupal Association invites you to share what changes about the Con you're most excited about. Watch for our news outlining new programming, and we plan to see you face-to-face in Seattle, April 8-12, 2019!

Categories: Drupal

TGN Review: Iconic Blue 2 Dice Set From Kraken Dice

Tabletop Gaming News - 1 August 2018 - 3:00pm
#NoSuchThingAsTooManyDice That’s my honest belief. I mean… I guess if you’re not able to feed or clothe yourself, but you’re buying more dice, that might be too many, but until you reach that point, you can never have enough. A couple months back, people were talking about a website that’ll show you exactly how much […]
Categories: Game Theory & Design

Commerce Guys: Drupal Commerce 2.8 & Cart Flyout Module Updates

Planet Drupal - 1 August 2018 - 2:25pm

We recently released Drupal Commerce 2.8 and are excited to highlight some of the new features. We also published new releases of two key contributed modules that make lightning-fast, client-side Add to Cart forms possible, representing a significant improvement to the customer experience.

Drupal Commerce 2.8 adds BOGO support

The most significant new feature in the 2.8 release is the “Buy X, Get Y” offer type funded by Norwegian Drupal agency Ny Media. You can now configure promotions with just core functionality that grant free or reduced price products after a set number of other products have been added to the cart. This work required a re-architecture of parts of the promotions data model and a redesign of the user interface to make it easier for merchants to create promotions in general.

Other key updates and improvements in this release include:

Read the release notes to get the full scope of additional updates and also to learn about some backward compatibility breaks that affect custom promotions, custom tax types, and order processors. We'll keep chipping away at the core roadmap and plan to add query-level entity access to the API for the next release.

Commerce Cart Flyout “Add to Cart” Update

The newest release of the Cart Flyout module includes notable updates to its JavaScript based “Add to Cart” feature. In addition to powering an editable shopping cart in a “flyout” sidebar, it now improves the Add to Cart experience with a very fast client-side solution using resources defined by the Commerce Cart API.

The standard Add to Cart form uses Drupal’s Forms API to update form elements based on attribute selection. It can submit three to four Ajax requests on average while customers select a product variation, but the new module can build, update, and submit the form purely in the client via JavaScript. Because the server sends the browser all the data it needs to build the interactive form in the initial request, we're able to avoid any additional requests to the server until the customer is actually ready to initiate the Add to Cart. Check it out:

Following up on our Commerce 2.8 release, we've released updates to our Cart Flyout and Cart API modules to build, update, and submit dynamic Add to Cart forms purely in the browser via JavaScript. More on this decoupling effort in the latest blog: https://t.co/yXcZOv1RQy pic.twitter.com/bIikuiERaq

— Drupal Commerce (@drupalcommerce) August 1, 2018

Even under high visitor load, users will have a faster experience overall. Server resources are only devoted to users who decide to convert. Casual visitors can browse and modify product variations as much as they like and not affect other users’ load times. This is yet another step on our path toward providing a progressively decoupled eCommerce solution for the community to build robust experiences for merchants and consumers.

Categories: Drupal

Pages

Subscribe to As If Productions aggregator