Planet Drupal

Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 5 hours 9 min ago

Freelock : Ask Freelock: What e-commerce platform would you recommend?

8 November 2016 - 4:41pm

Shan asks,

Hi folks- I am looking for an out of box eCommerce solution that meets the following criteria and hope to get some pointers on few solutions that's already available in the market.

Drupal 8Drupal CommerceE-CommerceDrupal Planet
Categories: Drupal

Aten Design Group: Create Comments in Drupal 8 Programmatically

8 November 2016 - 12:30pm

Creating comments programmatically in Drupal 8 is incredibly easy once you know just which fields are required and why. In Drupal 8, comments are now full-featured, fieldable entities — just like nodes or taxonomy terms. In addition to unifying the way we create content, comments, and other entities, this has made Drupal’s commenting system much more robust and flexible.

Recently, we needed to allow certain users to leave short notes about a node (almost like revision notes without the revisions). Only certain users would be able to leave these notes and the notes are added as part of a custom form. This meant that we needed to handle comment creation ourselves. After much googling, we finally figured out just how to create comments manually.

To create a new comment, you need to create a comment entity in code and then save it. There are a lot of required fields and we'll go over each one below. But first, here’s the code:

// To create a new comment entity, we'll need `use` (import) the Comment class. use Drupal\comment\Entity\Comment;   // The function name doesn't matter. Just put the the function body where you need it. function my_modules_function_or_method() {   // First, we need to create an array of field values for the comment. $values = [   // These values are for the entity that you're creating the comment for, not the comment itself. 'entity_type' => 'node', // required. 'entity_id' => 42, // required. 'field_name' => 'comment', // required.   // The user id of the comment's 'author'. Use 0 for the anonymous user. 'uid' => 0, // required.   // These values are for the comment itself. 'comment_type' => 'comment', // required. 'subject' => 'My Awesome Comment', // required. 'comment_body' => $body, // optional.   // Whether the comment is 'approved' or not. 'status' => 1, // optional. Defaults to 0. ];   // This will create an actual comment entity out of our field values. $comment = Comment::create($values);   // Last, we actually need to save the comment to the database. $comment->save(); }

The first three required fields are telling Drupal what entity the comment should be attached to.

  • entity_type: This is the entity to which you want to attach the comment. If you're creating a comment on an article or basic page, for example, this would be node.
  • entity_id: The id of the entity to which you want to attach the comment. If you're attaching to a node, this would be its nid.
  • field_name: The field on the entity to which this comment should be attached. Note: This is something new in Drupal 8. In D8, you can have multiple comment fields on an entity and those comments' fields can use different comment types. The default article content type is the only content type that comes with a comment field. If you want to enable comments on your own content type, you have to add your own comment field which receives a unique machine name. That machine name is the value you would put here.

The uid field tells Drupal which user authored the comment.

The remaining values are all specific to the comment itself.

  • comment_type: The type of comment to create. Note: This is new in Drupal 8 too. You can have different types of comments with completely different fields, just like nodes or taxonomy terms. Think of this as the comment "bundle" if you're familiar with that term. The default comment type is just comment.
  • subject: Every comment has a subject field, just like the title field on a node.
  • comment_body: This field is provided by default just like the body field on nodes. However, it can be removed like any other field.
  • status: Set this to 1 if you would like the comment to be automatically approved. Otherwise, an administrator will need to approve it.
  • field_foobar: This isn't in the example, but comment types can have custom fields just like any other content entity. If you have custom fields on your comment type, you can just use the field’s machine name and provide a default value here.
Categories: Drupal

qed42.com: New Module - AddToCalendar Drupal Integration

8 November 2016 - 10:03am
New Module - AddToCalendar Drupal Integration Body

Drupal sites with events functionality, often have to allow their users to export events in their personal calendars. On a recent Drupal 8 project we were asked to integrate 3rd party service Add to Calendar to their events and having found no formal integration of the widget with Drupal we developed and contributed this module. The widget provided by Add to calendar supports export of Dates / events to iCalender, Google Calendar, Outlook, Outlook Online and Yahoo Calendar.

  Why use Add To Calendar Service?
  • Add to Calendar Module provides a widget to export events.
  • With Add to Calendar Module, you can create event button on a page and allow guests to add this event to their calendar.
How Does Add to Calendar Module Works?

Add to Calendar Module provides third party field formatter settings for DateTime fields. Module internally uses services provided by http://addtocalendar.com to load free add to calendar button for event page on website and email. Clicking on this button, the event is exported to the corresponding website with proper information in the next tab where a user can add the event to their calendar. Besides, it provides a handful of configuration for a really flexible experience, Allowing you to use your datetime format along with Add to Calendar button.

Using Add to Calendar
  1. Download and enable Add to Calendar module (https://www.drupal.org/project/addtocalendar)

    • The module has both D8 and a backported D7 versions.

  2. Adding Add to Calendar button to any datetime field would require enabling “Show Add to Calendar” checkbox present at format configurations on Manage Display page of the desired content type.

 

  1. Following configurations are available:

Option Description Style Three basic styles are available: Basic, Blue and Glow Orange Display Text Text for the display button. Event Details Module provides you three options here. You may opt for static data, tokenized value or any field value, specific to the current entity. Privacy Use public for free access to event information while private if the event is closed to public access. Security Level To specify whether button link should use http or https Calendars to show Select Calendars to be enabled for the display.

4. Save the settings and visit content display page.

Developer Support

Devs have the option to add "Add to Calendar" button anywhere on the website by following below steps:

1. Include base library ('addtocalendar/base') for add to calendar basic functionality. Optionally, You may also one of the following style libraries for styling the display button:

  • 'addtocalendar/blue'
  • 'addtocalendar/glow_orange'
$variables['#attached']['library'][] = 'addtocalendar/base';

2. Place event data on the page as:

2016-05-04 12:00:00 2016-05-04 18:00:00 Europe/London Star Wars Day Party May the force be with you Tatooine Luke Skywalker luke@starwars.com

For further customization of this custom button visit: http://addtocalendar.com/ Event Data Options section.

3. This would create "Add to Calendar" button for your website.

 

PURUSHOTAM RAI Tue, 11/08/2016 - 23:33
Categories: Drupal

myDropWizard.com: Don't Leave Your Website Support & Maintenance to Junior Developers

8 November 2016 - 9:19am

In talking to Drupal shops and agency about how they do support, we've sometimes heard something like:

We have junior developers / paid interns handle one-off support and maintenance requests as a way to train them!

We provide white-label fixed-monthly-cost support for agencies, so I am a little biased. :-) But I used to run a small Drupal agency and I truly believe that there are a number of potential issues with this view.

From my perspective, certainly: IT IS NOT OK to leave support and maintenance to junior developers.

I'll try to give some detail to explain my viewpoint on this... Read on to learn more!

Categories: Drupal

J-P Stacey: Tutorials on the Drupal 8 APIs, collected

8 November 2016 - 8:59am

Recently I've been writing a number of blogpost tutorials about the Drupal 8 APIs. If you like, you can read all tutorials so far, collected and broken down by topic, roughly following the breakdown in the official documentation.

The tutorials have been written with a focus on achievable results, and with accompanying screenshots explaining what you should see if you work through the examples; like this one:

Read more of "Tutorials on the Drupal 8 APIs, collected"

Categories: Drupal

Drupal Association News: The future of Community Summit. Help drive us forward.

8 November 2016 - 7:58am

Come for the code, stay for the community. That’s the mantra of the Drupal community. It’s the reason many of us are here. It’s why we contribute in our spare time, spend our weekends organizing Drupal events, attend week-long DrupalCons. As a community we are continuing to grow and change, just like the project. DrupalCon programming should be changing too.

In particular, we at the Drupal Association want to make sure that the community programming at DrupalCons best serves the community it is made for. And that means that we need fresh voices, more support, and new ideas. We are asking for a new crop of community leaders and leading companies to step in and help us move community programming at DrupalCons forward.

How community programming got here:
Originally, community conversations at DrupalCon took place in sessions for the community track, running alongside all the other content at DrupalCons. The community track allowed for presentations on topics related to our community and although it was valuable to raise the topics, there were concerns that the session format made it difficult to continue the momentum after the Con. Further, the community track was not well attended.

At DrupalCon Prague in 2013, we launched the first Community Summit, a day-long event, on the Monday of DrupalCon week. Morten DK, Addison Berry, and others (thank you all - you have been great collaborators) ran the program and led a number of very useful conversations.

At the past few DrupalCons, Donna Benjamin has stepped up to lead unconference-style Community Summits open to anyone who wants to join, contribute to, or lead a local community. Through the unconference format, the Summit has been able to foster conversations about nonviolent communication, camp budgeting, public speaking, local community activities and more. Unfortunately, unconferences seem to stop once the Summit is over, and continuing conversations and action plans prove difficult with a community spread across the world.

Where is community programming headed?
As we continue to grow as a project and community, we recognize that we need to make sure we have the right format and space for our community to continue to grow and learn from each other.
Community programming needs some new faces to help move us forward into a world of Drupal 8, new camps, project-wide discussions, etc. We are a community full of incredible leaders and we are putting out a call for some of you to stand up and help us design the future for our community.

Community programming also needs a fiscal champion - a sponsor who fully recognizes the importance of investing in our community. Our community leaders are volunteers and e want to minimise barriers for participation. To date, the Community Summit has been free to attend. We’d like to keep it that way. But we’d like to provide attendees with lunch, and workshop tools like post-it notes, markers and flipcharts. Because we offer the Summit at no cost, we have needed to limit the space available which has meant it has booked up early, and many who would have liked to attend, have missed out.

We need you to contribute to community programming
We need you. And we are asking - can you contribute? We would love a team of community organizers to work with the Drupal Association on community programming at DrupalCon Baltimore and beyond. We need a sponsor or two to financially support the Community Summit and allow us to continue to grow it.

We are close to finalizing our space at the Baltimore Convention Center and are also nearing our online registration launch. We need to determine what the Community Summit will be so we can allocate the appropriate space and include tickets on our website. If you can help, take action now by contacting us at the Drupal Association before November 21, 2016. There are a few ways to get involved:

Are we supporting new initiatives like Drupal Diversity in the best way that we can? Are we providing our Camp Organizers with the opportunity to convene and share tips and tricks to running amazing camps around the globe? What other programming can we be providing?  Comment below to let us know what you’d like to see from community programming at DrupalCons.

Thank you for your endless support of this amazing community.

Categories: Drupal

groups.drupal.org frontpage posts: [DCMuc16] Can you smell the gingerbread and hot spiced wine? DrupalCamp Munich 2016 is coming

8 November 2016 - 7:41am

Hey Drupalistas!
We are just a few blinks away from the DrupalCamp Munich 2016 (31.11.-02.12.2016 CodeSprints @ Burda Media // 03.12.-04.12.2016 DrupalCamp @LMU Munich). As you know, this is our 2nd Camp after the great (and 1st) DrupalDevDays in 2010, and we think we will be great hosts again.

So, it's your part to submit your session prosposals until 14th of november and to be part of the special spirit of a camp with friends, Drupal, PHP, Symfony, beer, a lot of socializing, food, another beer, coffee, code sprints, very special welcome-bags, ...
We are thankful of our sponsors so we have a special prizing for students and WWCode. Please contact us for further information.
We look forward to seeing you at DrupalCamp Munich 2016 and to drinking a mug or two of "Gluhwein" or bavarian beer together.

Greetings from our Team

AttachmentSize ankuendigung_v02.jpg359.83 KB
Categories: Drupal

InternetDevels: Bootstrap for Drupal: how to create a subtheme in Drupal 8

8 November 2016 - 7:15am

Here goes another Drupal 8 post by one of our Drupal developers!

Read more
Categories: Drupal

Drupalize.Me: Our Development Workflow and Pantheon Multidev

8 November 2016 - 5:29am

When we were considering switching to the Pantheon hosting platform, one of the features that made us confident in our decision is what they call Multidev.

At its core, Multidev is just a method of spinning up complete environments for code that hasn't yet been merged into the main development branch. The main benefit to this is that it makes it incredibly easy to build a complete website environment that parallels your live site where any team member can functionally and visually test changes before they're fully merged.

This blog post covers the Drupalize.Me team's development workflow, and how we're using Pantheon's Multidev to be more efficient.

Categories: Drupal

Dries Buytaert: A plan for media management in Drupal 8

8 November 2016 - 1:23am

Today, when you install Drupal 8.2, the out-of-the-box media handling is very basic. For example, you can upload and insert images in posts using a WYSIWYG editor, but there is no way to reuse files across posts, there is no built-in media manager, no support for "remote media" such as YouTube videos or tweets, etc. While all of these media features can be added using contributed modules, it is not ideal.

This was validated by my "State of Drupal 2016 survey" which 2,900 people participated in; the top two requested features for the content creator persona are richer image and media integration and digital asset management (see slide 44 of my DrupalCon New Orleans presentation).

This led me to propose a "media initiative" for Drupal 8 at DrupalCon New Orleans. Since then a dedicated group of people worked on a plan for the Drupal 8 media initiative. I'm happy to share that we now have good alignment for that initiative. We want to provide extensible base functionality for media handling in core that supports the reuse of media assets, media browsing, and remote media, and that can be cleanly extended by contributed modules for various additional functionality and integrations. That is a mouthful so in this blog post, I'll discuss the problem we're trying to solve and how we hope to address that in Drupal 8.

Problem statement

While Drupal core provides basic media capabilities, contributed modules have to be used to meet the media management requirements of most websites. These contributed modules are powerful — look at Drupal's massive adoption in the media and entertainment market — but they are also not without some challenges.

First, it is hard for end-users to figure out what combination of modules to use. Even after the right modules are selected, the installation and configuration of various modules can be daunting. Fortunately, there are a number of Drupal distributions that select and configure various contributed modules to offer better out-of-the-box experience for media handling. Acquia maintains the Lightning distribution as a general purpose set of components including media best practices. Hubert Burda Media built the Thunder distribution and offers publishers strong media management capabilities. MD Systems created the NP8 distribution for news publishers which also bundles strong media features. While I'm a big believer in Drupal distributions, the vast majority of Drupal sites are not built with one of these distributions. Incorporating some of these media best practices in core would make them available to all end-users.

Second, the current situation is not ideal for module developers either. Competing solutions and architectures exist for how to store media data and how to display a library of the available media assets. The lack of standardization means that developers who build and maintain media-related modules must decide which of the competing approaches to integrate with, or spend time and effort integrating with all of them.

The current plan

In a way, Drupal's media management today is comparable to the state of multilingual in Drupal 7; it took 22 or more contributed modules to make Drupal 7 truly multilingual and some of those provided conflicting solutions. Multilingual in Drupal 7 was challenging for both end-users and developers. We fixed that in Drupal 8 by adding a base layer of services in Drupal 8 core, while contributed modules still cover the more complex scenarios. That is exactly what we hope to do with media in a future version of Drupal 8.

The plan for the Drupal 8 media initiative is to provide extensible base functionality for media handling in core that supports the reuse of media assets, media browsing, and remote media, and that can be cleanly extended by contributed modules for various additional functionality and integrations.

In order to do so, we're introducing a media entity type which supports plugins for various media types. We're currently aiming to support images and YouTube videos in core, while contributed modules will continue to provide more, like audio, Facebook, Twitter, etc. To facilitate media reuse, WYSIWYG image embedding will be rebuilt using media entities and a media library will be included to allow selecting from pre-existing media.

We consider this functionality to be the minimum viable product for media in Drupal 8 core. The objective is to provide a simple media solution to make Drupal 8 easy to use out of the box for basic use cases. This would help users of sites large and small.

A work-in-progress prototype of the proposed media library. Expected timeline and call for help

We believe this could be achieved in a relatively short time — to be included in Drupal 8.3 or Drupal 8.4 as experimental modules. To help make this happen, we are looking for organizations to help fund two dedicated code sprints. The existing contributors are doing an amazing job but dedicated in-person sprints would go a long way to make the plans actually happen. If you are willing to help fund this project, let me know! Looking to help with the implementation itself? The media team meets at 2pm UTC every Wednesday. I also recommend you follow @drupalmedia for updates.

I tried to make a list of all people and organizations to thank for their work on the media initiative but couldn't. The Drupal 8 initiative borrows heavily from years of hard work and learnings on media related modules from many people and organizations. In addition, there are many people actively working on various aspects of the Drupal 8 media initiative. Special thanks to everyone who has contributed now and in the past. Also thank you to Gábor Hojtsy, Alex Bronstein and Janez Urevc for their contributions to this blog post.

Categories: Drupal

MD Systems blog: NP8 and Woodwing Content Station together support content creation process at Netzmedien

8 November 2016 - 12:41am
In the last two months we released four portals for the Swiss tech publisher Netzmedien. All four websites are driven by the NP8 media distribution and their content is created and curated via Woodwing, a centralized multi-channel publishing platform.
Categories: Drupal

Pages