Planet Drupal

Subscribe to flux Planet Drupal
Drupal.org - aggregated feeds in category Planet Drupal
Mis à jour : il y a 57 min 51 sec

Palantir: The Secret Sauce, Ep. 32: Documentation and Training

mar, 20/09/2016 - 20:55
The Secret Sauce, Ep. 32: Documentation and Training The Secret Sauce brandt Tue, 09/20/2016 - 13:55 Ryan Price with Allison Manley Sep 20, 2016

We want to make your project a success.

Let's Chat.

There are many benefits to documenting your project and teaching someone else how to use it.

Senior Engineer Ryan Price dives into the importance of documentation in this week’s episode of the Secret Sauce. 

iTunes | RSS Feed | Download| Transcript

Stay connected with the latest news on web strategy, design, and development.

Sign up for our newsletter. Transcript

Allison Manley [AM]: Hello and welcome to The Secret Sauce, a short podcast by Palantir.net, that offers a little bit of advice to help your business run better. I’m Allison Manley, an Account Manager, and today we have Senior Engineer Ryan Price talking about the importance of documentation and training.  

Ryan Price [RP]: My name is Ryan Price, and I want to talk a little bit today about documentation and training. Probably the key person that I think about when I get into the role of writing documentation for a project is future me. Who is the person that will be reading this later, and who is the person that’s going to get the most benefit out of it? Then I sort of go from there, because the more people that get involved with the project — whether it’s someone on the client side, whether they’re technical or non-technical, whether it’s other members of the development team, or maybe my project manager — all of those people are going to read or edit or touch the documentation of a project at some point.

And on a lot of projects I’ve worked on in the past, I have been in the role of training the new people who are going to be using that project, whether it’s other developers or the content editor who’s working on the client side. And all of those people need to know what this website is supposed to be doing. Beyond just the business goals, there’s lots of nuts and bolts things, and in the land of Drupal we have lots of nuts and bolts things. And for some people those things are totally new, and they have fun new words like ‘nodes’ and ‘taxonomy’ and ‘views.’ And for other people, they know those things, but they haven’t seen this way for placing blocks in this context, whatever that happens to be.

So I think even a simple project that is just a brochure site would still have documentation that needs to be written for future me. When I come back to this project, I don’t want to spend five hours remembering my motivation behind making a new field for this. It should just be there. What does this field do and why do we have it? You want to get this stuff out of your head. If you get hit by a bus, you don’t want to be the person on the project who made something that was indecipherable and everyone needs to sit around and figure it out.

And the other thing is, when you explain something, you learn it. There’s doing it and being able to do it yourself, versus having to write it down. For me, translating something out of my head into speaking is when I really understand what it is that I’m doing, or writing it down at the same time. And you can also discover things about the project, too. Like discovering when a requirement is unclear, or when a piece of work is not quite polished. Because you’re getting ready to document it, and you say, it’s supposed to do these nine things and it does eight of them really well.

So there are lots and lots of benefits to documenting your project and teaching someone else how to use it, and I think probably the key person among those is future me. Thank you for listening!

AM: Thanks Ryan. That’s the end of this week’s Secret Sauce. For more great tips, please check out our website at Palantir.net. You can also follow us on twitter at @palantir. Have a great day!

Catégories: Elsewhere

Mediacurrent: 5 Design Ideas to Increase Engagement on Your Website

mar, 20/09/2016 - 17:55

No matter what industry you’re in, chances are your website is battling for visitor attention. No less than a fully optimized web presence built to respond to any device is required to get ahead of today’s fierce, strategic competition. Cisco estimates that 50 billion smart devices will be connected to the Internet by 2020 – that’s three times the 15 billion devices that are connected today!

Catégories: Elsewhere

BlackMesh: Best of New Orleans DrupalCon Core Conversations

mar, 20/09/2016 - 16:46

DrupalCon New Orleans had many good Core Conversations. The Core Conversation track sessions are a bit different than regular session. Presenters frame a topic, discussion, or concern. And then, the conversation with the audience continues in the session recordings.

I was the local track chair and I listened to all of the convos. Here are some choice quotes. Enjoy the highlights from New Orleans, and I'll see you in Dublin!

Quotes from the sessions Automated javascript testing: where we are and what we actually want by dawehner

"we should go with Mocha and Karma" @dawehner in Core Convo: Automated javascript testing https://www.youtube.com/watch?v=Uf0cc3Nnm_k&t=33m55s @drupalconNA #drupalcon

Approaches for UX changes big and small by yoroy

"We've done multiple usability tests on [#Drupal] core. The results have become predictable” @royscholten https://www.youtube.com/watch?v=Z99gZTEZO_E&t=1m5s #DrupalCon

MVP should provide value for end users right from the start. @royscholten https://www.youtube.com/watch?v=Z99gZTEZO_E&t=20m05s #DrupalCon

Is size just a number?: Reflecting on community growth, mentoring, and where we spend our efforts by David Hernandez

"Focus on the human element" from @davidnarrabilis about #Drupal Community growth https://www.youtube.com/watch?v=uAkBPj4DDIM&t=19m57s #DrupalCon

Just Right: Goldilocks and CMS theme systems by lauriii and Cottser

Personas the theme system has to deal, are base for complexity we have @laurii1 https://www.youtube.com/watch?v=F88ryt1CB3A&t=3m24s #DrupalCon

"Because we can do things :)" @Cottser https://www.youtube.com/watch?v=F88ryt1CB3A&t=27m53s #DrupalCon

The potential in Drupal 8.x and how to realize it by Gábor Hojtsy and webchick

"You can make big changes in Drupal 8" @gaborhojtsy https://www.youtube.com/watch?v=ddZ-McBq-Hg&t=3m39s #DrupalCon

"Things that we want to do to the process to improve" @webchick https://www.youtube.com/watch?v=ddZ-McBq-Hg&t=14m02s #DrupalCon

About Core MVP process proposal, @dickolsson: "Can we get an MVP of this" https://www.youtube.com/watch?v=ddZ-McBq-Hg&t=50m00s // @webchick @gaborhojtsy #DrupalCon

The future of Drupal Performance - Parallel worlds by Fabianx

Ha @drupalconNA "Welcome to our cooking 101 class!" @fabianfranz in The future of Drupal Performance https://www.youtube.com/watch?v=ykrPYAGIYvU&t=0m06s #DrupalCon

"Avoid doing unnecessary work" @fabianfranz in The future of Drupal Performance https://www.youtube.com/watch?v=ykrPYAGIYvU&t=7m15s #DrupalCon

Recruiting and retaining dedicated volunteers by stephelhajj

Professional & funny: Recruiting and retaining dedicated volunteers @stephelhajj https://www.youtube.com/watch?v=7HJy75UXWXw&t=00m24s #DrupalCon

Prune your garden @stephelhajj https://www.youtube.com/watch?v=7HJy75UXWXw&t=40m38s #DrupalCon

Together we can make Drupal The Example for Diversity in Tech! by drnikki and techgirlgeek

Diversity, Equality, Inclusion, Marginalized Group @TechGirlGeek https://www.youtube.com/watch?v=TYNGnPV3HKo&t=04m07s #DrupalCon

Things that make you a: good developer, no. tech worker. no: human being @drnikki https://www.youtube.com/watch?v=TYNGnPV3HKo&t=19m26s #DrupalCon

Unbias Me Chrome extension from @fureigh https://twitter.com/fureigh/status/712986115897180160 via @drnikki https://www.youtube.com/watch?v=TYNGnPV3HKo&t=32m45s #DrupalCon

#DrupalCon audience adds @lexiconvalley E78 http://www.slate.com/articles/podcasts/lexicon_valley/2016/01/american_dialect_society_word_of_the_year_is_the_singular_they.html Diversity resource // @TechGirlGeek @drnikki https://www.youtube.com/watch?v=TYNGnPV3HKo&t=33m40s

Learning to Let Go (Contrib Burnout) and Module Giveaway by Dave Reid

"Be human" from @lullabot via @davereid https://www.youtube.com/watch?v=wm09T97gdtk&t=02m05s #DrupalCon

How to do contrib: compartmentalize, therapy, afk time, todo list via @davereid https://www.youtube.com/watch?v=wm09T97gdtk&t=25m10s #DrupalCon

Drupal (admin) as an application: More JavaScript in core? by prestonso , danigrrl , and mdrummond

At #MidCamp "consensus about what features we want in Core for JavaScript" @prestonso @MarcDrummond https://www.youtube.com/watch?v=Sn4jDELDNMY&t=06m25s #DrupalCon

Workflow Initiative (Drupal is a CMS) by timmillwood and dixon_

Check the Workflow Initiative Plan for updates https://www.drupal.org/node/2721129 #DrupalCon core convo from @timmillwood @dickolsson https://www.youtube.com/watch?v=_rAB8DJnc8Y

Leaving Drupal by eatings

"One cant be a master without an apprentice" @eatings Leaving Drupal #DrupalCon core convo https://www.youtube.com/watch?v=_yUZjTusq7k&t=48m10s

State of Drupal by Dries, xjm, and Gábor Hojtsy

To help remove contribution barriers @Dries in State of #Drupal #DrupalCon core convo https://www.youtube.com/watch?v=Ct0IYLgPYos&t=15m00s

How to find issues that are good for new contributors from @gaborhojtsy at @Dries State of #Drupal #DrupalCon convo https://www.youtube.com/watch?v=Ct0IYLgPYos&t=30m35s

D.o, github, issue workspaces background via @xjmdrupal @joshua_io at @Dries State of #Drupal #DrupalCon convo https://www.youtube.com/watch?v=Ct0IYLgPYos&t=59m37s Don't say just. It does a great disservice to the complexity of the system @joshua_io at State of #Drupal #DrupalCon https://www.youtube.com/watch?v=Ct0IYLgPYos&t=1h02m45s

Lessons from WordPress Core by stevector and andrew.taylor

"We have a twin island [..] right next to us, that has all the same pressures we do.” @stevector https://www.youtube.com/watch?v=JeoCHqzvUFY&t=25m15s #DrupalCon

DrupalDrupalCon New Orleans
Catégories: Elsewhere

InternetDevels: Drupal 8 Module: Rules

mar, 20/09/2016 - 16:39

Rules are everywhere: at school, at work, in life in general ... and there are some Rules in Drupal 8
as well!
Although it’s definitely not what you think it is :)

Read more
Catégories: Elsewhere

Zivtech: What are Hooks?

mar, 20/09/2016 - 15:32
As a junior developer ramping up to learning Drupal, I spent a lot of time clicking through the UI. After getting familiar with it, I wanted to take a look behind the scenes at Drupal’s codebase. Writing code for a Drupal site can be an overwhelming experience because, even though it’s written in PHP, there’s a dense API behind it. One of the biggest parts of that API is the hook system. The first exposure I had to writing PHP with Drupal was through update hooks. So I wanted to review how hooks work, and how cool they are to use! What is a Hook? Drupal has a lot of excellent Community Documentation, and their page on hooks is thorough. It says:

“Hooks are how modules can interact with the core code of Drupal. They make it possible for a module to define new urls and pages within the site (hook_menu), to add content to pages (hook_block, hook_footer, etc.), to set up custom database tables (hook_schema), and more.

Hooks occur at various points in the thread of execution, where Drupal seeks contributions from all the enabled modules. For example, when a user visits a help page on a Drupal site, as Drupal builds the help page it will give each module a chance to contribute documentation about itself. It does this by scanning all the module code for functions that have the name mymodule_help($path, $arg), where "mymodule" is the module's name, e.g., the block module's help hook is called block_help and the node module's help hook is called node_help. The hook may provide parameters; hook_help's parameters $path and $arg allow the developer to determine what page or pages the help messages will appear on.
A hook can be thought of as an event listener in the sense that an event triggers an action.”

It’s amazing that Drupal is built on this hook system. There are hooks for anything you can think of! You can even alter a form or a whole page. As Drupal builds each page, it’s scanning the module code for the hooks in core and then runs the ones that you wrote. Alan Storm put it succinctly in one of his blog posts:

“When a hook is invoked, Drupal will

  1. Get a list of all installed and enabled modules
  2. Ask each module “Have you implemented the do_something hook”?
  3. If so, then Drupal calls the function in those modules that implement the hook

This way, as a core developer, you can achieve what you want while still letting other programmers “hook into” what you’re doing.”

Update Hooks The first hook I used was an update hook. The purpose of an update hook is to run code when a database update is triggered. (See the Drupal documentation for function hook_update_N for more information). I’m assuming my reader has worked with Features development (if not, go here).

My goal was to enable a certain contributed module programmatically when I deployed my code to the site (the Olark module). To do this, I had to find an existing feature in my project that was already enabled. A good rule of thumb is to add your code to an existing feature that is related to the code you’re writing. Since Olark is a chat module, I was looking for a feature related to customers or the homepage. I couldn’t find any feature that fit exactly with the module, so I added my code to feature_general. Within the directory of that feature, I found the feature_general.install file, and added my hook:
/** * Enables 'olark' module. */ function feature_general_update_7006() { module_enable(array('olark')); }
After I deploy my code, I trigger a database update. Think back to the three steps that Alan Storm mentioned. Since my feature is already enabled, when the update is triggered, Drupal asks if any update hooks have been invoked. When it sees that there is one in my feature, it knows to read the code in the install file and turn on the Olark module.

It’s also worth noting the naming convention. I have to put the name of my feature and then _update. The number of the hook also matters (see documentation for specifics on how to number your hooks). The hooks only run once, so each hook has to be one greater than the one before.

Writing hooks is a great way for a junior developer to be introduced to PHP in Drupal and learn about how Drupal is built. Once you can conceptualize the inner workings of Drupal, it’s much easier to tackle things like module development in the future.
Catégories: Elsewhere

myDropWizard.com: Giving Clients What They Need - Not What They Want

mar, 20/09/2016 - 14:38

If you're anything like me, you've spent a few years in the freelance/agency world performing work for clients. If your clients are anything like the ones I've had, they come in with preconceived notions, "wives tales", and many, many things that are just not in their best interest.

I know there is a tendency to say "the customer is always right." I would prefer to say "the customer is entitled to the best product possible."

Part of that product is you - their developer - and your knowledge.

In this post, I'm going to attempt to show you a piece of what I mean when I say "Giving Clients What They Need - Not What They Want".

Catégories: Elsewhere

Annertech: DrupalCon Welcome Party: It'll be Deadly and Savage (with translations)

mar, 20/09/2016 - 12:22
DrupalCon Welcome Party: It'll be Deadly and Savage (with translations)

This day next week, as part of the Drupal Ireland Association, we will be delighted to welcome you to Dublin at the DrupalCon Welcome Party. It's on a boat, which is going to be deadly ("deadly" in this context means great, "lethal" would mean dodgy/dangerous!). The boat is just across the road from the convention centre, so that will be savage ("savage" of course means lots of fun).

Catégories: Elsewhere

Aurelien Navarre: Porting the Page Load Progress module to Drupal 8

mar, 20/09/2016 - 10:08

Back in 2012, my colleague Mariano released the Page Load Progress module for Drupal 7. This is not a widely popular module but I love it. Simply put, it will display a spinner when a page is taking too long to load, to prevent your users from clicking around or leave the page. It excels for time-consuming form submissions.

The path to being a co-maintainer

In mid-2014, I wanted to start learning Drupal 8 so I figured porting the Page Load Progress module to D8 would be twofold: 1/ do something meaningful to make the module live during the Drupal 8 lifecycle 2/ get to learn about the Drupal 8 API changes.

I quickly filed an issue in the Page Load Progress issue queue to get community feedback as I was 80% through porting the module. For about 2 years I never heard back, so at some point I realized the module was no longer being maintained and a critical Views issue on Drupal 7 (and by extension Drupal 8) was most likely preventing the module from getting wider adoption.

I reached out to Mariano and he said he was no longer doing Drupal development and was happy for me to take over the module. Ha! Didn't think about being a module maintainer. I'm not even a developer. That being said I liked the idea that Open source is all about passing on the torch and I had to do my part until I'd pass it on to someone else.

So, I followed the Dealing with unsupported (abandoned) projects guidelines and filed an issue to take over maintaining the Page Load Progress module. The next steps were for me to get community awareness and help with this new challenge. I thus filed a Drupal 8 Contrib Porting Tracker issue and reached out to Dom. to make him a co-maintainer and mentor on the project, since he has extensive experience with Drupal 8.

Taking it from there

During the summer, we then worked on completing the port of the module and brainstormed on where to bring it next. The main highlights are:

Usage statistics show people are starting using it again, which likely means we did have a blocker with this annoying Views issue.

Next we want to work on implementing JavaScriptTestBase and also allow users to exclude arbitrary paths from triggering the throbber.

Conceptually, the Page Load Progress is a very simple module. But when you think about it, you can considerably improve its inner workings, support edge-cases better and have full JS test coverage to make it rock solid. We're on it. See you in the issue queue!

Catégories: Elsewhere

Cocomore: We Got It: The Drupal 8 Developer Certificate

mar, 20/09/2016 - 00:00

For software developers it is very important to continue their education continuously. That’s why our Drupal programmers in Seville didn’t hesitate and participate as some of the first ones in the Drupal 8 Certification Program of Acquia. With success! For everyone thinking about also getting certified for the latest version of the CMS we have some useful tips.

Catégories: Elsewhere

Palantir: Noble Network of Charter Schools

lun, 19/09/2016 - 23:38
Noble Network of Charter Schools brandt Mon, 09/19/2016 - 16:38 Supporting Students For a More Promising Future

Support for a better managed codebase across a platform of Drupal sites.

Highlights
  • Provided valuable insight into state of the site with an in-depth code audit

  • Transitioned seamlessly from previous hosting platform to Acquia

  • Streamlined theme to reduce code duplication

Do you need a site audit?

Let's Chat.

Noble Network of Charter Schools (Noble) is a Chicago-based nonprofit organization that manages a network of 16 public high schools and one middle school located throughout Chicago. The schools of the Noble Network serve over 10,000 mainly low-income, underserved students, and work toward making a college degree a reality for each of them. 

Noble needed a firm with a deep bench of Drupal talent to optimize its current sites and maintain and extend the underlying platform as Noble improved and advanced its online presence. Noble’s previous support provider no longer had the Drupal staff to support their needs, and they also needed assistance in transitioning their sites to a new hosting platform.

As we do with all of our support clients, we began with an in-depth code audit that allowed Noble to see the state of their sites behind the scenes. This audit provided details on what we could implement to increase the stability and speed of the Noble sites. One of the most significant updates we made was to streamline the theme to reduce code duplication. The existing code base did not leverage Drupal’s theme inheritance properly.

Across the sites in the network, about 95% of the CSS is identical. Only colors and log images are changed. However, when the site was initially built by another firm, the code and CSS for each site was duplicated, which meant that if a change was made in one place, it needed to be changed in 17 different places. Using a base theme properly, our developers updated the codebase so that if something is fixed on the core level, then it is fixed on all of the sites. 

In addition, we implemented bonus features like a homepage slideshow, form and calendar integrations, and modified Google Translate functionality. The form and calendar integrations allows Noble students and families to more efficiently see upcoming events at their campuses and provides a quick way to contact the school by email with general questions and comments. The Google Translate functionality is very important, as many students’ families speak Spanish at home. Noble sends all official documents home with Spanish translations, and it was important that the website be just as accessible.

Working with Acquia, we helped Noble transition to a new hosting provider that provides Drupal support for the network. Because we jumped right in with a great project manager and the right resources to get started, Noble’s sites experienced no downtime which mitigated any negative user experience. Moving to Acquia gave us better tools for managing code and deployments across the sites, and as our partnership continues and more features are added, the result is a better managed and overall more reliable platform of sites.  
 

"Going with Palantir to support your Drupal website is a no brainer." Donnell P. Layne, Director of Information Technology

We want to make your project a success.

Let's Chat. Drupal Services Support Project Management How to Gauge Your Support Needs We've Got Your Back: Palantir's Support Services The Secret Sauce, Ep. 25: What Can Support Do for You? noblenetwork.org
Catégories: Elsewhere

Drupal Aid: Enhancing CKEditor in Drupal 8

lun, 19/09/2016 - 21:00

It was a happy day for me when CKeditor was incorporated into Drupal 8 core. Out of the box, Ckeditor is great. But there a lot of things you can do to make it better and more user friendly for your clients. In this post, I’ll show you some easy additions you can make to enhance your end-user's content editing experience.

  • How to easily make Links to other content
  • How to easily add Files and Images (and manage them too)
  • Adding Custom Styles
  • Adding Templates
  • Other helpful CKEditor Add-ons that are available.

Read more

Catégories: Elsewhere

Acquia Developer Center Blog: Personalization Happens - Acquia at dmexco 2016

lun, 19/09/2016 - 18:12

Conversations about delivering business needs with digital tools, or "How to get Drupal into the conversation without talking technology."

Acquia and several partners had a successful presence at the 2016 dmexco trade show for digital marketing and advertising. By "successful," I mean we spoke with hundreds and hundreds of people about how we can help them do better business and I think many of them will end up being happy users, consumers, and contributors to Drupal and our community.

In this podcast (audio and video), I give a quick intro to the dmexco trade fair and speak with the following people about digital transformation, selling Drupal without selling Drupal, the state of Drupal in Germany in 2016, and more:

Bonus! Acquia made it into the official dmexco wrap-up video. Great to see us representing Drupal alongside so many big names.

Bonus 2! Check out my Buzzword Bingo video from the dmexco floor to get a feel for the magnitude of the show and its ecosystem and the sometimes confusing world of contextual cloud targeting, media data reach optimisation, customer brand implementation, storytelling growth and even more that I didn't make up!

Skill Level: BeginnerIntermediateAdvanced
Catégories: Elsewhere

ActiveLAMP: Who is Drupal Right For: DrupalCamp LA 2016 Table Talk - pt. 2/5

lun, 19/09/2016 - 17:01

Part two of our table talk! This week the agency owners of Achieve Internet, Stauffer, ActiveLAMP and Facet Interactive discuss the who is Drupal right for.

Read more...
Catégories: Elsewhere

Dcycle: Using Docker to evaluate, patch or develop Drupal modules

lun, 19/09/2016 - 16:51

Docker is now available natively on Mac OS in addition to Linux. Docker is also included with CoreOS which you can run on remote Virtual Machines, or locally through Vagrant.

Once you have installed Docker and Git, locally or remotely, you don't need to install anything else.

In these examples we will leverage the official Drupal and mySQL Docker images. We will use the mySQL image as is, and we will add Drush to our Drupal image.

Docker is efficient with caching: these scripts will be slow the first time you run them, but very fast thereafter.

Here are a few scripts I often use to set up quick Drupal 7 or 8 environments for module evaluation and development.

Keep in mind that using Docker for deployment to production is another topic entirely and is not covered here; also, these scripts are meant to be quick and dirty; docker-compose might be useful for more advanced usage.

Port mapping

In all cases, using -p 80, I map port 80 of Drupal to any port that happens to be available on my host, and in these examples I am using Docker for Mac OS, so my sites are available on localhost.

I use DRUPALPORT=$(docker ps|grep drupal7-container|sed 's/.*0.0.0.0://g'|sed 's/->.*//g') to figure out the current port of my running containers. When your containers are running, you can also just docker ps to see port mapping:

$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f1bf6e7e51c9 drupal8-image "apache2-foreground" 15 seconds ago Up 11 seconds 0.0.0.0:32771->80/tcp drupal8-container ...

In the above example (scroll right to see more outpu), port http://localhost:32771 will show your Drupal 8 site.

Using Docker to evaluate, patch or develop Drupal 7 modules

I can set up a quick environment to evaluate one or more Drupal 7 modules. In this example I'll evaluate Views.

mkdir ~/drupal7-modules-to-evaluate cd ~/drupal7-modules-to-evaluate git clone --branch 7.x-3.x https://git.drupal.org/project/views.git # add any other modules for evaluation here. echo 'FROM drupal:7' > Dockerfile echo 'RUN curl -sS https://getcomposer.org/installer | php' >> Dockerfile echo 'RUN mv composer.phar /usr/local/bin/composer' >> Dockerfile echo 'RUN composer global require drush/drush:8' >> Dockerfile echo 'RUN ln -s /root/.composer/vendor/drush/drush/drush /bin/drush' >> Dockerfile echo 'RUN apt-get update && apt-get upgrade -y' >> Dockerfile echo 'RUN apt-get install -y mysql-client' >> Dockerfile echo 'EXPOSE 80' >> Dockerfile docker build -t drupal7-image . docker run --name d7-mysql-container -e MYSQL_ROOT_PASSWORD=root -d mysql docker run -v $(pwd):/var/www/html/sites/all/modules --name drupal7-container -p 80 --link d7-mysql-container:mysql -d drupal-image DRUPALPORT=$(docker ps|grep drupal7-container|sed 's/.*0.0.0.0://g'|sed 's/->.*//g') # wait for mysql to fire up. There's probably a better way of doing this... # See stackoverflow.com/questions/21183088 # See https://github.com/docker/compose/issues/374 sleep 6 docker exec drupal7-container /bin/bash -c "echo 'create database drupal'|mysql -uroot -proot -hmysql" docker exec drupal7-container /bin/bash -c "cd /var/www/html && drush si -y --db-url=mysql://root:root@mysql/drupal" docker exec drupal7-container /bin/bash -c "cd /var/www/html && drush en views_ui -y" # enable any other modules here. Dependencies will be downloaded # automatically echo -e "Your site is ready, you can log in with the link below" docker exec drupal7-container /bin/bash -c "cd /var/www/html && drush uli -l http://localhost:$DRUPALPORT"

Note that we are linking (rather than adding) sites/all/modules as a volume, so any change we make to our local copy of views will quasi-immediately be reflected on the container, making this a good technique to develop modules or write patches to existing modules.

When you are finished you can destroy your containers, noting that all data will be lost:

docker kill drupal7-container d7-mysql-container docker rm drupal7-container d7-mysql-container Using Docker to evaluate, patch or develop Drupal 8 modules

Our script for Drupal 8 modules is slightly different:

  • ./modules is used on the container instead of ./sites/all/modules;
  • Our Dockerfile is based on drupal:8, not drupal:7;
  • Unlike with Drupal 7, your database is not required to exist prior to installing Drupal with Drush;
  • In my tests I need to chown /var/www/html/sites/default/files to www-data:www-data to enable Drupal to write files.

Here is an example where we are evaluating the Token module for Drupal 8:

mkdir ~/drupal8-modules-to-evaluate cd ~/drupal8-modules-to-evaluate git clone --branch 8.x-1.x https://git.drupal.org/project/token.git # add any other modules for evaluation here. echo 'FROM drupal:8' > Dockerfile echo 'RUN curl -sS https://getcomposer.org/installer | php' >> Dockerfile echo 'RUN mv composer.phar /usr/local/bin/composer' >> Dockerfile echo 'RUN composer global require drush/drush:8' >> Dockerfile echo 'RUN ln -s /root/.composer/vendor/drush/drush/drush /bin/drush' >> Dockerfile echo 'RUN apt-get update && apt-get upgrade -y' >> Dockerfile echo 'RUN apt-get install -y mysql-client' >> Dockerfile echo 'EXPOSE 80' >> Dockerfile docker build -t drupal8-image . docker run --name d8-mysql-container -e MYSQL_ROOT_PASSWORD=root -d mysql docker run -v $(pwd):/var/www/html/modules --name drupal8-container -p 80 --link d8-mysql-container:mysql -d drupal8-image DRUPALPORT=$(docker ps|grep drupal8-container|sed 's/.*0.0.0.0://g'|sed 's/->.*//g') # wait for mysql to fire up. There's probably a better way of doing this... # See stackoverflow.com/questions/21183088 # See https://github.com/docker/compose/issues/374 sleep 6 docker exec drupal8-container /bin/bash -c "cd /var/www/html && drush si -y --db-url=mysql://root:root@mysql/drupal" docker exec drupal8-container /bin/bash -c "chown -R www-data:www-data /var/www/html/sites/default/files" docker exec drupal8-container /bin/bash -c "cd /var/www/html && drush en token -y" # enable any other modules here. echo -e "Your site is ready, you can log in with the link below" docker exec drupal8-container /bin/bash -c "cd /var/www/html && drush uli -l http://localhost:$DRUPALPORT"

Again, when you are finished you can destroy your containers, noting that all data will be lost:

docker kill drupal8-container d8-mysql-container docker rm drupal8-container d8-mysql-container Tags: blogplanet
Catégories: Elsewhere

Nuvole: Pimp your Behat Drupal Extension and rule the world

lun, 19/09/2016 - 16:00
Make the most out of your Behat tests by using custom contexts, dependency injection and much more.

This post is an excerpt from the topics covered by our DrupalCon Dublin training: Drupal 8 Development - Workflows and Tools.

At Nuvole we consider writing good tests as a fundamental part of development and, when it comes to testing a complex site, there is nothing better than extensive behavioral tests using Behat. The benefits of such a choice are quite obvious:

  • Tests are very easy to write.
  • Behat scenarios serve as a solid communication mean between business and developers.

As a site grows in complexity, however, the default step definitions provided by the excellent Behat Drupal Extension might not be specific enough and you will quickly find yourself adding custom step to your FeatureContext or creating custom Behat contexts, as advocated by all official documentation.

This is all fine except that your boilerplate test code might soon start to grow into a non-reusable, non-tested bunch of code.

Enter Nuvole's Behat Drupal Extension.

Nuvole's Behat Drupal Extension

Nuvole's Behat Drupal Extension is built on the shoulders of the popular Behat Drupal Extension and it focuses on step re-usability and testability by allowing developers to:

  • Organize their code in services by providing a YAML service description file, pretty much like we all are used to do nowadays with Drupal 8.
  • Override default Drupal Behat Extension services with their own.
  • Benefit of many ready-to-use contexts that are provided by the extension out of the box.
Installation and setup

Install Nuvole's Behat Drupal Extension with Composer by running:

bash $ composer require nuvoleweb/drupal-behat

Setup the extension by following the Quick start section available on the original Behat Drupal Extension page, just use NuvoleWeb\Drupal\DrupalExtension instead of the native Drupal\DrupalExtension in your behat.yml as shown below:

default:
  suites:
    default:
      contexts:
        - Drupal\DrupalExtension\Context\DrupalContext
        - NuvoleWeb\Drupal\DrupalExtension\Context\DrupalContext
        ...
  extensions:
    Behat\MinkExtension:
      goutte: ~
      ...
    # Use "NuvoleWeb\Drupal\DrupalExtension" instead of "Drupal\DrupalExtension".
    NuvoleWeb\Drupal\DrupalExtension:
      api_driver: "drupal"
      ...
      services: "tests/my_services.yml"
      text:
        node_submit_label: "Save and publish" "Service container"-aware Contexts

All contexts extending \NuvoleWeb\Drupal\DrupalExtension\Context\RawDrupalContext and \NuvoleWeb\Drupal\DrupalExtension\Context\RawMinkContext are provided with direct access to the current Behat service container. Developers can also define their own services by adding a YAML description file to their project and setting the services: parameter to point to its current location (as shown above).

The service description file can describe both custom services and override already defined services. For example, given a tests/my_services.yml containing:

services:
  your.own.namespace.hello_world:
    class: Your\Own\Namespace\HelloWorldService

Then all contexts extending \NW\D\DE\C\RawDrupalContext or \NW\D\DE\C\RawMinkContext will be able to access that service by just calling:

<?php
class TestContext extends RawDrupalContext {

  /**
   * Assert service.
   *
   * @Then I say hello
   */
  public function assertHelloWorld() {
    $this->getContainer()->get('your.own.namespace.hello_world')->sayHello();
  }

}
?>

The your.own.namespace.hello_world service class itself can be easily tested using PHPUnit. Also, since Behat uses Symfony's Service Container you can list services your service depends on as arguments so to remove any hardcoded dependency, following Dependency Injection best practices.

Override existing services

Say that, while working on your Drupal 7 project, you have defined a step that publishes a node given its content type and title and you want to use the same exact step on your Drupal 8 project, something like:

Given I publish the node of type "page" and title "My page title"

The problem here is that the actual API calls to load and save a node differs between Drupal 7 and Drupal 8.

The solution is to override the default Drupal core services specifying your own classes in your tests/my_services.yml:

parameters:
  # Overrides Nuvole's Drupal Extension Drupal 7 core class.
  drupal.driver.cores.7.class: Your\Own\Namespace\Driver\Cores\Drupal7
  # Overrides Nuvole's Drupal Extension Drupal 8 core class.
  drupal.driver.cores.8.class: Your\Own\Namespace\Driver\Cores\Drupal8

services:
  your.own.namespace.hello_world:
    class: Your\Own\Namespace\HelloWorldService

You'll then delegate the core-specific business logic to the new core classes allowing your custom step to be transparently run on both Drupal 7 and Drupal 8. Such a step would look like:

<?php
class TestContext extends RawDrupalContext {

  /**
   * @Given I publish the node of type :type and title :title
   */
  public function iPublishTheNodeOfTypeAndTitle($type, $title) {
    $this->getCore()->publishNode($type, $title);
  }

...
?> Ready to use contexts

The extension also provides some utility contexts that you can use right away in your tests. Below a quick overview of what's currently available:

Context Description NuvoleWeb\Drupal\DrupalExtension\Context\DrupalContext
Standard Drupal context. You want to use this one next to (and not instead of) Drupal\DrupalExtension\Context\DrupalContext. NuvoleWeb\Drupal\DrupalExtension\Context\ContentContext
Perform operations on Content. NuvoleWeb\Drupal\DrupalExtension\Context\CKEditorContext
Allows to interact with CKEditor components on your page. NuvoleWeb\Drupal\DrupalExtension\Context\ResponsiveContext:
  devices:
    mobile_portrait: 360x640
    mobile_landscape: 640x360
    tablet_portrait: 768x1024
    tablet_landscape: 1024x768
    laptop: 1280x800
    desktop: 2560x1440
Resize the browser according to the specified devices, useful for testing responsive behaviors. NuvoleWeb\Drupal\DrupalExtension\Context\PositionContext
Check position of elements on the page. NuvoleWeb\Drupal\DrupalExtension\Context\ChosenFieldContext
Interact with Chosen elements on the page.

We will share more steps in the future enriching the current contexts as well as providing new ones so keep an eye on the project repository!

Disclaimer

At the moment only Drupal 8 is supported but we will add Drupal 7 support ASAP (yes, it's as easy as providing missing Drupal 7 driver core methods and adding tests).

Tags: Drupal PlanetBehatTest Driven DevelopmentTrainingDrupalCon
Catégories: Elsewhere

Aurelien Navarre: How to return the path to an enabled Drupal module or theme?

lun, 19/09/2016 - 09:33

In Drupal 7, it was fairly easy to retrieve the filesystem path for, say, enabled modules.

mysql> SELECT filename, name FROM system WHERE status = 1 AND name = "xmlsitemap"; +--------------------------------------------------------+------------+ | filename | name | +--------------------------------------------------------+------------+ | sites/all/modules/contrib/xmlsitemap/xmlsitemap.module | xmlsitemap | +--------------------------------------------------------+------------+ 1 row in set (0.00 sec)

Why would you do that? Simply because sometimes you can run into issues caused by duplicate .info files in the filesystem. A common error is when you're deleting a duplicate module or changing directories in the filesystem but the module is still registered in the database in its original location. This will make Drupal sad when it bootstraps.

When this happens, you need to know where a particular module is being loaded from. You may compare the results of the above MySQL query with a simple Linux command to find all occurrences of those filenames in your Drupal docroot and try to narrow down the issue (e.g. is the filename being loaded still present on the filesystem?). This could be with the form:

$ find . -type f -name "*.info" | grep -oe "[^/]*\.info" | sort | uniq -d property_validation.info xmlsitemap.info

Let's say xmlsitemap.info is our culprit. We can refine the Linux find command accordingly:

$ find . -type f -name "xmlsitemap.info" ./sites/all/modules/xmlsitemap/xmlsitemap.info ./sites/all/modules/contrib/xmlsitemap/xmlsitemap.info

Which gives the full path to the duplicate .info file.

What matters the most here is we don't need to bootstrap Drupal, which can be a lifesaver in case the site is down.

Going forward with Drupal 8

In Drupal 8 we still have drupal_get_path() to help if we can bootstrap Drupal.

Psy Shell v0.7.2 (PHP 5.6.24 — cli) by Justin Hileman >>> drupal_get_path('module', 'xmlsitemap'); => "modules/xmlsitemap"

However, we can no longer query the {system} table. One workaround I found is to decode the corresponding {key_value} entry. E.g.:

$ drush sqlq "SELECT CONVERT(value USING utf8) FROM key_value WHERE collection = 'state' AND value LIKE '%xmlsitemap.info.yml%'" | grep --color=auto 'xmlsitemap.info.yml'

This will return a huge array, so, having a colored output for grep is helpful to get the filename to the loaded .info.yml file.

This gets the job done but not as cleanly as I would. Do you know of any better way to achieve this?

Catégories: Elsewhere

Danny Englander: Drupal 8 Architecture: Video Tour for Designing Structured Modular Content Using Entity Construction Kit (ECK) & Inline Entity Form (IEF)

lun, 19/09/2016 - 01:54

A few months back, I read an interesting blog post by Chapter Three about something they call the "Slice Template." I was really inspired after I read that, it struck me as a whole new paradigm for content creation, that of "structured modular content." At the same time, I was working on a new Drupal 8 theme and build where my objective was to create something that would give content creators lots of flexibility.

When I've had discussions with content creators in the past, more often than not, the one word that kept coming up was "flexibility." In turn, on site builds, this lead to doing some really wacky things all in one wysiwyg.

In the meantime, I had been playing around with the Paragraphs and Field Collection modules for Drupal 8 but after reading Chapter Three's post, I decided to go in different direction, that being Entity Construction Kit, "ECK."

One way of building with ECK is that you have "slices" which are entities that contain bundles and can also reference other entities that have their own bundles. On the content creation side, you can leverage the Inline Entity Form and Inline Entity Form Preview modules to create a minimalistic interface for content creators. It took me a long time to wrap my head around all this and lots of trial and error.

Now that I feel like I have a good handle on this, I decided to record a video tour of what I have been building. It's still a work in progress but I think it's well enough along to give a little demo.

Tags 
  • Drupal 8
  • Video
  • Tutorial
  • Drupal Planet
  • Theming
  • Architecture
Catégories: Elsewhere

Red Route: Considerations for a Drupal 8 upgrade

lun, 19/09/2016 - 01:00

This article was originally posted on the Capgemini Engineering blog

If you're migrating from a different CMS platform, the advantages of Drupal 8 seem fairly clear. But what if you're already on Drupal? There has been a lot of discussion in the Drupal community lately about upgrading to Drupal 8. When is the right time? Now that the contributed module landscape is looking pretty healthy, there aren't many cases where I'd recommend going with Drupal 7 for a new project. However, as I've previously discussed on this blog, greenfield projects are fairly rare.

Future proofing

One of the strengths of an open source project like Drupal is the level of support from the community. Other people are testing your software, and helping to fix bugs that you might not have noticed. Drupal 7 will continue to be supported until Drupal 9 is released, which should be a while away yet. However, if your site is on Drupal 6, there are security implications of remaining on an unsupported version, and it would be wise to make plans to upgrade sooner rather than later, even with the option of long term support. While the level of support from the community will no longer be the same, sites built on older versions of Drupal won't suddenly stop working, and there are still some Drupal 5 sites out there in the wild.

Technical debt

Most big systems could do with some refactoring. There's always some code that people aren't proud of, some decisions that were made under the pressure of a tight deadline, or just more modern ways of doing things.

An upgrade is a great opportunity to start with a blank piece of paper. Architectural decisions can be revisited, and Drupal 8's improved APIs are ideal if you're hoping to take a more microservices-oriented approach, rather than ending up with another MySQL monolith.

Drupal's policy of backward incompatibility means that while you're upgrading the CMS, you have the chance to refactor and improve the existing custom codebase (but don't be suckered in by the tempting fallacy that you'll be able to do a perfect refactoring).

There are no small changes

Don't underestimate how big a job upgrading will be. At the very least, every custom module in the codebase will need to be rewritten for Drupal 8, and custom themes will need to be rebuilt using the Twig templating system. In a few cases, this will be a relatively trivial job, but the changes in Drupal 8 may mean that some modules will need to be rebuilt from the ground up. It isn't just about development - you'll need to factor in the time it will take to define requirements, not to mention testing and deployment. If it's a big project, you may also need to juggle the maintenance of the existing codebase for some time, while working on the new version.

The sites that we tend to deal with at Capgemini are big. We work with large companies with complex requirements, a lot of third party integrations, and high traffic. In other words, it's not just your standard brochureware, so we tend to have a lot of custom modules.

If it ain't broke, don't fix it

Given the fact that an upgrade is non-trivial, the question has to be asked - what business value will an upgrade bring? If all you're doing is replacing a Drupal 7 site with a similar Drupal 8 site, is it really a good idea to spend a lot of time and money to build something that is identical, as far as the average end user can tell?

If the development team is focused on upgrading, will there be any bandwidth for bug fixes and improvements? An upgrade will almost certainly be a big investment - maybe that time, energy and money would be better spent on new features or incremental improvements that will bring tangible business value and can be delivered relatively quickly. Besides, some of the improvements in Drupal 8 core, such as improved authoring experience, are also available in the Drupal 7 contrib ecosystem.

On the other hand, it might make more sense to get the upgrade done now, and build those improvements on top of Drupal 8, especially if your existing codebase needs some TLC.

Another option (which we've done in the past for an upgrade from Drupal 6 to 7) is to incrementally upgrade the site, releasing parts of the new site as and when they're ready.

The right approach depends on a range of factors, including how valuable your proposed improvements will be, how urgent they are, and how long an upgrade will take, which depends on how complex the site is.

The upside of an upgrade

Having said all of that, the reasons to upgrade to Drupal 8 are compelling. One big plus for Drupal 8 is the possibility of improved performance, especially for authenticated users, thanks to modern features like BigPipe. The improved authoring experience, accessibility and multilingual features that Drupal 8 brings will be especially valuable for larger organisations.

Not only that, improving Developer Experience (DX) was a big part of the community initiatives in building Drupal 8. Adopting Symfony components, migrating code to object-oriented structures, improving the APIs and a brand new configuration management system are all designed to improve developer productivity and code quality - after the initial learning curve. These improvements will encourage more of an engineering mindset, and drive modern development approaches. The net benefit will be more testable (and therefore more reliable) features, easier deployment and maintenance methods and increase speed of future change.

Decision time

There is no one-size-fits-all answer. Your organisation will need to consider its own situation and needs.

Where does upgrading the CMS version fit into the organisation's wider digital roadmap? Is there a site redesign on the cards any time soon? What improvements are you hoping to make? What functionality are you looking to add? Does your site's existing content strategy meet your needs? Is the solution architecture fit for your current and future purposes, or would it make sense to think about going headless?

In summary, while an upgrade will be a big investment, it may well be one that is worth making, especially if you're planning major changes to your site in the near future.

If the requirements for your upgrade project are "build us the same as what we've got already, but with more modern technology" then it's probably not going to be worth doing. Don't upgrade to Drupal 8 just because it's new and shiny. However, if you're looking further forward and planning to build a solid foundation for future improvements then an upgrade could be a very valuable investment.

Tags:  Drupal development agile open source All tags
Catégories: Elsewhere

Vardot: Drupal + SEO: Optimizing Your Site for Search Engines

dim, 18/09/2016 - 14:49
Case Studies Read time: 11 minutes

A few month ago when I wrote my first article about Drupal, some people noticed that for listing essential security modules one should have more development experience. It’s true, when I’ve started working at Vardot, I had to interview many developers and site builders before writing every single blog post, but the topic I’ve chosen this time is my favorite. This topic is something (beside basics of Russian language) that  I’m teaching my colleagues, but not learning from them. And this topic is called search engine optimization.

 

 

Vardot boosted its organic traffic up to 202% during last 6 month, and in this article I’ll share with you our best practices - use them to increase search engine ranks of your Drupal sites, too. So how to take the most of search engine optimization when it comes to Drupal? Here are our answers.

 

1. Pay attention to UX

UX design covers any touch point that the user can have with the organization. This means that a better UX-design leads to happier customers, and a bad UX-design works as a customer repellant. If your product is marketed through word of mouth publicity, than more and more people start searching for it; Google understands that it is a very positive trend and increases your organic visibility. However, latest Google searching algorithms analyze not only the popularity of your brand, but also the behavior of your site visitors. Search engines calculate the amount of time people spent on a webpage, number of pages viewed per session, and bounce rate as an indicator of customer satisfaction. Below you’ll find UX factors that are critically important for developers.

 

  • Design

If a website attracts a good amount of traffic, but users are not able to find what they are looking for, Google is decreasing the position of the website on search engine result pages. An unattractive design or a slow website make users close it, which affects your SEO. Therefore, UX is becoming one of the important ranking factors.

 

  • Site structure

Website structure is an organic process that starts with an initial design and undergoes a number of tweaks and redesigns as it starts taking shape. In relation to SEO, the structure of a website plays a crucial role. There are mainly three aspects for site structuring: Site Navigation, Internal Linking, and URL structuring. When it comes to navigation, make sure you avoid the kind that makes it difficult for the search engines to crawl through your website’s pages. Secondly, it would be a good idea to create internal links which offer an opportunity to create and use keyword rich anchor texts. Finally, URL structuring gives that added and a very important benefit of integrating your company’s target keywords with its vital navigation area.

Link Structure: Analyzing the Most Important Methods

 

  • Proper code

There’s a concept in coding known as the time-space tradeoff. This means the complexity of a code can reduce its size but will increase its processing time and vice versa. The key here is to establish the right balance.

Also, it’s equally important to keep testing your code for bugs. They affect the bounce rate of a website as nobody likes to read a page that has loading or any other issues. Remember, it’s not always about crawlers - it’s much more about customer satisfaction.

 

  • Improve Site Speed, Performance and Raise Application Performance Index (Apdex)

Apdex measures the ratio of satisfactory response time and unsatisfactory response time against a set threshold. Last investigations show that websites with a load delay of a few seconds have 7% more bounce rate than the others. Make sure to check-list everything that can help you to make your site faster.  

 

  • Prevent Duplicate Content

Nothing kills a website faster than duplicate content. You need to have original and unique texts that convey your message effortlessly. In case you need to copy and paste an article as it is from somewhere else, make sure you add a canonical URL to let Google now that you’ve mentioned the original source and not plagiarized it.

 

  • Remove 404 (content-not-found)

Content-not-found occurs on the client side when a given web page is deleted or moved to another location and the new URL is not updated. A big number of broken links on your site can affect its PageRank and decrease its visibility in search engines. Make sure time to time to crawl your website using tools like SEMrush and remove links pointing to inactive or non-existent pages.

 

2. Tell search engines what is your site about
  • Title tags

 

Title tags are among the most important aspects for efficient SEO of any web page, and it is highly important to include your main keywords to the title of the page. Google are (or is?) following the approach of repeating your title tag information in the search engine result page (SERP), so it also affects the clicking rate. A well crafted tag is easy to read and gets more clicks. The rule of the thumb is to write like a copywriter or write it in a way so that it can also be used on an advertisement brochure. Make sure that you have only one title tag per page. Keep things short and crisp. A title tag is more like a punch line: if you need to speak more about it, change it. Title tag should be of 60 characters in length and should include the main keyword. For more advice, check this amazing article.

 

  • Meta tags

Correct use of Meta Tags increases your website’s search rankings. They can be found in the head of every page i.e. between the HTML tags. If you consider the statistics, 90% of users look only at the top 20 to 30 search results, so your goal should be to land somewhere in this range or higher. The top search engines today use meta tags to index your pages, therefore it goes without saying how important it is to use them to get your site indexed and increase its rankings. There exists a range of meta tags that Google understands - use them all.

 

  • Meta Description

 

Meta description is a brief description of the page, basically piece of code situated in the header. There you can include extra details. To make it worth for your SEO efforts, there are some rules that you can follow. Keep your description restricted to a range of 135 to 160 characters and don’t forget to include keywords in it. Keep the form of the subject active and actionable which simply means use sentences that drive the reader to click on your link. Make your description unique, structured and a reflection of what your content is about and also at the same time containing the focus keywords. Search Engine Land gives you more advice to the topic.

 

  • Open Graph

This will provide social identity to every page of your website. One of the key roles of Open Graph is that it adds a snippet that appears automatically when an article is shared. The amount of traffic you attract and clicks you get is proportional to how engaging your OG snippet text is. Facebook established it in order to improve the presentation of pages on their social network. By using this protocol, your webpage will become a part of their social graph. The protocol is to supply accurate information required by the search engines. This increases the SEO rankings of your pages because search engines like Google are optimized to detect these Open Graph Meta Tags. You can integrate the Open Graph Protocol in your web pages to boost the SEO rankings. Facebook also provides Open Graph Testing Protocol which can be used to check the information that will be presented. You can say that this is the new way to represent the data on the internet.

 

  • ALT Tags for Images

 

It’s more difficult for search engines to recognize images as compared to texts, and alt tags are used to explain crawlers what is the content of the page about. Search engine queries with respect to your image will be exponentially enhanced if you follow best policies to generate your alt tags. Moreover, for images that are linked, alt tags work in a similar manner as anchor texts for text links. Using alt tags on all your images may consume a little more time than what you originally planned, but remember that this does provide its share in increasing your rankings. Above all, for a better performance of your content make sure to include keywords to your image descriptions.

 

3. Create friendly environment for Crawlers
  • Search Engine Friendly URLs

Let me illustrate this with an example. Here are two sample URL’s for you “http://example.com/index.php?page=gall_&ry” and “http://example.com/gallery”. Which one do you find easier to read and understand? The same goes for SEO as well. Friendly URLs explain the path to a search engine in a way which is easy to understand and call. In the example we mentioned, it is the latter that will be easily called by search engine bot.

 

  • XML Site-map

XML sitemap is a document that allows a website’s webmaster to inform Google and other search engines about your website and lets them identify and understand each and every URL that helps in a better crawling. XML sitemap contains information like when was the webpage last updated, how often the website undergoes changes and information regarding relevance and importance of a given page in relation with other web pages. XML sitemap also lets you exclude some pages from bot’s crawl.

 

  • Add Site Theming

Imagine a web-crawler trying to go through your web page with “divs” everywhere. It would be hard for them to differentiate between the part of the document meant for navigation and the main article. They can analyze your document composition using some hints, like a “ul” list of internal links can mean page navigation. On the other hand, if a “nav” element is used instead of “ul”, the crawler will understand right away that this is for page navigation. H1 heading contains the category name or the product name. H2 is used for subheadings and to segregate content into segregated blocks which are easier to scan. H3 doesn’t hold much information, and they are mostly used for closing the post heading.

 

4. Help people find you
  • Site Verifications

Site verification on Google, Bing, Yandex and other major search engines lets them know that you are the actual owner of the given website. Once your ownership is verified, Google lets you access the private Google Data, which can improve a spider bot’s crawling abilities on your website.

 

  • Resource Description Framework (RDF)

Make sure your site interface includes world-wide accepted standards for Resource Description Framework (RDF) that enhances metadata description for the web.

 

  • Google News Site-map

The Google News sitemap contains a lot of benefits in comparison to merely numbering the URLs of every page of your website. With proper titles and publication dates tagged on a sitemap, crawlers are able to categorize your content more accurately. Moreover, you get the facility to comments on your content with keywords, stock tickers, and other metadata.

 

  • Multilingual content

If your site supports multiple languages, you can surely talk to more potential clients on the internet (check the statistics here). To increase the traffic of your site, translate it to different languages and make it valuable for many people.

 

  • Social Media integration

Social media like Facebook, Twitter, LinkedIn, etc generate more traffic and give you additional mentions on the web. Although Google doesn’t consider shares as high as normal backlinks, crawlers still measure the visibility of your site. If people keep talking about it in social networks, your rank in search engines will grow. Produce more valuable content that will be shared by people!

 

5. Analyze your results
  • Google Analytics Integration

Usually people can not predict everything, that’s why testing has the same importance as an actual development. The best instrument to understand what your site visitors like and what they dislike is Google Analytics. Use it to monitor and analyze the traffic and the performance of your website.

 

Conclusion

It’s true that Drupal is one of the best CMSs in terms of SEO: it helps you to generate a clean code, prevents duplicate content and spam, easily integrates with third-party tools and is very user-friendly and configurable. However, I’ve seen many Drupal sites that are not optimized at all and as a result they don’t get much organic traffic from search engines.

It is very important to remember that our responsibility as Drupal community members is not only to create an SEO-friendly framework for our customers, but also to educate them on how to get the most of it. I hope this article will help you to build websites that rank high by search engines and prove that Drupal is one of the best available CMSs for SEO.

Tags:  SEO Drupal Planet Title:  Drupal + SEO: Optimizing Your Site for Search Engines
Catégories: Elsewhere

Aram Boyajyan: Custom permissions in Drupal 8

sam, 17/09/2016 - 14:31
Custom permissions in Drupal 8 Sat, 17/09/2016 - 14:31

Drupal's permissions system is at the same time easy to use and very powerful. It covers most of the cases where your module provides different functionality for various roles on the site.

In both versions of Drupal this is fairly straightforward to implement through code. There are two parts to this article: defining custom permissions (both static and dynamic), and performing checks to see if the current user has access to them.

Catégories: Elsewhere

Pages