Using a sweet alert with preventDefault()

Using a sweet alert with preventDefault()

I have an event on a form submit. I set preventDefault() to stop the form submitting then pop a sweetalert with a confirm callback. If they decide to go ahead is POSTS the form to Drupal. The issue is that it does not hit the form_submit method but redirects to the... read more
Using a sweet alert with preventDefault()

How do I make the exposed filter values available as tokens for text areas

How do I display (or render in twig) the search term, entered in the search field. When you enter a search term and click on the search button, you will go to the search results page (view). In the header of that view I want to display something like: Your search of... read more
Using a sweet alert with preventDefault()

Creating a Paragraph type programmatically

I have a custom module that is installed on a number of sites. In an hook_update_n function I would like to add a completely new Paragraph type (not actual instance of a Paragraph) to every site, using the same configuration. Adding or updating fields to an existing... read more
Using a sweet alert with preventDefault()

How do I make rows of views blocks on a basic page reacting collectively to an exposed filter?

I have to make a page, containing 3 rows with 3 blocks with content teasers. Preferably the page layout should be made through a basic page content type item, through the Layout Builder, so it is easy to add other stuff. At the top of the page should come a... read more
Using a sweet alert with preventDefault()

Filter a view based on current user’s roles

I’m using a view to populate an Entity reference field on a profile. (So it’s a view of “Entity Reference” display type.) I want to filter this view to show (and allow users to select) only: Published content (OK) Content of a certain type (OK)... read more
Using a sweet alert with preventDefault()

Plugin Not Found Exception

I am implementing REST in Drupal 8. I have created a custom plugin for REST resource, enabled the plugin and configured permissions for that REST endpoint. After few days, I removed the code for plugin without disabling the REST endpoint. I am encountering a plugin... read more
Using a sweet alert with preventDefault()

How do I add a script just above the closing body tag?

How do I add a script on Drupal 8 site/app just above closing body tag? Vendor provided some JS in the following form: <script> … code </script> Asked me to place immediately above </body>. The script was only to run for Anonymous traffic.... read more
Using a sweet alert with preventDefault()

views_pre_render add class item to a row

When pre-rendering a view row is there a way to add an HTML class into a single row of the markup, allowing me to add a new background colour to the event item highlighting its importance? This is for the calendar module monthly view For example, <div... read more
Using a sweet alert with preventDefault()

How can I create a patch for a contrib module or core which is not in version control?

Because we use a devOps system that installs packages on the server via Composer, my core drupal installation and contrib modules are not in version control (Git). I used to patch modules as follows: Commit everything, so my branch is up-to-date. Make my changes to... read more