Bookmark with Dynamic Components via Keyboard Maestro (with Toggl Reports example)
Here’s an example of how you can use Keyboard Maestro to create bookmarks that use dynamic components. For this example I wanted to create a bookmark that would give me the correct URL to get a report of the last 365 days of Toggl time entries. Toggl lets you pass a start date and an end date in the URL. Using KM it’s easy to replace those values with calculated date values.
Click the screenshot at the right to see the macro, which I’ve also provided here: Toggl entries for the last 365 days.kmmacros.
Adding Entity Wrapper Class from Field Value using Display Suite
NOTICE: This works fine in Drupal 7. For Drupal 8 please note: https://www.drupal.org/node/2863420
This may not work with paragraph bundles (because you don’t have a Token view mode). Maybe there’s a way, but I don’t have time to mess with it.
Sometimes as a developer you need to provide your Drupal authors with the ability to choose different variations of a particular content object. For example, imagine you have a Callout paragraph bundle and you want the author to choose between a Dark or a Light colorscheme; if the user chooses Light, the font colors appear dark over a light background. To achieve this you need a dark or light class on the entity wrapper based on whichever the author chose; this would let you write CSS to target each color scheme. Using Display Suite this is an easy problem to solve and doesn’t require any preprocess code or other hand-coded solution.
This solution requires Token and Display Suite. You will need to enable the ui modules from these, as well as ds_extras to give you the CSS class functionality.
Friendly URL for Views Contextual Filter on a Boolean Field
I have a story content type that has a corresponding Views listing page. The stories can be flagged as Featured through a checkbox/boolean field ( field_story_featured ). The stories also have a Story Type value ( field_story_type ). The views listing page needs to have the following links at the top:
The URL structure for the Views page makes the most sense as follows (purple = story type contextual filter, orange = featured contextual filter):