Здравей Гост ! Регистрирай се и влез .

Навигация на книгата

Последни коментари

Кой е онлайн

В момента са 0 потребители и 0 гости online.

Гласуване

Колко тестови Друпал сайта имате?
1-5 бр.
61%
5-10 бр.
16%
10-15 бр.
8%
15-20 бр.
3%
20-30 бр.
3%
30-40 бр.
3%
40-50 бр.
3%
над 50 бр.
5%
Общо гласове: 38

Разпространи

Разпространи съдържание

Агрегатор на източници

Roy Scholten: Drupal admin revamp UI research

Planet Drupal - 15 Февруари, 2018 - 00:56
14 Feb 2018 /sites/default/files/styles/large/public/20180214-admin-revamp.png?itok=rK7Zzjiu Drupal admin revamp UI research

At Drupalcon Vienna there was a lot of interest and preparation work done around modernizing the Drupal administrative interface. I wrote up a high level summary here. As a result this initial issue was posted.

My previous post with a small concept for the editor UX triggered some interesting discussion on Twitter.

We also discussed this topic during yesterdays UX meeting.

As a result, ckrina now proposes an initial round of research to learn and get inspiration from other systems. Mind you, this is the woman that brought us the redesigned status report page and is a member of the team that made the Umami demo that’s now in core. Good things can come from this!

Your help in researching these topics is very welcome. Have a look.

Tags ui research Drupal drupalplanet
Категории: Planet Drupal

Flocon de toile | Freelance Drupal: Customize the order's activity log with Drupal Commerce 2

Planet Drupal - 15 Февруари, 2018 - 00:00
By default, Drupal Commerce 2 provides an activity log on the life of each order: the add to cart event, the checkout entry, the order placed, its possible shipment and its conclusion. Each status of the command corresponds to an entry in a log that is generated. This provides a complete history for each order. This activity log is generated by a small module, developed by the maintainers of Drupal Commerce 2. A small but extremely powerful module, titled Commerce log. Let's discover how to use this module to insert additional log entries.
Категории: Planet Drupal

Dries Buytaert Shares His View on Decoupled Drupal: When, Why, and How

Drupal News - 14 Февруари, 2018 - 21:24

More and more developers are choosing content-as-a-service solutions known as decoupled CMSes, and due to this trend, people are asking whether decoupled CMSes are challenging the market for traditional CMSes.

By nature, decoupled CMSes lack end-user front ends, provide few to no editorial tools for display and layout, and as such leave presentational concerns almost entirely up to the front-end developer. Luckily, Drupal has one crucial advantage that propels it beyond these concerns of emerging decoupled competitors.

Join Dries Buytaert, founder of Drupal and CTO at Acquia, as he shares his knowledge on how Drupal has an advantage over competitors, and discusses his point-of-view on why, when, and how you should implement decoupled Drupal.

Dries will touch on:

  • His thoughts on decoupled CMSes - where is the CMS market headed and when?
  • His opinion on whether decoupled CMSes will replace traditional CMSes
  • The advantages of decoupled Drupal vs. emerging decoupled competitors
  • Considerations when determining if decoupled Drupal is right for your project

Click here to watch the webinar. Dries Buytaert

CHAIRMAN, CHIEF TECHNOLOGY OFFICERACQUIA, INC.

Dries Buytaert is an open source developer and technology executive. He is the original creator and project lead for Drupal, an open source platform for building websites and digital experiences. Buytaert is also co-founder and chief technology officer of Acquia, a venture-backed technology company. Acquia provides an open cloud platform to many large organizations, which helps them build, deliver and optimize digital experiences. A Young Global Leader at the World Economic Forum, he holds a PhD in computer science and engineering from Ghent University and a Licentiate Computer Science (MsC) from the University of Antwerp. He was named CTO of the Year by the Massachusetts Technology Leadership Council, New England Entrepreneur of the Year by Ernst & Young, and a Young Innovator by MIT Technology Review. He blogs frequently on Drupalopen sourcestartupsbusiness, and the future at dri.es.

LinkedIn

Twitter

https://www.acquia.com/resources/webinars/dries-buytaert-shares-his-view-decoupled-drupal-when-why-and-how?cid=7010c000002ZXDSAA4&ct=online-advertising&ls=drupalorg&lls=pro_us_ola_drupalorg_q12018

Категории: Drupal News

Brian Osborne: Using a Forked Package in Your Composer Project

Planet Drupal - 14 Февруари, 2018 - 20:58

Sometimes you need to make custom modifications to a composer package. Assuming that your modification is a bug fix, the best approach is to file an issue with the package's issue queue and submit the fix as a pull request (or a patch file when dealing with Drupal projects). Then you can use the composer-patches plugin to include the change in your project.

Категории: Planet Drupal

Drupal Console: Drupal Console 1.6.0

Planet Drupal - 14 Февруари, 2018 - 19:55

Drupal Console 1.6.0 is out. The newest release contains bug fixes one new command added to generate site alias. Improved UI/UX when listing commands within a namespace, debugging site alias and chain commands. Twig support added to chains commands.

Категории: Planet Drupal

Zoocha Blog: Extending Twig Templates with Blocks in Drupal 8

Planet Drupal - 14 Февруари, 2018 - 18:49
Web Development Extending Twig Templates with Blocks...

One of the many good things about Drupal 8 is the introduction of Twig. It's a lovely templating engine that, in my opinion, is far superior to PHPTemplate. For us frontenders, it has a much nicer user syntax that's more akin to handlebars or other JS templating engines. Imagine this…

14 Feb 2018 Extending Twig Templates with Blocks...
Категории: Planet Drupal

Drupalize.Me: Adding Free Videos to the Drupal 8 User Guide

Planet Drupal - 14 Февруари, 2018 - 17:00
Категории: Planet Drupal

Valuebound: How to generate PDF of HTML code in Drupal 8

Planet Drupal - 14 Февруари, 2018 - 10:52

Have you ever been in a situation where you were required to generate PDF of HTML code? Recently, I came across a similar situation. In Drupal 8, there are several PHP libraries that allow you to generate PDF. However, out of curiosity, I thought of finding better alternatives. After some research, I found an interesting library, called mPDF, that converts HTML code to PDF without changing the structure.

mPDF is a smart library that considers the CSS attached to the HTML. Not only CSS, it takes care of almost all the HTML tags like form tags, tables, images, lists etc.

Generating PDF of HTML in custom module

Requirements

mPDF 7.0 requires PHP ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0.…
Категории: Planet Drupal

Agiledrop.com Blog: AGILEDROP: Our blog posts from January

Planet Drupal - 14 Февруари, 2018 - 09:55
You have already seen what Drupal blogs we trending in the previous month, and now it is time to look at all our blog post we wrote. Here are the blog topics we covered in January.   The first blog post in January was 2017 in review. In this blog post, our Commercial director Iztok looked back in the year 2017 and summarized what differences we made as a company, which Drupal events we have visited, how much fun we had and how do we contributed back to the community in 2017.    The second was Who will get the control of personal data after GDPR? by Ales Kohek. He talked about new set of… READ MORE
Категории: Planet Drupal

Commerce Guys: We're sponsoring and speaking at Florida DrupalCamp!

Planet Drupal - 14 Февруари, 2018 - 06:38

Florida DrupalCamp 2018 finally arrives this weekend, February 16-18! Commerce Guys is a Gold sponsor this year, and I will be heading down to the conference to talk about Reporting in Drupal Commerce.

With Drupal Commerce 2.4 out the door (see yesterday's release notes), our focus is shifting back to the contributed module ecosystem. As Bojan highlighted in our year in review blog post, we have now ported many essential modules and pushed for them to achieve stable releases. With 55 payment gateways, shipping support, and work on recurring payments in progress, we've identified reporting as our next major initiative.

Reporting is obviously essential to eCommerce. Merchants need to know which products are selling, if a marketing campaign is producing new sales, how much sales tax to remit, and more. Each new type of report brings unique challenges related to understanding, querying, and visualizing the underlying data.

At Florida DrupalCamp, I will discuss the requirements and challenges we've identified in reporting within Drupal Commerce and the solutions available to our users in the Commerce Reports and Commerce Google Analytics modules. Finally, I will also unveil Commerce Guys’ newest product, Lean Commerce Reports.

Lean Commerce Reports, which we first showed off at DrupalCon Baltimore, is finally production ready. Over 80 stores use Lean Commerce Reports to add a plug and play sales dashboard to the back end of Drupal Commerce. The dashboard gives store owners immediate visibility into their sales trends, traffic by channel, conversion rate, and top selling products over time. Furthermore, each summary report on the dashboard links to a full report you can further explore, refine, export, etc.

Jonathan and I have worked really hard these last few months to get Lean Commerce Reports to where it is now, and I can't wait to show it off in Orlando. If you miss me there, come find us at DrupalCon Nashville or get in touch if you'd like to try it out while it's still in private beta.

Категории: Planet Drupal

Brian Osborne: Importing Images Within an RSS Feed Using the Drupal 7 Feeds Module

Planet Drupal - 14 Февруари, 2018 - 05:58

Yes, a blog post about Drupal 7!

I recently worked on an enhancement for a large multi-site Drupal 7 platform to allow its users to import news articles from RSS feeds. Pretty simple request, and given the maturity of the Drupal 7 contrib module ecosystem, it wasn't too difficult to implement.

Категории: Planet Drupal

Brian Osborne: Importing Images Within an RSS Feed Using the Drupal 7 Feeds Module

Planet Drupal - 14 Февруари, 2018 - 05:58

Yes, a blog post about Drupal 7!

I recently worked on an enhancement for a large multi-site Drupal 7 platform to allow its users to import news articles from RSS feeds. Pretty simple request, and given the maturity of the Drupal 7 contrib module ecosystem, it wasn't too difficult to implement.

Категории: Planet Drupal

PreviousNext: Creating a custom LinkIt matcher plugin

Planet Drupal - 14 Февруари, 2018 - 04:27

In one of our recent projects, our client made a request to use LinkIt module to insert file links to content from the group module.  However, with the added distinction of making sure that only content that is in the same group as the content they are editing is suggested in the matches.

Here’s how we did it.

by Pasan Gamage / 14 February 2018 The LinkIt module

First, let me give you a quick overview of the LinkIt module.

LinkIt is a tool that is commonly used to link internal or external artifacts. One of the main advantages of using it is because LinkIt maintains links by uuid which means no occurrence for broken links. And it can link any type of entity varying from core entities like nodes, users, taxonomy terms, files, comments and to custom entities created by developers.

Once you install the module, you need to set a Linkit profile which consists of information about which plugins to use. To set the profiles use /admin/config/content/linkit path. And the final step will be to enable the Linkit plugin on the text format you want to use. Formats are found at admin/config/content/formats. And you should see the link icon when editing content item.

Once you click on the LinkIt icon it will prompt a modal as shown below.

By default LinkIt ships with a UI to maintain profiles that enables you to manage matchers.

Matchers

Matchers are responsible for managing the autoload suggestion criteria for a particular LinkIt field. It provides bundle restrictions and bundle grouping settings

Proposed resolution

To solve the issue; we started off by creating a matcher for our particular entity type. Linkit has an EntityMatcher plugin that uses Drupal's Plugin Derivatives API to expose one plugin for each entity type. We started by adding the matcher that linkit module exposed for our custom group content entity type.

We left the bundle restrictions and bundle grouping sections un-ticked so that all existing bundles are allowed so the content of those bundles will be displayed.

Now that the content is ready we have to let the matcher know that we only need to load content that belongs to the particular group for which the user is editing or creating the page.

Using the deriver

In order to do that we have to create a new class in /modules/custom/your_plugin_name/src/Plugin/Linkit/Matcher/YourClassNameMatcher.php by extending existing EntityMatcher class which derives at /modules/contrib/linkit/src/Plugin/Linkit/Matcher/EntityMatcher.php.

Because Linkit module's plugin deriver exposes each entity-type plugin with and ID for the form entity:{entity_type_id} we simply need to create a new plugin with an ID that matches our entity type ID. This then takes precedence over the default derivative based plugin provided by Linkit module. We can then modify the logic in either the ::execute() or ::buildEntityQuery method.

Using LinkIt autocomplete request

But here comes the challenge, in that content edit page the LinkIt modal doesn’t know about the group of the content being edited, therefore we cannot easily filter the suggestions based on the content being edited. We need to take some fairly extreme measures to make that group ID available for our new class to filter the content once the modal is loaded and user starts typing in the field.

In this case the group id is available from the page uri.

So in order to pass this along, we can make use of the fact that the linkit autocomplete widget has a data attribute 'data-autocomplete-path' which is used by its JavaScript to perform the autocomplete request. We can add a process callback to the LinkIt element to extract the current page uri and pass it as a query parameter in the autocomplete path.

The code

To do so we need to implement hook_element_info_alter in our custom module. Here we will add a new process callback and in that callback we can add the current browser url as a query parameter to the data-autocomplete-path attribute of the modal.

\Drupal\linkit\Element\Linkit is as follows;

public function getInfo() { $class = get_class($this); return [ '#input' => TRUE, '#size' => 60, '#process' => [ [$class, 'processLinkitAutocomplete'], [$class, 'processGroup'], ], '#pre_render' => [ [$class, 'preRenderLinkitElement'], [$class, 'preRenderGroup'], ], '#theme' => 'input__textfield', '#theme_wrappers' => ['form_element'], ]; }

Below is the code to add the process callback and alter the data-autocomplete-path element. We rely on the HTTP Referer header which Drupal sends in its AJAX request that is used to display the LinkIt modal, which in turn builds the LinkIt element

/** * Implements hook_element_info_alter(). */ function your_module_name_element_info_alter(array &$info) { $info['linkit']['#process'][] = 'your_module_name_linkit_process'; } /** * Process callback. */ function your_module_name_linkit_process($element) { // Get the HTTP referrer (current page URL) $url = \Drupal::request()->server->get('HTTP_REFERER'); // Parse out just the path. $path = parse_url($url, PHP_URL_PATH); // Append it as a query parameter to the autocomplete path. $element['#attributes']['data-autocomplete-path'] .= '?uri=' . urlencode($path); return $element; }

Once this is done we can now proceed to create the new plugin class extending EntityMatcher class. Notice the highlighted areas.

namespace Drupal\your_module\Plugin\Linkit\Matcher; use Drupal\linkit\Plugin\Linkit\Matcher\EntityMatcher; use Drupal\linkit\Suggestion\EntitySuggestion; use Drupal\linkit\Suggestion\SuggestionCollection; /** * Provides specific LinkIt matchers for our custom entity type. * * @Matcher( * id = "entity:your_content_entity_type", * label = @Translation("Your custom content entity"), * target_entity = "your_content_entity_type", * provider = "your_module" * ) */ class YourContentEntityMatcher extends EntityMatcher { /** * {@inheritdoc} */ public function execute($string) { $suggestions = new SuggestionCollection(); $query = $this->buildEntityQuery($string); $query_result = $query->execute(); $url_results = $this->findEntityIdByUrl($string); $result = array_merge($query_result, $url_results); if (empty($result)) { return $suggestions; } $entities = $this->entityTypeManager->getStorage($this->targetType)->loadMultiple($result); $group_id = FALSE; // Extract the Group ID from the uri query parameter. if (\Drupal::request()->query->has('uri')) { $uri = \Drupal::Request()->query->get('uri'); list(, , $group_id) = explode('/', $uri); } foreach ($entities as $entity) { // Check the access against the defined entity access handler. /** @var \Drupal\Core\Access\AccessResultInterface $access */ $access = $entity->access('view', $this->currentUser, TRUE); if (!$access->isAllowed()) { continue; } // Exclude content that is from a different group if ($group_id && $group_id != $entity->getGroup()->id()) { continue; } $entity = $this->entityRepository->getTranslationFromContext($entity); $suggestion = new EntitySuggestion(); $suggestion->setLabel($this->buildLabel($entity)) ->setGroup($this->buildGroup($entity)) ->setDescription($this->buildDescription($entity)) ->setEntityUuid($entity->uuid()) ->setEntityTypeId($entity->getEntityTypeId()) ->setSubstitutionId($this->configuration['substitution_type']) ->setPath($this->buildPath($entity)); $suggestions->addSuggestion($suggestion); } return $suggestions; } } Conclusion

And we are done.

By re-implementing the execute() method of EntityMatcher class we are now able to make the LinkIt field to display only content from the same group as the content the user is editing/creating.

So next challenge here is to create some test coverage for this, as we're relying on a few random pieces of code - a plugin, some JavaScript in the LinkIt module, an element info alter hook and a process callback - any of which could change and render all of this non-functional. But that's a story for another post.

Tagged Drupal 8, Drupal Modules, Custom modules
Категории: Planet Drupal

Acro Media: Drupal Commerce 2: Set up a Product Type with Custom Fields

Planet Drupal - 14 Февруари, 2018 - 00:27

In part one  and two of this Acro Media Tech Talk video series, we covered how you set up a new product attribute and used rendered fields, in Drupal Commerce 2. In part three we set up a product variation type with custom fields.  

In part four of this series, we'll complete our overall product configuration by setting up a product type. The product type defines the type of product that you're creating (i.e. hat, shirt, shoe). This is what your store administrators will see when they add a new product to their catalog. By default, a product type will consist of a title, body, and variation type. We'll add some additional custom fields for things like taxonomy reference (for categorization), short description, specifications, product review, etc. 

This entire video series, when complete, will show you how to set up a new product in Drupal Commerce 2, from start to finish. The video is captured using our Urban Hipster Commerce 2 demo site.

Next week we'll post part 5: How to Add and Modify Product Content

Its important to note that this video was recorded before the official 2.0 release of Drupal Commerce and so you may see a few small differences between this video and the official release now available.

Urban Hipster Commerce 2 Demo site

This video was created using the Urban Hipster Commerce 2 demo site. We've built this site to show the adaptability of the Drupal 8, Commerce 2 platform. Most of what you see is out-of-the-box functionality combined with expert configuration and theming.

More from Acro Media Drupal modules used in this video

Категории: Planet Drupal

Phase2: Managing Your Drupal 8 Migration

Planet Drupal - 13 Февруари, 2018 - 21:14

In this post, we’ll begin to talk about the development considerations of actual website code migration and other technological details. In these exercises, we’re assuming that you’re moving from Drupal 6 or 7 to Drupal 8. In a later post, I will examine ways to move other source formats into Drupal 8 - including CSV files, non-Drupal content management systems, or database dumps from weird or proprietary frameworks.

Категории: Planet Drupal

Web Wash: Add Custom Tab to User Profile Page with Views in Drupal 8

Planet Drupal - 13 Февруари, 2018 - 16:00

On a recent project, I had to create a custom page which displays content by the logged in user, think of it as a "My articles" or "My blogs" page. I knew how to do it by writing code but I thought I'd try it with Views and see how far I could get without writing any custom code. Long story short, I was able to do it all by using just the Views module.

In this tutorial, you'll learn how to create a page which will appear as a tab (local task) on the user profile page.

Getting Started

For once there are no extra modules to download and install. In Drupal 8, Views ships with core and will be automatically installed if you installed Drupal using the Standard installation profile.

If it's not already installed, go to Extend and install Views and "Views UI".

Категории: Planet Drupal

qed42.com: Securing Cookie for 3rd Party Identity Management in Drupal

Planet Drupal - 13 Февруари, 2018 - 14:13

We are in an era where we see a lots of third party integrations being done in projects. In Drupal based projects, cookie management is done via Drupal itself to maintain session, whether it be a pure Drupal project or decoupled Drupal project,.

But what when we have a scenario where user’s information is being managed by a third party service and no user information is being saved on Drupal? And when the authentication is done via some other third party services? How can we manage cookie in this case to run our site session and also keep it secure?

One is way is to set and maintain cookie on our own. In this case, our user’s will be anonymous to Drupal. So, we keep session running based on cookies! The user information will be stored in cookie itself, which then can be validated when a request is made to Drupal.

We have a php function to set cookie called setCookie() , which we can use to create and destroy cookie. So, the flow will be that a user login request which is made to website is verified via a third party service and then we call setCookie function which sets the cookie containing user information. But, securing the cookie is must, so how do we do that?

For this, let’s refer to Bakery module to see how it does it. It contains functions for encrypting cookie, setting it and validating it.

To achieve this in Drupal 8, we will write a helper class let’s say “UserCookie.php” and place it in ‘{modulename}/src/Helper/’. Our cookie helper class will contain static methods for setting cookie and validating cookie. Static methods so that we will be able to call them from anywhere.

Категории: Planet Drupal

Appnovation Technologies: Simple website approach using a Headless CMS: Part 2

Planet Drupal - 13 Февруари, 2018 - 11:00
Simple website approach using a Headless CMS: Part 2 Using Cockpit CMS In my previous post, I presented some Headless CMS solutions and suggested using Drupal mostly due to the content editorial capabilities and flexibility. Drupal can be leveraged as a vanilla solution or in a distro flavor (e.g. Contenta, Reservoir). I also approached Cockpit CMS, because it's a pure Headless CM...
Категории: Planet Drupal

Jules Destrooper

Drupal Case Studies - 13 Февруари, 2018 - 10:20
Completed Drupal site or project URL: https://www.jules-destrooper.com/

Jules Destrooper is a Belgian food company based in Lo, West Flanders. It was founded in 1886 by Jules Destrooper. Jules Destrooper produces a range of premium biscuits and is mainly known for its small butterwaffle known as lukken. The company exports products to about 75 countries all over the world and offers private-label production services.

The Reference Antwerp developed a brand new website for Biscuterie Jules Destrooper. The result is astonishing and the whole team is, quite rightfully, extremely proud of it. It all started with... a cookie. Not only did it inspire the web design, but also the user experience. Design is Dead/The Reference took care of the whole package: from photography to design to development.

Категории: Drupal Case Studies

Jacob Rockowitz: Yes...the Contribute module is making a statement

Planet Drupal - 13 Февруари, 2018 - 01:14

I was explaining to my 12 year old, Ben, the pushback I am getting around making the Contribute module a dependency of the Webform module and how most people agree with the Contribute module's general concept and message but are unhappy about how and where I placed it. Ben shrugged and says "So basically you are holding up a protest sign, people are agreeing with it but because it is inconveniencing them and they are upset at you and want you to remove it".

So the Contribute module is a protest/political statement; I am okay with admitting that. Many of the expressed concerns are immediately addressed by the fact that there are three different mechanisms to remove the dependency. The beauty of open source is that, if you don't like something, you have the freedom to change it.

For anyone truly worried that the Webform module will indefinitely depend on the Contribute module, it’s worth noting that all protests, political statements, revolts, and revolutions have to end at some point (aka release).

For the time being, however, I am going to keep maintaining the Webform module as well as working on (and defending) the Contribute module.

The Contribute module is not going bring down your website

A few people have expressed concerns about the Contribute module being unneeded and fear it is posing a security risk. Considering people are trusting my 10000+ lines of code in Webform module on production websites to build forms and securely collect data, this seems a bit extreme. To my mind, what seems like the biggest security risk in the Drupal community is unmaintained and unstable modules running on 100,000's of websites. The Rules module is a great example of key Drupal module that is still in alpha releases while being used on a production website....Read More

Категории: Planet Drupal