Planet Drupal

Subscribe to flux Planet Drupal - aggregated feeds in category Planet Drupal
Mis à jour : il y a 50 min 7 sec

Chen Hui Jing: Drupal 101: Creating custom content with Panels

lun, 23/03/2015 - 01:00

If you ever find yourself needing to create a static page in Drupal, perhaps for a temporary landing page or an under-construction page, while the site is being fleshed out behind the scenes, an option to consider is via Panels. I was in the process of building the DrupalCamp Singapore 2014 website and needed to put up a temporary home page. Using Panels gave me the option of hand-coding the HTML for the page. To do this, you will also need to install the Chaos tools suite (ctools).

  1. Enable the Panels, Chaos tools and Page manager (comes with ctools) modules.

    drush en panels ctools page_manager -y
  2. Once all the required modules are...
Catégories: Elsewhere frontpage posts: Registration is Live for Drupal Dev Day NYC 2015! (#D3nyc15)

dim, 22/03/2015 - 20:20
Start:  2015-04-19 09:00 - 17:00 America/New_York Drupalcamp or Regional Summit Organizers:  joebachana richbaldwin mdorman amycham forestmars

Registration is now up for D3NYC15, to be held Sunday, April 19th at John Jay College in Midtown Manhattan. To reserve your seat, follow this link:

The camp website may be found at

Drupal Dev Day NYC 2015 will be a free, full-day Drupal unconference and Drupal 8 sprint event. All skill levels are welcome at Drupal Dev Day NYC 2015. The content is determined by attendees at the beginning of the day, but you can expect to find sessions and conversations on topics ranging from the most basic to advanced.

Among the exciting details of the camp include:
• Morning coffee, bagels and a schmear (wouldn't be a NYC camp without 'em!)
• Beginning Drupal training presented by Bleen!
• A Drupal Ladder/mentoring room, where you can get your environment set up and learn to code for Drupal
• Drupal 8 codesprints
• Sessions all day, picked by us all and presented by drupalists among us or collaboratively in BoF format.

If you are an organization interested in helping to sponsor this event, please contact Matt Dorman (mdorman) for more details, or you can go to the registration page and select your level of sponsorship commitment. Thank you in advance!

For those people interested in volunteering on the day of the event, please ping Joe Bachana (joe@bachana) or post a comment to this event page.

Watch this Event page and follow @DrupalNYC ( on Twitter or our Facebook page ( for the latest updates!

Catégories: Elsewhere

DrupalOnWindows: Deploying changing module dependencies with Drupal

dim, 22/03/2015 - 06:00
Language English

Deployments are often one of the most important aspects of the Drupal development cycle. But sometimes, due to time and/or budget constraints (or the maturity of your company) developers clone databases downstream, manually reproduce content on production environments, and rely on other bad practices on a regular basis.

Today we will show you how we manage small (but critical) changes in module dependencies for our custom modules here at

More articles...
Catégories: Elsewhere

Midwestern Mac, LLC: Ansible + Drupal + Raspberry Pi Dramble - Presentation at MidCamp 2015

dim, 22/03/2015 - 00:00

Earlier today, I gave a presentation on Ansible and Drupal 8 at MidCamp in Chicago. In the presentation, I introduced Ansible, then deployed and updated a Drupal 8 site on a cluster of 6 Raspberry Pi computers, nicknamed the Dramble.

My slides from the presentation are embedded below, and I'll be posting a video of the presentation as soon as it's available.

Catégories: Elsewhere

KatteKrab: A more accessible online world will benefit everyone.

sam, 21/03/2015 - 22:37
Sunday, March 22, 2015 - 08:37

PSA: If you are a web professional, work in a digital agency or build mobile apps, please read this article now: Taking the social model of disability online

Done? Great.

"The social model of disability reframes discussion of disability as a problem of the world, rather than of the individual. The stairs at the train station are the problem, rather than using a wheelchair."

El Gibbs has reminded me of question time during Gian Wild's keynote at Drupal Downunder in 2012. Gian asserts that accessibility guidelines are a legal requirement for everyone, not just Government. There was an audible gasp from the audience.

It's true that our physical environment needs to include ramps, lifts, accessible toilets, reserved parking spaces, etc in order to accommodate those with mobility needs. Multi-lingual societies require multi-lingual signage. There are hearing loops - but for some reason, this "social model" of accessibility doesn't seem to have extended online.

Making the digital world accessible, and counteracting the systemic discriminatory impact of failing to do so is something we must take seriously. We must build this in during planning and design, we must make it easy for content editors to maintain WCAG compliance AFTER a site or app is delivered.

Building accessibility features in from the beginning also means it costs less to implement, and delivers a double win of making the whole team more mindful of these issues to begin with. It should be part of the acceptance criteria, it should be part of the definition of done.

I'd like to see us tackle these issues directly in Drupal core. If you're interested in keeping track of accessibility issues in Drupal, you might like to follow drupala11y on twitter, and check out issues on that have been tagged with "accessibility"

Accessibility traps might not affect you now, but they will. This is probably affecting people you know right now. People who silently struggle with small font sizes, poor contrast, cognitive load, keyboard traps, video without captions. 

My own eyesight and hearing is not what it was.  My once able parents now require mobility aids. My cousin requires an electric wheelchair. A friend uses a braille reader, and yet I still forget.  It's not front and centre for me, but it should be. Let's all take a moment to think about how we can focus on making our online and digital world more accessible for everyone. It really does benefit us all.

Catégories: Elsewhere

Midwestern Mac, LLC: Camp Organizers BoF at MidCamp 2015

sam, 21/03/2015 - 19:37

On March 21, 2015, there was a fairly well-attended Camp Organizers BoF at MidCamp in Chicago. I took notes during the BoF and am simply publishing them here for the benefit of camp organizers in the Drupal Community. They're fairly raw, but hopefully they'll be helpful for you!

Catégories: Elsewhere

Red Crackle: Drupal Testing Methodologies Are Broken - Here's Why

ven, 20/03/2015 - 18:01
Currently available Drupal testing methodologies are broken. They are nowhere close to being enterprise-ready. All Drupal developers who have worked on long-term projects have felt this pain. Yes, Drupal 7 ships with Simpletest module but it has two problems: (1) Drupal 7 is not unit-test friendly, and (2) Simpletest module requires reconfiguring the site from scratch. Any Drupal developer who wants to test Drupal today is using functional testing tools such as BDD, Sahi or Selenium. But because of the need to bootstrap Drupal, functional testing still takes a long time to complete. What is needed is an integration testing framework that doesn't bootstrap Drupal on every request and which makes it easy for developers to write and maintain tests. Red Crackle has developed such a framework specifically for testing Drupal. It understands Drupal so that all the mundane tasks of setting up test objects is done automatically in background and the developer just has to concentrate on writing business logic of the test.
Catégories: Elsewhere

SitePoint PHP Drupal: First Look at – a Development and Deployment SaaS

ven, 20/03/2015 - 17:00

Not so long ago, many of us were satisfied handling deployment of our projects by uploading files via FTP to a web server. I was doing it myself until relatively recently and still do on occasion (don’t tell anyone!). At some point in the past few years, demand for the services and features offered by web applications rose, team sizes grew and rapid iteration became the norm. The old methods for deploying became unstable, unreliable and (generally) untrusted.

So was born a new wave of tools, services and workflows designed to simplify the process of deploying complex web applications, along with a plethora of accompanying commercial services. Generally, they offer an integrated toolset for version control, hosting, performance and security at a competitive price. is a newer player on the market, built by the team at Commerce Guys, who are better known for their Drupal eCommerce solutions. Initially, the service only supported Drupal based hosting and deployment, but it has rapidly added support for Symfony, Wordpress, Zend and ‘pure’ PHP, with node.js, Python and Ruby coming soon.

It follows the microservice architecture concept and offers an increasing amount of server, performance and profiling options to add and remove from your application stack with ease.

I tend to find these services make far more sense with a simple example. I will use a Drupal platform as it’s what I’m most familiar with. has a couple of requirements that vary for each platform. In Drupal’s case they are:

  • An id_rsa public/private key pair
  • Git
  • Composer
  • The CLI
  • Drush

I won’t cover installing these here; more details can be found in the documentation section.

I had a couple of test platforms created for me by the team, and for the sake of this example, we can treat these as my workplace adding me to some new projects I need to work on. I can see these listed by issuing the platform project:list command inside my preferred working directory.

Continue reading %First Look at – a Development and Deployment SaaS%

Catégories: Elsewhere

Victor Kane: Why won't anyone listen to Nedjo?

ven, 20/03/2015 - 16:45
When he says the Drupal 8 Configuration Management system is only listening to one use case?

One reason no-one listens to Nedjo Rogers on this subject is that what he's saying is not that simple to understand. But I assure you it's well worth the effort. He's saying that the Drupal 8 Configuration Management system is built around a single use case that favors a certain enterprise need, namely that of single site configuration stabilization and propagation to other environments, principally live.

In his initial article on this subject (Bibliography #4, Nedjo Rogers) Nedjo wrote that the fact that “Sites own their configuration, not modules” (as stated in Bibliography #3, Alex Pott) constitutes nothing less than “a seismic shift in Drupal that's mostly slipped under the radar”. Nedjo first reviews the history of exportable configuration in Drupal, and correctly highlights the fact that there are two main use cases involved:

  • To share and distribute configuration among multiple sites.

  • To move configuration between multiple versions of a single site.

“By and large, the two use cases serve different types of users. Sharing configuration among multiple sites is of greatest benefit to smaller, lower resourced groups, who are happy to get the benefits of expertly developed configuration improvements, whether through individual modules or through Drupal distributions. Moving configuration between different instances of the same site fits the workflow of larger and enterprise users, where configuration changes are carefully planned, managed, and staged....”

“If anything, the multiple site use case was a driving force behind the development and management of configuration exports. The Features module and associated projects - Strongarm, Context, and so on - developed configuration exporting solutions specifically for supporting distributions, in which configuration would be shared and updated among tens or hundreds or thousands of sites.”

“For Drupal 8, however, the entire approach to configuration was rewritten with one use case primarily in mind: staging and deployment. The confiugration system "allows you to deploy a configuration from one environment to another, provided they are the same site."

If this is the case, then we really need to get to the bottom of this issue. The objective of this article is to briefly summarize the whole debate (see Bibliography), remove any items that are blurring or clouding the issue, and then underline three times those points that really deserve not being kept “off the radar” and which I hope others will delve into so that we can get a clear picture of perspectives and solutions (many of which Nedjo himself, and others, are spearheading already in third party modules; see below). It's an important question: what's in store for us in terms of industry-wide best practices for Configuration Management in Drupal 8, taking into account all important use cases? And it's a question that Nedjo took the trouble to raise in the Drupal Community as far back as January, 2012. But no-one listened.

read more

Catégories: Elsewhere

Phase2: Accelerating with Drupal 8

ven, 20/03/2015 - 16:09

Today is an exciting day for the Drupal community! Collectively, we’re all moving a few steps closer to a full release of Drupal 8 with the help of a program called Drupal 8 Accelerate. This is a pilot program from the Drupal Association designed to put $250,000 of community funds towards eliminating the last 50 critical issues between us and release.

The Drupal Association has been an incredible leader in the effort to release Drupal 8, pledging to set aside $62,500 to match every dollar donated to the provide Drupal 8 Acceleration Grants.

What’s the latest with Drupal 8 Accelerate?

But we knew we could do even more to turbocharge this project. Today we are announcing that D8 Accelerate is now getting a huge boost from seven anchor sponsors, who have pledged to “match the match,” amplifying every donation made and accelerating the community’s investment in Drupal 8.

Phase2, Acquia, Appnovation, Lullabot, Palantir, PreviousNext, and Wunderkraut have collectively pledged another $62,500 to match the Drupal Association’s matches of community donations. This is an all-out, everyone-in community effort to move D8 from beta to release. Our goal is to bring the total to $250,000 available for grants by September. We are now more than half way there.

Why should we all want Drupal 8 to succeed?

The answer is simple: D8 will empower us to use Drupal the way many of us have wanted to for a long time. D8 improves the API layer, multi-lingual capabilities, theming and the editor experience. It also makes is much more powerful for developers (which matters a lot to us at Phase2).

Historically, it has been a challenge to integrate new libraries or different front-end elements without a lot of leg work. Imagine, for example, how the availability of Twig theming will enhance your projects. Or how flexible implementations can be with dependencies on meaningful external software integrated through Symfony routing. We will even be able to more seamlessly incorporate mobile apps into the digital strategies we develop, correcting one of the main weak points of previous Drupal releases.

Put simply, Drupal 8 is a win for our collective clients, and therefore it is a win for all of us.

Phase2 & Drupal 8

At Phase2, we want Drupal 8 to succeed because our clients have increasingly big needs and major challenges, and we believe that Drupal 8 is moving in the direction to address those. For that reason, we’ve made investing in Drupal 8 a priority, not only by way of the Drupal 8 Accelerate program, but also in the form of contributed code and shared knowledge gleaned from major enterprise Drupal 8 implementations.

Taking on early Drupal 8 implementations enables us to commit our people to the D8 cause, while directly supporting our client’s mission. It also provides us with a group of advanced scouts to report back from the front lines and develop training for the rest of our team.

Principle among these scouts was Software Architect Jonathan Hedstrom, whose contributions to D8 include Drush support, core patch reviewing, testing and re-rolling, writing tests, modules upgrades (Redis), and more. In addition to Jonathan, Senior Developer Brad Wade made important front-end contributions, while Software Architect Mike Potter has been a significant part of Features development.

We’ll be sharing a lot of what we learned from our D8 work so far at DrupalCon Los Angeles, so stay tuned for our session announcements next!

 An all-out, everyone-in effort

It took the whole Drupal community – including individuals, companies, the Drupal Association – to get D8 to the place it is now. We are honored to have contributed alongside everyone involved. It has certainly been a heavy lift for many community members, so to each of these people and organizations, we say thank you. The success of Drupal 8 is the most important priority of our community.

However, Drupal 8 still needs a strong push to get over the finish line. So we must ask one more time for the support of our fellow Drupalers. We all have a major stake in the success of the project, and everyone can play an instrumental role getting it out the door. Even the smallest donation makes a difference when every dollar you donate is now matched, compounding your impact. You can read more about how the funds actually support the grant program to achieve the work on the Drupal Association D8 Accelerate page.

If you would like to donate, please visit the D8 Accelerate Fundraising site and please consider using my profile as a way to easily make your contribution so we can start enjoying those launch parties!

Catégories: Elsewhere

Drupal Association News: Ready, Set, Drupal 8! D8 Accelerate Fundraiser

ven, 20/03/2015 - 15:59

Last November we launched Drupal 8 Accelerate, a grant program designed to eliminate Drupal 8 release blockers. Through the progam, we’ve made a small number of grants that have had a huge impact. In fact, we only have about 50 release blockers left between us and release. So now the Association is going to take it to the next level. We've already pledged $62,500 of our general operating budget in 2015 as matching funds for you donations. Now we are announcing that the board has partnered with 7 outstanding community supporters to “match the match” and provide another $62,500 of the program, bringing us to $125,000 available for grants.

Now it's your turn! We're asking you to help us raise another $125,000 to make the total amount available for these grants $250,000. You can give knowing that every dollar you contribute is already matched by the Association and these anchor donors, doubling your impact. Your donations will allow us to make more grants, faster, increasing our impact and getting D8 out the door!

This is an all-out, everyone-in effort to raise $250,000 to kill the last release blockers in our way.This is our moment - together, we are going to move Drupal 8 from beta to release with the Drupal 8 Accelerate program. We already know it works. Drupal 8 Accelerate grants have already tackled release blockers issues related to menus, entity field validation, and caching. As a donor, you will always know exactly what you're funding because we're making it all public

Join us today and make your donation. The sooner we get this done, the sooner we can all enjoy those launch parties!

Special thanks to our anchor donors, Acquia, Appnovation, Lullabot,, Phase2, PreviousNext, and Wunderkraut, for making this matching campaign possible.  These seven organizations stepped up to the plate and made this entire campaign possible. Thank them on Twitter using the #D8Accelerate hashtag.

The D8 Accelerate project is designed to help move Drupal 8 from the initial beta to a full release. This directly relates to the Association's mission: uniting a global open source community to build and promote Drupal. This is a pilot program from the Drupal Association to put $250,000 of community funds toward accelerating the release of Drupal 8, due to the strategic impact this work has on the entire Drupal ecosystem.

Catégories: Elsewhere

Darren Mothersele: Introducing Stylex: Atomic design, style guides, and prototyping with Silex and Twig

ven, 20/03/2015 - 01:00

I've been working a lot with Atomic design (component-based design) with Drupal recently, and I've witnessed huge improvements on projects where it has been introduced. The main advantage being the decoupling of the development of the back-end from the development of the front-end code.

I've covered this in more detail previously, I'm running some workshops on Atomic Design in Drupal, and I have more to say on this in the future. Today I want to tell you about a simple tool I'm using to speed up the process.

The main purpose of this tool is to simplify the construction of prototype sites or style guides for front-end code. There are several tools already available, including the excellent Pattern Lab, but I wanted something incredibly simple.

I basically just wanted to make use of the power of Twig templates for mocking up front-end code, with an easy way to load in demo content (from yml files).

 Barebones project

I've created a barebones Stylex project on GitHub that demonstrates this, but you probably want to follow along in the setup, so you know what's going on...

Basic setup

I've packaged this for Composer so getting started is easy. Assuming you already have Composer installed globally all you need to do is create a folder for your project and run the following command:

composer require darrenmothersele/stylex dev-master

This will download Stylex from Github and all the dependencies. It creates the composer.json file for you and downloads all the code for the dependencies into a vendor folder.

As a bare minimum you will need to create a index.php to run the application, and a starter template templates/index.html.

Create a file in the project root (same location as the generated composer.json file) called index.php with the following code:

<?php require_once __DIR__ . '/vendor/autoload.php'; $app = new Stylex\Application(); $app->run();

Then create a templates folder and create the first page template, templates/index.html in this folder:

<html> <head> <title>Hello!</title> </head> <body> {% block content %} <h1>Hello, world!</h1> {% endblock %} </body> </html>

You can run the application with PHP's build in web server. Simply run the following command:

php -S localhost:8000

Now, browse to http://localhost:8000 to see the website.

Adding pages

You can add more pages, and make use of Twig's awesome template inheritance feature. For example, to create an 'About us' page, create a new file in the templates folder called about.html with the following content:

{% extends 'index.html' %} {% block content %} <h1>About us</h1> {% endblock %}

This inherits the whole template from index.html but replaces the content block with a new block of content specific to this page. Browse to http://localhost:8000/about to see the result (make sure PHP's web server is running - see above).

Using data

You can create YAML data files and then use them in your templates. Create a folder called data and then add *.yml files with your data. In any template these are then available using the filename. For example, to create a data file for your navigation links, create a file called data/main_menu.yml with the following content:

- title: Home path: / - title: About Us path: /about

Because the filename is main_menu.yml this data is now available to read in template files using {{ main_menu }}. Let's add a component template to style the menu. See my posts on Atomic design in Drupal to find out more about component templates. For now, just create a file in templates/components/menu.html with the following content:

<ul> {% for item in main_menu %} <li> <a href="{{ item.path }}">{{ item.title }}</a> </li> {% endfor %} </ul>

Now you can include the menu in your page template, by adding the following to your index.html file:

{% include 'components/menu.html' %} Using sample content

Stylex supports creating sample content using Markdown format with YAML front matter. This is a simple way to manage blobs of content with associated metadata. By using Markdown and YAML together to create sample content you can keep the sample content out of your front-end mockups and prototypes. This is another useful decoupling that makes life easier.

In this approach sample content is stored in subfolders under a content folder. You can have multiple types of content, and organise them into subfolders under a main content folder. Let's create a first article as an example. First create your content and then content/articles folder, then create a sample file called content/articles/ with the following content:

--- title: My First Post excerpt: Lorem ipsum dolor sit amet, consectetur adipisicing elit. image: --- Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptas ipsam veritatis officia unde incidunt doloribus veniam eligendi ea maiores delectus excepturi aspernatur illum, voluptates quas odit harum cupiditate cum maxime...

See the Stylex Barebones for the full example, I've abbreviated the content here. The main point is to show how you can include YAML metadata above the main Markdown formatted content.

You can then reference this content from your templates. For example, to print out the title of that first post you created, use the following in your Twig template:

{{ content.articles.first_post.title }}

Or, more useful, print out the titles of all articles:

{% for post in content.articles %} <h2>{{ post.title }}</h2> {% endfor %}

Or, yet even more useful (if you're building an atomic design), output all the articles using a component template:

{% for post in content.articles %} {% include 'components/teaser.html' with post only %} {% endfor %}

For this to work, create a component template for the teaser by creating a templates/components/teaser.html file with the following content:

<div class="teaser"> <h2 class="teaser-title"> {{ title }} </h2> <img src="{{ image }}" alt="" class="teaser-image"> {{ content|raw }} </div>

You can create subfolders to organise different types of sample content, for example, add an events folder content/events and they will be available in your templates as {{ }}


If you're getting error messages, you can turn on debugging. In the index.php file that you created simple add the following line before $app->run();

$app['debug'] = TRUE; Conclusion

This just does the basics to allow you to use Twig templates to quickly build out front-end code. It reads in sample content and data from yml files and allows you to easily combine them with template files to create a prototype site.

The next step is to reset Drupal's markup and get it generating the exact same markup. This is covered more in my Atomic Design in Drupal workshops.

You'll probably want to add your favourite front-end tools into this. In particular, I like to add a Gruntfile to do less/sass compilation, etc.

Drop me a line if you find this useful, or have any ideas for how it can be improved.



Catégories: Elsewhere

Code Karate: Creating a hierarchy of users with the Drupal Subuser module

ven, 20/03/2015 - 00:57
Episode Number: 198

In this episode we cover the Drupal Subuser module. This module makes it easy to allow your users to manage other users on your site. This works great if you want to allow a site manager to be able to add in users of a specific role, but not have access to the full Drupal User Administration pages.

Tags: DrupalDrupal 7Site BuildingDrupal Planet
Catégories: Elsewhere

Drupal core announcements: Propsed policy: Re-activate the head2head project and use it for D8 beta-to-beta upgrades in the short-term

jeu, 19/03/2015 - 22:37

In order to support a beta-to-beta upgrade path for Drupal 8 users sooner, the core committers have posted a proposal that recommends re-activating the project in contrib and building the beta-to-beta upgrade path there in the short-term. This allows early adopters to have access to an upgrade path much earlier than core would be able to provide, and also gives us a "safe space" to test beta-to-beta upgrades prior to supporting them formally in core, without slowing down our current velocity on critical issue fixing.

Please share your thoughts, especially if you're one of the adventurous early adopters who are actively building on Drupal 8 already!

Catégories: Elsewhere

Shomeya: All about that trace, 'bout that trace

jeu, 19/03/2015 - 17:25

No one likes debugging code when it breaks and you can't figure out why it's broken. That piece of code might have been hard enough to write in the first place, or maybe it's a snippet that "should work" from a coworker, or maybe the documentation is missing, or maybe.... But what if you've checked, double and triple checked, and it's still not your code, it's something else in the system – code you're calling out to, or something that is calling your code – what do you do then?

Enter the backtrace, (also known as stack trace, or just trace). A powerful weapon in any software developers toolkit, it is more and more useful as the software you develop grows in complexity (Drupal 8 anyone?)

Read more
Catégories: Elsewhere

Drupal Easy: Book Review: Programming Guide to Drupal

jeu, 19/03/2015 - 16:20

O'Reilly's Programmer's Guide to Drupal, written by Jennifer Hodgdon is a solid book for Drupal developers of all skill levels. I'd argue that it is one of the better books for PHP developers wanting to learn more about Drupal. It provides a wealth of solid information on a nice array of topics that professional Drupal developers should know. It's not a long read (less than 100 pages of actual content), but the structure and variety of topics covered makes it a great reference for best practices and intermediate to advanced "what's the best way to do this?" topics in Drupal development.


read more

Catégories: Elsewhere

Drupal Watchdog: Painless User Docs

jeu, 19/03/2015 - 15:21

User documentation is a tricky thing to manage. On the one hand, docs are invaluable to your clients. But on the other, keeping “Write User Manual” at the top of your priority list is next to impossible, especially as you approach your go-live date.

The secret to squeezing good user docs into your schedule is to approach them the same way you would any other deliverable: create as little as possible from scratch by building on work you’ve already done, keep your users in mind at all times, and work efficiently.

That all sounds pretty familiar, right? Let’s talk about how to adapt these practices to user documentation.

Build a Template

Every site you build is different and requires a tailored set of docs. But that doesn’t mean you should be writing documentation from scratch each time. Instead, take a few hours to pull together a docs template. Working from a template can take the documentation process from a long, painful slog at deadline-time to a set of manageable little writing sprints, spread out over the entire development process.

Where to start?

First, pull together the elements that will appear in every user manual, for example, a general introduction to Drupal. Include chapters that cover the steps in content creation, an overview of the administrative menus, and a layman’s definition of things like nodes, blocks, and views. All these chapters will remain virtually untouched, from one site to the next, saving countless hours of writing.

As you build out the framework for your docs, keep your content as modular as possible. Creating self-contained chunks does two things for you: it makes it easy to rearrange sections from one manual to the next – without extensive rewrites – plus, it helps you keep track of what content needs updating and what doesn’t.

Once you’ve got the basics covered and the overall structure of your template worked out, writing your docs will be a simple matter of filling in details. If you write up features and functionality as they are being built, by the time you’re in the deadline crunch, your docs will be 90 percent complete.

Catégories: Elsewhere

Cheppers blog: Rebuilding the Cheppers website with Drupal 8: On The Road

jeu, 19/03/2015 - 11:59

The Cheppers team has decided to make our new website with Drupal 8. You can read about how and why we made this decision here. The following series of posts will document our progress, share the important lessons we learn, and highlight any mistakes we make in order to help others as they set out to use Drupal 8. This post will focus on exporting and importing site configuration.

Catégories: Elsewhere

KnackForge: Programmatically create a node in drupal 7

jeu, 19/03/2015 - 10:17

Steps for programmatically creating node in drupal7,
1. Create a new node object.
2. Save the object using the node_save() function.

Basic Node Creation :

$complaint_body = 'Your node complaint body text'; $node = new stdClass();  // Create a new node object $node->type = 'company';  // Content type $node->language = LANGUAGE_NONE;  // Or e.g. 'en' if locale is enabled node_object_prepare($node);  //Set some default values $node->title = 'Your node title'; $node->body[$node->language][0]['value'] = $complaint_body; $node->body[$node->language][0]['summary'] = text_summary($complaint_body); $node->body[$node->language][0]['format'] = 'full_html'; $node->status = 1;   // (1 or 0): published or unpublished $node->promote = 0;  // (1 or 0): promoted to front page or not $node->sticky = 0;  // (1 or 0): sticky at top of lists or not $node->comment = 1;  // 2 = comments open, 1 = comments closed, 0 = comments hidden // Add author of the node $node->uid = 1; // Set created date $node->date = 'complaint_post_date'; $node->created = strtotime('complaint_post_date'); $path = 'content/mytest-' . date('YmdHis'); $node->path = array('alias' => $path); // Save the node node_save($node);

Add custom fields

Catégories: Elsewhere

KnackForge: Hide and override drupal status messages

jeu, 19/03/2015 - 10:17

      This blog describes how to hide and override drupal status messages while creating and editing nodes.

      When you create or edit the nodes, drupal displays status messages like 'node has been created' and 'node has been updated'. Some may not be interested to view these messages. You can hide these messages using drupal_get_messages(). It returns all messages that have been set using drupal_set_message(). You need to add it to a custom submit handler for the corresponding form. You can add custom submit handler using either hook_form_alter() or hook_form_form_id_alter() in drupal. 

       To hide drupal status messages, use the code below. For example, i have hidden the status messages only for article node form.

<?php /** * Implement hook_form_alter() */ function kf_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'article_node_form') { // to add custom submit handler $form['actions']['submit']['#submit'][] = 'kf_article_form_submit'; } } /** * Implement kf_article_form_submit */ function kf_article_form_submit($form, &$form_state) { // to hide drupal status messages drupal_get_messages('status'); } ?>

       Similarly you can override these status messages. For that, you need to add messages after drupal_get_messages() in the custom submit handler.

Catégories: Elsewhere