Planet Drupal

Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 18 min 20 sec ago

Valuebound: Building Configuration Form in Drupal 8

Mon, 01/02/2016 - 14:15

The primary mechanism for collecting input from users is Form, without them Drupal wouldn't be so much useful. This is also one of the first things Developer should learn when they start development using Drupal. Forms are fundamental to creating Drupal modules, whether asking someone to leave a comment or Administrator has option to turn the module configuration ON/OFF.

The configuration system / state system has replaced the variable system in D8. There is no variable table and no more variable_get() / variable_set() /  variable_del() calls. Configuration is stored in the database and synced with YML files on the disk for deployment purposes.

The $config object handles CRUD (Create/Read/Update/Delete) for YML files, so you simply use ::get(), ::set(), and ::save()…

Categories: Elsewhere

Chris Hall on Drupal 8: Twig extends and a D8 Twig Block base theme

Mon, 01/02/2016 - 13:55
Twig extends and a D8 Twig Block base theme chrishu Mon, 02/01/2016 - 12:55 Introduction

Twig Blocks and the extend functionality can be used to stop needless repetition.

I have posted before about Twig Blocks and Drupal and experimented a little with a theme on Github used as the base theme for this site, I also raised an issue for consideration of Twig blocks to be added to Core templates as I felt that without them D8 theming had slightly missed a trick (admittedly far too close to the release).

Fortunately the late addition of the Stable theme to D8 makes it much easier to experiment with alternative approaches to theming plus allows Core mark-up to evolve much faster than the Drupal release cycle (without arbitrarily breaking existing themes).

Copy of Stable with Twig blocks

Stable is/was a copy of the Drupal core templates that will not change, it is the default base theme for every theme that does not define a specific base theme unless base theme: false is set in the info file (which would leave you vulnerable to any changes in core templates, CSS and JS over the D8 life-cycle).

I have made a copy of Stable called Blocky and marked up some of the templates with Twig Blocks, which doesn't change the functionality of the theme at all but does allow more selective override of templates directly, after inspecting what blocks are available. For a simple example an alternative node template can just override the mark-up of the title leaving the rest of the parent template mark-up alone (no need to slavishly copy all the bits you don't want to change).

{% extends "@blocky/content/node.twig.html" %} {% block node_title %} {{ title_prefix }} {% if not page %} <h3{{ title_attributes }}> <a href="{{ url }}" rel="bookmark">{{ label }}</a> </h3> {% endif %} {{ title_suffix }} {% endblock node_title %}

Of course Blocky could always just be used as the basis of another copy, providing a more customised theme with the ability to use Twig extends (do read the official documentation for extends if you haven't used it before). You may have many variations of node templates, any change to boilerplate mark-up that is not generally overridden in child templates only has to be modified once in the parent template that all the others are extending.

Extends is not just for Twig Blocks

Extends allows for adding variables via the child that are then available in the parent template. A child template can affect the parent template or provide new variables to the parent opening up new possibilities for Drupal 8 theming strategies even without using Twig Blocks.

Classy already does this in one or two places now, for example the meat of the Classy field--field-text.htm.twig is as follows:

{% extends "field.html.twig" %} {% set attributes = attributes.addClass('clearfix', 'text-formatted') %}

In this case a more specific template is adding a class to it's general parent template without having to repeat mark-up. Is your brain starting to whir? Potential new approaches to theming? Excited?

Taking it further

Unfortunately I have not found a client project that is suitable for Drupal 8 yet so experimentation is in free-time. I am hoping to move another blog to Sculpin and then work on a better theme for that and this site that share as much as possible.

Even with Twig Blocks Drupal still has a fairly linear approach to building the front-end, so approaches sometimes used by other frameworks with Twig or Twig like template syntax will need a bit more head-scratching. For example a common approach used elsewhere would use parent layout templates that are never directly rendered, just extended. These layout templates may well have empty Twig Blocks (the main events) that are filled in further down the chain. A Drupally equivalent might be an html.html.twig template that has an empty 'page' block rather than kicking off the rendering of the page by outputting $page. This template could then be extended by multiple variations of page. Note: this approach will not currently work in Drupal but 'should' be possible digging around in pre-processing etc. (well it feels like it should).

Twig has some other tricks like embed and the simpler include and these along with extends can utilise conditionals and variables.... OMG the potential approaches to theming Drupal have increased exponentially!!! :).

 

Add new comment
Categories: Elsewhere

Valuebound: Drupal 8 installation in Windows with XAMPP

Mon, 01/02/2016 - 08:04

Installation of Drupal requires a Web server. We will be employing XAMPP package for the same purpose. XAMPP is a free and open source web server solution stack. It stands for (X-cross platform), (A-Apache HTTP Server), (M-MariaDB), (P-PHP), (P-Perl).  XAMPP is hassle free and is…

Categories: Elsewhere

hussainweb.me: Drupal Global Sprint Weekend 2016 in Bangalore

Mon, 01/02/2016 - 05:50
This year’s Drupal Global Sprint Weekend 2016 was held on January 30th and 31st throughout the world. We conduct a Drupal meetup every last Saturday in a month in Bangalore and this time, we just organized the sprint instead.
Categories: Elsewhere

Iztok Smolic: Drush 8 on Mac OSX and MAMP

Sun, 31/01/2016 - 20:23

Here is a complete guide to get your drush working OS X El Capitan. 1) Download latest stable release using the code below or browse to github.com/drush-ops/drush/releases. wget http://files.drush.org/drush.phar (Or use our upcoming release: wget http://files.drush.org/drush-unstable.phar) 2) Test your install. php drush.phar core-status 3) Rename to `drush` instead of `php drush.phar`. Destination can be anywhere […]

The post Drush 8 on Mac OSX and MAMP appeared first on Iztok.

Categories: Elsewhere

Drupal core announcements: Drupal 8 and 7 core release window on Wednesday, February 03, 2016

Sun, 31/01/2016 - 17:53
Start:  2016-02-24 00:00 - 23:30 UTC Organizers:  xjm catch David_Rothstein Event type:  Online meeting (eg. IRC meeting)

The monthly core patch (bug fix) release window is this Wednesday, February 03. Drupal 8.0.3 and 7.42 will be released with fixes for Drupal 8 and 7. There will be no Drupal 6 bugfix release this month.

To ensure a reliable release window for the patch release, there will be a Drupal 8.0.x commit freeze from 00:00 to 23:30 UTC on Wednesday, February 03. Now is a good time to update your development/staging servers to the latest 8.0.x-dev or 7.x-dev code and help us catch any regressions in advance. If you do find any regressions, please report them in the issue queue. Thanks!

To see all of the latest changes that will be included in the releases, see the 8.0.x commit log and 7.x commit log.

Other upcoming core release windows after this week include:

  • Wednesday, February 24 (security release window)
  • Wednesday, March 02 (patch release window)
  • Wednesday, April 20 (scheduled minor release)

For more information on Drupal core release windows, see the documentation on release timing and security releases, as well as the Drupal core release cycle overview.

Categories: Elsewhere

ARREA-Systems: Create list view in custom module (part 3)

Sun, 31/01/2016 - 02:51
Create list view in custom module (part 3) JK Sun, 01/31/2016 - 09:51

In previous articles (here and here), we have seen a method to aad custom views and data in MyModule.

With Drupal 8 there is a very easy and practical way to add this custom view as a configuration that will be installed with the module.

1) extract the configuration data

Navigate to "/admin/config/development/configuration/single/export".

On this page, select configuration type 'view' and configuration name 'My module list' that was created earlier.

 

 

2) create configuration install file

You will obtain from the above export a list of configuration data that you can copy and paste into a file called for instance "views.view.mymodule-list.yml";

Simply place this file into the install folder :

Categories: Elsewhere

DrupalEasy: DrupalEasy Podcast 168 - Spooning with a Fork (Jen Lampton, Nate Haug - Backdrop Update)

Sun, 31/01/2016 - 01:44
Download Podcast 168

Drupal fork Backdrop co-founders Jen Lampton (jenlampton) and Nate Haug (quicksketch) joined Mike, Anna, and Ted to discuss the current state of Backdrop, its (surprising) relations with the Drupal community, Drupal 8, as well as some current Drupal news and our picks of the week!

read more

Categories: Elsewhere

Jay L.ee: How To Customize The Fivestar Module

Sat, 30/01/2016 - 22:37

* Blue: The code from a Stack Exchange developer that saved my life and got the ball rolling for everything else.
* Green: My own comments for the purpose of this blog post.
* Orange: Additional edits made by me.
* Pink: Code that was deleted by me.
* Yellow: Code that was copied and pasted by me.

When using the Fivestar module (version 7.x-2.1), I can show the result in three ways:

Tags: Drupal 7Drupal Planet
Categories: Elsewhere

Wuinfo: Spam Defense Network

Sat, 30/01/2016 - 22:22


Spam is a big headache for many website owners. Using the Drupal impression module, I saw the relentlessness of the spammer bots. Every day, for a single site, I got thousands of hit from URLs like "/?q=user/register" and "/?q=node/add". I have someone commented on my LinkedIn update of my blog post Is there more computer bots than us?. She is "on the verge of giving up on Drupal after being unable to solve this problem". How do we address this issue and solve the problem? I know this is not the issue for one CMS like Drupal, but, it provides some mandate for us to do something. Build something for Drupal and usable by other CMS like Wordpress and Joomla.

I have a bold idea of blocking spam efficiently without taking a toll on the performance of every website. Let's set up a websites spam defence network. A network based on a global spam IP database. Each website is a node of the defence network. It provides spamming IP query as a web service.

The idea is to have a distributed but well-controlled spam IP servers. All participated website acting as a node in the network and capture spamming IP and report it. Web sites are connected and talk to each other and form a defendant line in front of spammers. The network will quarantine the spammer IP for 45 minutes or more depending on how active the spamming activity. The IP will get off the list after the quarantine time ended.

Web sites that join the network will have faster responding website by freeing up the resource taken by spamming activity. We will have a cleaner internet by eliminating the fake users, spamming comments and contents.

Technical wise, we use the open source solution. We can build distributed spam IP database like git repository. We use composer repository, so, all PHP based CMS websites can easily join the network.

Categories: Elsewhere

Another Drop in the Drupal Sea: Drupal Chat: What About Drupal 8?

Sat, 30/01/2016 - 18:17

Drupal 8 was released just over two months ago. Is it time yet for you to start using it on your production sites?

You'll need to consider the state of the modules you typically use to build your sites, the state of the themes you typically use to build your sites, the nature of the site, the budget for the site and your own skill set.

There are, without a doubt, sites that are being launched on Drupal 8 already. And, at the same time there is this:

https://www.acquia.com/blog/accelerating-drupal-8-adoption/27/01/2016/32...

So, there is obviously still work to be done.

read more

Categories: Elsewhere

ThinkDrop Consulting: OpenDevShop at DrupalCamp NJ 2016 and the Global Sprint Weekend!

Sat, 30/01/2016 - 04:26

In a few hours, I'll be heading to Princeton University for my fourth DrupalCamp New Jersey.

This camp holds a special place in my heart because it was the first place that I spoke about OpenDevShop in public.

DrupalCamp NJ brought me out of my lonely freelancer shell and into the larger Drupal community. 

2013: Beginnings of a Community

For DrupalCamp NJ 2013, we sponsored, and I held two BoFs, on Aegir & DevShop. A very small number of people attended, both of which are now good friends! Back then, I called it "DevShop: the Drupal Environment Manager". It took a long time to figure out how to even describe the thing.

Looking back, it was a critical moment. Getting out there and bragging about my own project was not something I was used to. It was the small beginning of a long tradition of listening to what people thought, keep track of the good but more importantly, the bad things about the product. By listening, we've been able to focus on what matters most for our users.

2014: "Drupal Infrastructure in a Box"

The next year, for DrupalCamp NJ 2014, the organizers were nice enough to accept my session proposal. The room was huge, and I really didn't expect such a large turnout. The feedback this year was incredible.

2015: Turn key Testing

For DrupalCamp 2015, the organizers were gracious enough to select my session again. This time I focused on the new Testing features I added to OpenDevShop. 

It was at this camp that we unveiled the ability of OpenDevShop to run Behat and other tests automatically, every time you push code.  

I was able to demo how a new Pull Request on GitHub can automatically spin up a new environment and test it.

It was such a great session, we got such great feedback, that we devoted all of our efforts into polishing and enhancing the testing. It became really clear at this DrupalCamp NJ that everyone wants to get better at testing.

Our goal with OpenDevShop became to make writing and running tests as easy as possible.

2016?

This year, we won't be holding a session, or a BoF. This year, we will be hunkered down in the Coding Lounge, working hard on upgrading OpenDevShop to be able to host and test Drupal 8. We plan on releasing an Alpha by Sunday.

Mentoring & Collaboration

On Sunday, we are staying all day for the Mentoring & Collaboration day at the FFW offices.

I've been working hard to make OpenDevShop easier to contribute to, and helping others join the community. We are going to be online and working together to improve our own tests, development environments and documentation all weekend long.

Please join us in our chat room at https://gitter.im/opendevshop/devshop and in the issue queue at https://github.com/opendevshop/devshop.

Global Sprint Weekend

This year, the Camp lines up with the Global Sprint Weekend organized by the Drupal Association. People all over the world are coming together in person and online to work together on Drupal and Open Source.

We are doing the same with OpenDevShop. Come online or in person at your local Global Sprint Weekend meetup and we will help get you setup to contribute to development!

This should be an amazing weekend. Drupal and OpenDevShop are hitting some serious momentum with Drupal 8. We're really looking forward to working with our new contributors, and pusing out DevShop 1.0!

 

For more information about OpenDevShop, visit getdevshop.com.

Tags: devshopDrupalCampNJPlanet Drupal
Categories: Elsewhere

OSTraining: Backup and Restore a Drupal 8 Site

Sat, 30/01/2016 - 03:03

Drupal 8 is here and ready to use right now.

However, not all of the contributed modules are available yet. That includes Backup and Migrate which was the most popular way to backup and restore Drupal 7 sites.

These four videos, sponsored by the excellent team at InMotion Hosting, offer a backup and restore solution that you can use with Drupal 8 today.

Categories: Elsewhere

Promet Source: How to Integrate Association Management Systems with Drupal

Fri, 29/01/2016 - 22:17

Association websites should be built to handle everything from membership drives to billing activities. Having a website by itself isn't enough; associations also need robust member management databases running behind their websites. There are many vendors who specialize in products that meet this need. These products are commonly referred to as an Association Management System (AMS) and it's rare to find a large organization that doesn't use one.

Categories: Elsewhere

Drupal core announcements: Help finalizing Migrate at the Global Sprint Weekend

Fri, 29/01/2016 - 22:12

The Migrate team would like to finish up the Migrate subsystem for next month's release of Drupal 8.1.0. They've collected a number of issues for the upcoming global sprint weekend:

Global Sprint Weekend Migrate Issues

There are issues available for all levels of expertise. If you need help, the Migrate maintainers are in #drupal-migrate on irc.freenode.net as usual and are happy to answer questions.

Categories: Elsewhere

Acquia Developer Center Blog: Drupal Global Sprint 2016, New England-Style

Fri, 29/01/2016 - 21:43
DC Denison

Tom Kraft and Renato Francia were conferring in the kitchen, laptops open, “trying to make the Feeds module work better out of the box.”

In a nearby conference room, Dan Feidt was juggling a bunch of open windows on his laptop screen, tackling “a little puzzle around virtualization and Vagrant.”

Kay VanValkenburgh, who was in charge of beginners and onboarding, was roaming, talking to attendees, “removing barriers.”

Tags: acquia drupal planet
Categories: Elsewhere

DrupalCon News: Staying for the Community: Stories From Our Organizers

Fri, 29/01/2016 - 20:13

Some of our very own DrupalCon Asia organizers are members of the Drupal Association. We spoke to them about why membership is so important to them, and their answers were so great we had to share. As DrupalCon Asia gets closer, we invite you to read why they support the community and the Drupal project with us:

Categories: Elsewhere

ImageX Media: Can These "Under the Radar" Keyword Tools Help You Optimize Your Content Marketing Strategy? We’ll Help You Find Out.

Fri, 29/01/2016 - 20:02

 

Thanks to new innovations in the search engine optimization space, there’s more tools than ever before. This article explores 5 powerful keyword research tools that might not even be on your competitors’ radar yet.
 

Categories: Elsewhere

InternetDevels: Reasons to Upgrade Your Site From Drupal 6 to Drupal 7

Fri, 29/01/2016 - 16:05

We had a discussion in one of our previous blogs that Drupal 6 is “dead”,
however if you’re a site owner and still not sure whether you need Drupal 7,
we’ve prepared this article specifically for you.

Read more
Categories: Elsewhere

Pages