- Install the Sidebery extension
- In Firefox, open
about:support
- Scroll down to Profile Folder and click the
Show in Finder
button - Within the gobbldygook folder that appears, open the chrome folder.
- Open the userChrome.css file in a text editor.
- Paste the contents of the sidebery.css file into it
- Relaunch Firefox
<?php | |
namespace Drupal\prc_helper\Plugin\Field\FieldFormatter; | |
use Drupal\Core\Field\FieldItemListInterface; | |
use Drupal\Core\Field\FormatterBase; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\media\Entity\Media; | |
/** |
Ok, so
$thingie
is your node, or paragraph, or whatever. You're probably writing this code in your thingie's preprocess hookfield_link
is the link field whose data you're trying to access
// Check that the field exists and isn't empty
if ($thingie->hasField('field_link') && !$thingie->field_link->isEmpty()) {
$text = $thingie->get('field_link')->first()->title;
$url = $thingie->get('field_link')->first()->getUrl()->toString();
}
Ok, so
$thingie
is your node, or paragraph, or whatever. You're probably writing this code in your thingie's preprocess hookfield_reference
is the entity reference field that's referring to your taxonomy term whose inner data you want to plunderdesired_field
is the actual field inside the taxonomy term whose data you need
// Make sure the field exists and isn't empty
if ($thingie->hasField('field_reference') && !$thingie->get('field_reference')->isEmpty()) {
// This is a taxonomy term reference, so I need to get the term id, then load it to get the term data.
$termreference = $thingie->get('field_reference')->target_id;
Ok, so
$thingie
is your node, or paragraph, or whatever. You're probably writing this code in your thingie's preprocess hookfield_paragraph
is a paragraph field whose inner data you want to plunderdesired_field
is the actual field inside the paragraph whose data you need
// First, check that the field exists and isn't empty
if ($thingie->hasField('field_paragraph') && !$thingie->field_paragraph->isEmpty()) {
// In this case, this is a single value field. Otherwise you might need to set up a loop or call a specific entry
Redirecting visitors from an auto-generated taxonomy term page to a node (like a landing page) is totally doable, but there's a trick to it!
You can't just type the auto-generated url for the taxonomy term into the redirect; for whatever reason it just doesn't work. (For example, "resource-types/law-overviews" wouldn't work.) Instead, you need to use the taxonomy term number.
Go to the term listing page for the taxonomy. Click or hover over the edit button to get the edit url, which incldes the term number.
Then in the redirect, you put /taxonomy/term/THE-TERM-NUMBER-YOU-JUST-FOUND into the "From" field, and use autocomplete to select the desired node "To" field.
ex: From: /taxonomy/term/118
error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH, out
The solution is to delete my docker config file: rm ~/.docker/config.json
PHP Warning: include(/app/vendor/bin/../composer/composer/bin/composer): Failed to open stream: No such file or directory in /app/vendor/bin/composer
Renaming the .app package in Finder only changes the name there, it doesn't change the name shown in the menu. To do so edit YOUR.app/Contents/Resources/XY.lproj/InfoPlist.strings
(with XY being the language you are using) and change CFBundleName
there.
For applications without localization files you can also edit YOUR.app/Contents/Info.plist
and set a new value for CFBundleName
there.
Thought byDavid Hernandez March 14, 2016 Drupal 8 CSS and JavaScript
Drupal 8 revolutionizes the theming experience with many significant improvements to make theming easier, and give themers the flexibility and control they've never had before. One of those major improvements is to the library management system, which controls the attaching of CSS and JavaScript files.
In this post we will cover how to create and control libraries from a theme. This will include SMACSS categorization for CSS files, dependencies, how to conditionally attach libraries, manipulating libraries that come from anywhere in a site (core, modules, or base themes,) and targeting individual files for removal or replacement. All this without needing a single line of PHP. Creating Libraries