diamondsea
  • Member for 7 years, 6 months
  • Last seen more than a month ago
How to strip <img> tags from teasers?
Accepted answer
8 votes

I have had good luck using the Smart Trim module. (This module is now available for Drupal 7 and 8.) Choose the Smart Trimmed field formatter and check the Strip Out HTML checkbox to remove the image ...

View answer
Possible to use drush to list overrides for all features?
Accepted answer
6 votes

In the current version of Drush, you can show a list of all features and their override state with (both short and long versions of commands shown, with and without the "-y" flag to skip ...

View answer
How can I get an empty region not to render in a field_layout template?
Accepted answer
1 votes

Use this syntax: {% if content.sidebar %} <div class="layout-region layout-region--sidebar col-sm-4"> {{ content.sidebar }} </div> {% endif %} It will remove all HTML (such as the ...

View answer
What can Menus do that Taxonomy cannot?
1 votes

Menus: provide an "active path" class to help style the menu tree have built-in support for multilevel menu functionality provide Breadcrumb information (for some breadcrumb implementations)

View answer
Is there any management utility for multi-site deployment?
1 votes

To round out some of the answers here, there is also OpenDevShop. It aims to be an Acquia Cloud / Pantheon type hosting environment you can install on your own servers to manage your infrastructure ...

View answer
How to switch existing file field from public to private?
1 votes

Use https://www.drupal.org/project/privatize, a drush extension to convert the files for you.

View answer
Get Url Alias in Algolia
0 votes

For D7: Under the Configuration -> Search and Metadata -> Search_API and then go to the Algolia Index and Filters tab (path will be like: /admin/config/search/search_api/index/algoliaindex/...

View answer
Change field from Multi-Value to Single-Value
0 votes

To do this without changing the database, you could use a custom module to leave the database field as-is multivalue, but change the UI so it only allows users to see/choose a single value by altering ...

View answer
Listing all terms of a taxonomy in twig template
0 votes

Here is an example using an unlimited cardinality taxonomy reference field (in field_topic) which creates links to a Search-API view page and pre-selects the 'Topic' facet value with the proper term ...

View answer
How to make custom fieldset collapsed by default in Drupal 8
0 votes

Example using HereDoc notation to store the HTML Description: $desc_html = <<<HTML <p> <strong>Put the HTML to be displayed when open in here.</strong> <p> HTML; $...

View answer
Pre-Populate Dropdown in WebForm from link
0 votes

The Prepopulate module will let you pre-set most form values by adding a parameter to the URL corresponding with the field name. You'd use something like this (inspect your generated form for the ...

View answer
Function to get all the user permissions
0 votes

In a custom module add this code (Devel module needs to be enabled) use the following code. Alternatively, paste this code into Development->Execute PHP Code (you'll need to TEMPORARILY grant the ...

View answer
Display field inputs side-by-side in node edit form
0 votes

If you use the Display Suite module with Display Suite Forms sub-module enabled this is pretty easy. On the Structure->Field Collections->Manage Fields page, select your layout to be "3-column ...

View answer
How to mass-unpublish nodes?
0 votes

Install the Admin_Views module (which is a requirement on all my sites anyway) and then you can use the /admin/content menu to select all Published nodes and bulk-change them to Unpublished. It uses ...

View answer