All RPGs and Storygames by Tod Foley are now available at DrivethruRPG and RPGnow. Bring these games to your table!
GDC 2018 welcomes Supercell CEO Ilkka Paananen and NYU Game Center Director Frank Lantz to speak as part of the Vision Track, a series of mini-keynotes designed to provoke and inspire GDC attendees! ...
If you already learned how to embed a media asset into CKEditor in this tutorial, you’d probably noticed that the media asset selection occurs through an autocomplete field.
This is not really a good experience for an editor. Nobody remembers every single name of every single asset to embed. There are quite a few modules in Drupal 8, which can help you enjoy your browsing task.
In this tutorial, you’re going to learn how to configure the Entity Browser Module, in order to select Media assets and embed them in your text editor.
This module allows admin users to search interface text translations with regular expression.
Here's a screenshot from a quick demo site I prepared. You click on the hamburger menu, and the black sidr region appears on the left. You click it again and the region slides back out.
A quick demo with a Sidr panel in Drupal with the Dark themeInstalling the Sidr module and libraries
To install the module, we must install the module files and then the Sidr libraries.
- Download the Sidr module into the modules or modules/contrib directory in your Drupal project and install the module
- Install the Sidr libraries
- Download the version of Sidr recommended in the module's README file, which at the time of writing this article is Sidr 2.2.1
- Once downloaded, copy the dist directory in the Sidr project to the libraries directory in your Drupal project and rename it to sidr
Sidr library status
- Configure the Sidr theme from the admin/config/media/sidr page. Here's some quick info about the themes:
- The dark (default) and the light themes are provided by Sidr.
- Typically, for a project with a custom look and feel, you'll use the bare theme. This provides minimal CSS, allowing you to style the .sidr element and its children in your theme. Yeah!
Sidr global settings
Congratulations! You now have the module installed. All that's left now is a bit of configuration.Configure collapsible content
Depending on the project requirements, you might have one or more sidr instances. For this article, let's say you want a sliding panel on the left with the following contents:
- Site logo (the site branding block).
- The main menu (the main menu block).
We can achieve this using two different approaches:With a custom region (recommended)
Create a custom region named, say, Drawer (Left) in your theme where you can place whatever blocks you want to show in your Sidr. We will then configure the Sidr plugin to use the contents of this region to populate the collapsible panel (discussed below).
Note: Make sure you hide this region using CSS because Sidr will copy the contents of the region in to a div.sidr element during its initialization.Without a custom region
If all your blocks are already present on your page, you can use multiple jQuery selectors in the Source configuration for the Sidr trigger block (discussed below) and the Sidr plugin will copy the contents of those elements and put them in the Sidr. Sidr will not copy the elements for the jQuery selector, but all of their children. This is the reason why I prefer to use a custom region. Using the above-mentioned custom region approach, you can preserve wrapper elements which give you nice CSS selectors for theming your Sidr.Configure a trigger button
Now that we have set up the contents for the collapsible region, we are ready to create a Sidr trigger block. This trigger block will provide a button to open and close the Sidr panel. To do this,
- Go to the Block management admin/structure/block page.
- Click the Place block button for the region where you want to place the trigger button (usually somewhere in the header).
- Choose the Sidr trigger block, configure it and save it. Some of the configuration options have been discussed below.
Sidr trigger settingsTrigger text and icon
The trigger text is the text which is displayed on the Sidr trigger button. You can also enter some custom HTML in the Advanced settings > Trigger icon field to configure an icon, say, a hamburger icon or an .
Note: It is compulsory to have either a trigger text or a trigger icon. You can also have both if you want.Source
The source is from where the Sidr panel will be populated. It can be one of the following:
- A jQuery selector: If you provide a jQuery selector, the inner HTML of the selected elements will be copied into the relevant Sidr panel. You might be interested in the renaming option which makes Sidr rename the ID attributes of the copied elements to avoid getting repeated DOM IDs. Here are some examples:
- Using a custom region, source should look like .region-drawer-left or .region-drawer-right or whatever you name your custom region.
- Without a custom region, you will have to refer to various blocks like #block-site-branding, #block-main-menu, #block-copyright-notice.
- A URL: If source is a URL, the content on the URL will be fetched via AJAX and displayed in the Sidr panel.
Most of the Advanced settings are optional and you can learn about them by reading the Sidr documentation. Once you have configured everything, all you'll be missing is some custom styling to bring your Sidr to life.+ more awesome articles by Evolving Web
This module requires the following modules:
This module allows the users to Login with Email address beside Username.
In our last post, we talked about how great DrupalVM is by providing Drupal developers a robust development environment that can be used with multiple types of applications. And while the installation process is fairly straightforward, it can take some trial and error in updating your config.yml file for the perfect hosting environment. Are you managing multiple virtual machines for multiple client projects? This can take up a significant amount of space on your computer’s resources (RAM and hard drive space). This post will walk you through how we addressed some of these...Read more
Provides a baseline set of configuration for using core Media module for embedding media/images in WYSIWYG fields.
Designed to be enabled so you get the goodness of default configuration, and then removed as you don't need it hanging around - the configuration will stay with your site.