Drupal 10 comes with CKEditor 5 by default included in the core, at one point in time I had to limit the allowed HTML tags, however, I realized we are NOT longer able to manually overwrite the `All
Prob. there are better ways or alternatives, but the next way works for me!
A route definition:
keboca.another_route:
path: '/something/else'
defaults:
uri: '/valid_uri'
_controller: '\Drupal\keboca\Controller\KController::forward'
The trick happens here:
gitback() {
BRANCH_NAME=${1:-$(git branch --show-current)}
git checkout dev &&
git pull origin dev &&
git remote prune origin &&
git branch -D "$BRANCH_NAME" &&
git remote show origin &&
git status
}
alias git-back='gitback'
<delete><query>*:*</query></delete>
function findAspectRatio(int $width, int $height) {
// search for greatest common divisor
$greatestCommonDivisor = static function ($width, $height) use (&$greatestCommonDivisor) {
return ($width % $height) ? $greatestCommonDivisor($height, $width % $height) : $height;
};
$divisor = $greatestCommonDivisor($width, $height);
return $width / $divisor . ':' . $height / $divisor;
}
(function ($, Drupal, drupalSettings) {
'use strict';
Drupal.behaviors.my_behavior = {
attach: function (context, settings) {
$(document, context).once('my_behavior').each( function() {
myInit();
});
}
}
} (jQuery, Drupal, drupalSettings));
$node = \Drupal::routeMatch()->getParameter('node');
if ($node instanceof \Drupal\node\NodeInterface) {
$nid = $node->id();
}
Few months ago I wrote an article about an implementation over a D7 site I was working on. A friend of mine told me, "Hey, D7 is dead already, why are you still doing those projects".
The javascript autcomplete feature in Drupal 7 is very useful, but sometimes you might need to make some tweaks there.