Drupal

Jeff Geerling's Blog: Change the displayed username in Drupal 8 ala Realname

Planet Drupal - 21 September 2016 - 6:04pm

Recovering from surgery finally gave me time to update my last D6 site—a 7 year old private photo and media sharing site with nearly 10,000 nodes and 20+ GB of content—to Drupal 8. Drupal 8 has become a lot more mature lately, to the point where I'm comfortable building a site and not having the foundation rot out from beneath as large ecosystem shifts have mostly settled down.

One thing that I thought would have the simplest implementation actually took a little while to figure out. I needed to have users' full name display instead of their usernames throughout the site. For D6 (and for similar D7 use cases), the easiest way to do this was to enable the Realname module, configure it a tiny bit, and be done with it.

In Drupal 8, however, Realname doesn't yet have a full release (see this issue for progress), and the way usernames are generated has changed slightly (see change record hook_username_alter() changed to hook_user_format_name_alter()).

Categories: Drupal

Views HTTP Pager

New Drupal Modules - 21 September 2016 - 5:42pm

This module adds HTTP Link headers for the "pagers" of a Views Rest Export.

Simply enable it and you will see Link headers such as:

Link: <http://www.example.com/my/rest/export?page=1>; rel="self", <http://www.example.com/my/rest/export?page=0>; rel="first", <http://www.example.com/my/rest/export?page=2>; rel="next", <http://www.example.com/my/rest/export?page=2>; rel="last"

This can be used to facilitate client-side paging by systems integrating with your Views-driven Web API.

Categories: Drupal

Microserve: Ditch your gender perceptions and inspire inquisitive minds!

Planet Drupal - 21 September 2016 - 4:00pm
Ditch your gender perceptions and inspire inquisitive minds! Sep 22nd 2016

I recently read a report by Deloitte which stated that, by the end of 2016, fewer than 25% of information technology jobs in developed countries will be held by women. That’s quite bleak, especially for women and young girls who are thinking about starting and developing a career in IT.

That got me reading on the topic of “women in tech” a little more. It’s a well-known topic and a lot of people have suggested potential reasons for this gap: an unconscious gender bias brought about by tech being a “boy’s club”; very few female role models in the tech industry; but perhaps most interestingly, the concept of a “brogrammer” culture: competitive male developers who are in it to prove they’re the best in a macho, masculine way, shouldering anyone else to the sidelines.

I’m no stranger to the brogrammer culture: I’ve worked alongside men who behave this way, and it’s apparent when I attend developer events as well. But as an answer to the question “why don’t girls consider IT and STEM as career choices from a young age”, that might be too simplistic.

My interest in computers began as a child. I can’t remember a time when we didn’t have a computer in the house - my dad was, and is, a massive geek, and prided himself on being an early adopter of everything and anything. He encouraged me to tinker, explore and break things. Without a shadow of a doubt, my enthusiasm and interest stemmed from those years when he let me run loose on his PC (and invariably end up breaking something).

I was really lucky to attend a well-equipped primary school until I was 10, where we had IT lessons once a week, learning about how to use computers to solve real-world problems. My secondary school was an all-girls’ school, where we did our IT GCSE at the end of year 9 - two years early. Some of my peers even went on to do their A level IT while we were doing our GCSEs.

That said, my secondary school was in a rural location, and many of my peers seemed preprogrammed to believe they would move into well-known careers like teaching, childcare or even farming. Aspirations to move into STEM-related careers amongst my fellow students were few and far between, even though our teachers were constantly pushing us towards medicine, veterinary sciences, IT, mathematics and the like. The opportunities existed and our teachers were great at encouraging us to consider STEM as a career choice, but most students passed it over completely.

So, it begs the question: if these children knew there were career opportunities available in STEM, and they knew they were lucrative, well-paid jobs, why did they pass them over for other, more traditional options? Why are so few girls willing to choose a career in STEM?

This got me thinking about how STEM is portrayed as a career. My role as a web developer is all about logic-based problem solving: it’s critical thinking at its very finest. We should be demonstrating to kids how fun and rewarding it can be when you’re presented with a real world problem, and how you use computer programming in a logical way to arrive at a solution.

As an avid digital artist in my spare time, I feel we should expand to students of the arts, demonstrating how computer design can be a viable career alternative. So often schools pigeonhole artistry as “painting bowls of fruit on paper”, skimming over the awesome world of technology: there’s graphic design, animation, games design, music production and so much more. A career in IT doesn’t necessarily mean programming!

So often people choose careers because they feel fulfilled in them: teachers because they like teaching and nurturing kids; doctors because they like to care for others; historians because they enjoy history. With tech, it’s important to sell the story in a different way. We need to ditch the perception of “if you work with computers, you’re geeky and uncool”, and frame a career in tech as “a way to solve problems”, so that we can inspire inquisitive minds from an early age.

But what about when it comes to boys versus girls? What’s the solution for getting more girls into tech? Well, in my view everything I’ve said here applies to both boys and girls. I would have hated being singled out as a special case because I was “a girl who liked computers” - like some kind of unicorn!

I’m a staunch believer that if a person doesn’t like something, they simply won’t pursue it. If you show children - boys and girls alike - how technology can be enjoyed and fulfilling, without introducing gender roles, they’ll be more likely to consider tech as a career.

The key is to forget about gender, and start focusing on the exciting opportunities that choosing a career in STEM can bring about!

Sophie has a BSc (hons) in Web Design, and was the UK’s first female Drupal Grand Master (the highest recognition in Drupal development). Her talents have recently been recognised by The Drum who listed Sophie amongst their ‘50 under 30’ most influential women in tech, as well as by BIMA who included her in their Hot 100 list. She is a senior developer for Microserve and has worked on many of our most complex client projects.

 

 

Written by: Sophie Shanahan-Kluth, Senior Developer

Microserve is a Drupal Agency based in Bristol, UK. We specialise in Drupal Development, Drupal Site Audits and Health Checks, and Drupal Support and Maintenance. Contact us for for further information.

Categories: Drupal

Cocomore: Cocomore Job Check: What does a Community Manager do?

Planet Drupal - 21 September 2016 - 3:00pm

Get ready for the fourth part of our job check series: This time, Christian Flach explains what it’s like to work as a Community Manager, what he appreciates about his job and which challenges he has to face.

Categories: Drupal

Aegir Monitoring API

New Drupal Modules - 21 September 2016 - 2:55pm

This module provides a monitoring API for the Aegir Hosting System. It integrates with Aegir queue system, and runs probes against hosted sites or servers to gather interesting information (e.g. when cron was last run on a site).

Categories: Drupal

Hybris Drupal Integration

New Drupal Modules - 21 September 2016 - 2:45pm
Categories: Drupal

Gizra.com: Yesod (and Haskell) from a Drupal (and PHP) Perspective

Planet Drupal - 21 September 2016 - 2:00pm

In Gizra, we run an unusual stack. Drupal, our bread and butter, serves as the backend and is complimented by Elm for the front end, and as of recently Yesod - a Haskell framework.
Before Yesod, we were running NodeJs as our proxy server for light tasks or real-time messages.

But ever since I came across Elm, Javascript and I are hardly friends. I respect it, but can no longer turn my eye from its shortcomings. Functional programming has caught my heart and mind.

In this post I’m not going to try and present strong points on why you should adapt this stack, but rather share with you the unique path we are paving.

Elm

Elm was my first dip into the functional programming (FP) world. I recommend starting from there. It’s way more gentle than Haskell, and it has, of course, one important advantage - it helps you build rock solid, crazily fast, joy-filling, web apps.

Maybe this post and video will get you excited as well.

Gentle Intro to Haskell

A good way to start explaining what’s so special about Haskell is to dive directly into Haskell. While PHP is defined (by some) as a “productive” language, Haskell is often blamed (by some) as being an “academic language”. Both statements are probably wrong.

Often when mentioning Haskell, we talk about the compiler and the type system. They are truly marvelous tools. For the type system, I think the Elm post I lined above should be enough to get the hang of it. But I’d like to continue and reveal a bit more by highlighting mini examples on how Haskell makes us approach development tasks differently.

Lists

Below are examples from the REPL (the interactive shell for Haskell)

> [1, 2] ++ [3, 4] [1, 2, 3, 4]

What we have here are two lists of integers that are appended to each other. A list of integers is represented as [Int] in Haskell. The ++ is the operation that causes those two lists to be grouped into a single one.

Haskell comes with some handy shortcuts.

Continue reading…

Categories: Drupal

Cheeky Monkey Media: Cheeky Monkey Media Named Leading Digital Agency

Planet Drupal - 21 September 2016 - 1:31pm
Cheeky Monkey Media Named Leading Digital Agency rohan Wed, 09/21/2016 - 20:31

Do you want to kick ass in the digital environment? We thought so! Our cheeky monkeys have been helping clients do just that since 2008—longer than many digital agencies have been around.

Our work speaks for itself, but we really like it when our clients speak on our behalf. Recently their input was in large part responsible for helping us make a list of the top digital agencies in Canada, compiled by Clutch, a B2B market research firm based in Washington, D.C.

We earned our spot on Clutch’s “Leaders Matrix” based on our previous work, market presence, and most importantly, client reviews conducted by Clutch analysts. Below are a few comments from some of the people we’ve worked with:

Categories: Drupal

Drupal.org blog: A new look for Drupal.org

Planet Drupal - 21 September 2016 - 12:09pm

As you can see we've put a fresh coat of paint on Drupal.org - but the changes run below the surface. This latest iteration of the front page brings the key concepts of our design system to the forefront: Clean, Modern, Technical.

This change also brings new editorial tools for Drupal.org content editors. The new home page provides us more flexibility with content and presentation, and so you'll see more frequent updates, more information about DrupalCon, and more editorial flexibility on the home page than you've seen in the past. These tools are also helping us to build cleaner, modern landing pages - like you've just seen with our Fall Membership Campaign.

We've previewed this work with several key members of the community and the board, and we want to say thank you to everyone who's given us their feedback on this first step for our new home page. We also want to give an extra special thank you to dyannenova for her contributions to this effort.

This is just the beginning - very soon we'll have a new visual look for the case studies that are featured on the home page, and then shortly after that we'll begin promoting solutions to Drupal evaluators in specific industries, like Higher Education, Media & Publishing, and Government.

If Drupal.org is the home of the community, than the front page is our front door. We want to welcome new users and evaluators of Drupal, highlight the project's strengths, and promote news and happenings from throughout the ecosystem.

We hope you like the changes, and we think you'll like the upcoming iterations even more. We'd love to hear your feedback!

Categories: Drupal

Four Kitchens: Component-Based Theming in Drupal 8: The Video Series

Planet Drupal - 21 September 2016 - 11:00am

Check out our video series on component-based theming in Drupal 8. […]

Categories: Drupal

Drupal Blog: Drupal 8.1.10 released

Planet Drupal - 21 September 2016 - 9:33am

Drupal 8.1.10, a maintenance release which contains fixes for security vulnerabilities, is now available for download.

See the Drupal 8.1.10 release notes for further information.

Download Drupal 8.1.10

Upgrading your existing Drupal 8 sites is strongly recommended. There are no new features nor non-security-related bug fixes in this release. For more information about the Drupal 8.x release series, consult the Drupal 8 overview.

Security information

We have a security announcement mailing list and a history of all security advisories, as well as an RSS feed with the most recent security advisories. We strongly advise Drupal administrators to sign up for the list.

Drupal 8 includes the built-in Update Manager module, which informs you about important updates to your modules and themes.

Bug reports

This is the final security release for the 8.1.x series. Future maintenance releases will be made available in the 8.2.x series, according to our monthly release cycle.

Change log

Drupal 8.1.10 is a security release only. For more details, see the 8.1.10 release notes. A complete list of all changes in the upcoming 8.2.x branch can be found in the git commit log.

Security vulnerabilities

Drupal 8.1.10 was released in response to the discovery of security vulnerabilities. Details can be found in the official security advisories:

To fix the security problem, please upgrade to Drupal 8.1.10. (Sites testing the 8.2.x release should update to 8.2.0-rc2.)

Update notes

See the 8.1.10 release notes for details on important changes in this release.

This is the final security release of the 8.1.x series. Sites should prepare to update to 8.2.0 following this release.

Known issues

See the 8.1.10 release notes for known issues.

Categories: Drupal

Lullabot: Modern decoupling is more performant

Planet Drupal - 21 September 2016 - 9:00am

Two years ago, I started to be interested in API-first designs. I was asked during my annual review, “what kind of project would you like to be involved with, this next year?” My response: I want to develop projects from an API-first perspective.

Little did I know that I was about to embark on a series of projects that would teach me not only about decoupled Drupal, but also the subtleties of designing proper APIs to maximize performance and minimize roundtrips to the server.

Embedding resources

I was lucky enough that the client that I was working with at the time—The Tonight Show with Jimmy Fallon—decided on a decoupled approach. I was involved in the Drupal HTTP API server implementation. The project went on to win an Emmy Award for Outstanding Interactive Program.

The idea of a content repository that could be accessed from anywhere via HTTP, and leverage all the cool technologies 2014 had to offer, was—if not revolutionary—forward-looking. I was amazed by the possibilities the approach opened. The ability to expose Drupal’s data to an external team that could work in parallel using the front-end technologies that they were proficient with meant work could begin immediately. Nevertheless, there were drawbacks to the approach. For instance, we observed a lot of round trips between the consumer of the data—the client—and the server.

As it turns out, The Tonight Show with Jimmy Fallon was only the first of several decoupled projects that I undertook in rapid succession. As a result, I authored version 2.x of the RESTful module to support the JSON API spec in Drupal 7. One of the strong points of this specification is resource embedding. Embedding resources—also called resource composition—is a technique where the response to a particular entity also contains the contents of the entities it is related to. Embedding resources for relationships is one of the most effective ways to reduce the number of round trips when dealing with REST servers. It’s based on the idea that the consumer requests the relationships that it wants embedded in the response. This same idea is used in many other specifications like GraphQL.

In JSON API, the consumer can interrogate the data with a single query, tracing relationships between objects and returning the desired data in one trip. Imagine searching for a great grandparent with a genealogy system that would only let you find the name of a single family member at a time versus a system that could return every ancestor going back three generations with a single request. To do so, the client appends an include parameter in the URL. For example: 

?include=relationship1,relationship2.nestedRelationship1

The response will include information about four entities:

  • The entity being requested (the one that contains the relationships).
  • The entity that relationship1 points to. This may be an entity reference field inside of the entity being requested.
  • The entity that relationship2 points to.
  • The entity that nestedRelationship1 points to. This may be an entity reference field inside of the entity that relationship2 is pointing to.

A single request from a consumer can return multiple entities. Note that for the same API different consumers may follow different embedding patterns, depending on the designs being implemented.

The landscape for JSON API and Drupal nowadays seems bright. Dries Buytaert, the product lead of the Drupal project, hopes to include the JSON API module in core. Moreover, there seems to be numerous articles about decoupling techniques for Drupal 8.

But does resource embedding offer a performance edge over multiple round-trip requests? Let’s quantitatively compare the two.

Performance comparison

This performance comparison uses a clean Drupal installation with some automatically generated content. Bear in mind, performance analysis is tightly coupled to the content model and merits case-by-case study. Nevertheless, let’s analyze the response times to test our hypothesis: that resource embedding provides a performance improvement over traditional REST approaches.

Our test case will involve the creation of an article detail page that comes with the Standard Drupal profile. I also included the profile image of a commenter to make things a bit more complex.

undefined

In Figure 1, I’ve visually indicated the “levels” of relationships between the article itself and each accompanying chunk of content necessary to compose the “page.” Using traditional REST, a particular consumer would need to make the following requests:

  • Request the given article (node/2410).
  • Once the article response comes back it will need to request, in parallel:
    • The author of the article.
      • The profile image of the author of the article.
    • The image for the article.
    • The first tag for the article.
    • The second tag for the article.
    • The first comment on the article.
      • The author of the first comment on the article.
        • The profile image of the author of the first comment of the article.
    • The second comment of the article.
      • The author of the second comment of the article.

In contrast, using the JSON API module (or any other with resource composition), will only require a single request with the include query parameter set to 

?include=uid,uid.field_image,field_tags,comments,comments.uid,comments.uid.field_image

When the server gets such a request it will load all the requested entities and return them back in a single swoop. Thus, the front-end framework for your decoupled app gets all of its data requirements in a JSON document in a single request instead of many.

For simplicity I will assume that the overall response time of the REST-based approach will be the one with the longest path (four levels deep). Having four parallel requests that happen at the same time will not have a big impact on the final response time. In a more realistic performance analysis, we would take into account that having four parallel calls degrades the overall performance. Even in this handicapped scenario the resource embedding should have a better response time.

Once the request reaches the server, if the response to it is ready in the different caching layers, it takes the same effort to retrieve a big JSON document for the JSON API request than to retrieve a small JSON document for one of the REST requests. That indicates that the big effort is in bootstrapping Drupal to a point where it can serve a cached response. That is true for anonymous and authenticated traffic, via the Page Cache and Dynamic Page Cache core modules.

undefined

The graphic above shows the response time for each approach. Both approaches are cached in the page cache, so there is a constant response time to bootstrap Drupal and grab the cache. For this example the response time for every request was ~7 ms every time.

It is obvious that the more complex the interconnections between your data are the greater the advantage of using JSON API's resource embedding. I believe that even though this example is extremely simple, we were able to cut response time by 75%.

If we now introduce latency between the consumer and the server, you can observe that the JSON API response still takes 75% less time. However, the total response time is degraded significantly. In the following chart, I have assumed an optimistic, and constant, transport time of 75 ms.

undefined Conclusion

This article describes some sophisticated techniques that can dramatically improve the performance of our apps. There are some other challenges in decoupled systems that I did not mention here. If you are interested in those—and more!—please attend my session at DrupalCon Dublin Building Advanced Web Services With JSON API, or watch it later. I hope to prove that you can create more engaging products and services by using advanced web services. After all, when you are building digital experiences one of your primary goals you should be to make it enjoyable to the user. Shorter response times correlate to more successful user engagement. And successful engagements make for amazing digital experiences .

Categories: Drupal

Drupal core announcements: Media in Drupal 8 Initiative plan posted for review

Planet Drupal - 21 September 2016 - 8:54am

As we are ramping up to work on significant user improvements for Drupal 8.3, one of the key areas of progress could be with media management user interfaces and features. For that to happen, we need to agree on what we are going to work on and then have people to implement it. The Media in Drupal 8 Initiative plan is being formed and is open for feedback now if having better core media support is near and dear to your heart. Please review and post feedback on the plan.

If you'd like to get involved with the implementation, you are more than welcome! The media team meets every Wednesday at 2pm GMT on IRC in #drupal-media.

Categories: Drupal

CKEditor FakeObjects

New Drupal Modules - 21 September 2016 - 7:51am

This plugin helps to create a "representative" (image with styles) for certain elements which have problem with living in editable, it provides the API to transform an real DOM element into the "fake" one, and to restore the real element from the fake one on the output.

Adds FakeObjects plugin integration for CKEditor.

This is required by plugins that require fakeobjects to work, like PageBreak.

Categories: Drupal

Annertech: Things I Learned from the DrupalTwig Slack: Volume 1

Planet Drupal - 21 September 2016 - 7:38am
Things I Learned from the DrupalTwig Slack: Volume 1

Without doubt, the greatest resource for information about Drupal frontend issues is the DrupalTwig Slack. There are over 300 of the world's most well known frontend Drupal developers - Wim Leers, MortenDK, Mark Drummond, David Hernandez, and more - offering and receiving help all day every day. It's very rare that someone asks a question and doesn't receive a reply with a solution within a few minutes, or at the very least a conversation about why the issue might be hard to solve.

Categories: Drupal

Kodamera Screencast: Embedding videos easily with Video Filter

Planet Drupal - 21 September 2016 - 7:29am

Embedding videos can be a tricky thing to do when it comes to both the web and different CMS's. When it comes to embedding videos in the content section - the body of the page - The Video Filter module offers an easy and great solution. 

Basically, you install the module, configure it for the different text formats you want to use it with and then simply add the videos in the body text with a kind of shortcode or shorthand thingamajig.

In this video I'll go through what you need to know and how to get the videos to show in your content.

The Video Filter module only works as a text filter, so if you're looking for a solution where you can create embedded videos from a field of its own in Drupal, perhaps Video Embed Field could offer such a solution. (I'm just talking about Video Filter in this screencast.)


Read more
Categories: Drupal

CKEditor PageBreak

New Drupal Modules - 21 September 2016 - 7:23am

This module provides integration with the PageBreak plugin for CKEditor.

This plugin adds toolbar button which inserts horizontal page breaks. This feature is useful for setting document printing sections.

Text entered in a browser-based text editor such as CKEditor differs from word processors because it is not divided into physical pages. In effect, this plugins lets you define pages.

Categories: Drupal

Drupalize.Me: Drupalize.Me Now Powered by Pantheon

Planet Drupal - 21 September 2016 - 6:37am

If you're following along at home, you may have seen that we recently made the move to Pantheon hosting. Last week during our maintenance window, Joe and I worked through our migration checklist, and officially moved the site over to our new host. The process had a few hiccups, but we thought it would be interesting to take a look at what went into our migration process. Hopefully sharing what went into our planning process, as well as what is in our pipeline for improvements now that we're on Pantheon, will help you if you ever find yourself facing a similar project.

Categories: Drupal

Freegeoip of logged in User

New Drupal Modules - 21 September 2016 - 5:33am

This module provides the simple integration with the https://freegeoip.net

Categories: Drupal

Unimity Solutions Drupal Blog: How Attending DrupalCon Dublin Could Benefit You?

Planet Drupal - 21 September 2016 - 5:05am

DrupalCon Dublin is just a week away!! With all the excitement surrounding the event we often forget to look at key things to expect out of this event. What should one learn out of DrupalCon Dublin? Is it only for Drupal developers or should CEOs, Managers and owners attend? What’s the use of attending an event on OPEN SOURCE TECHNOLOGY? Is it useful for growth of businesses as well?

Categories: Drupal

Pages

Subscribe to As If Productions aggregator - Drupal