Blogs

DDEV- Drush command to revert changes to a drupal view before you save

I am sure we have all ran into this, working on a view and forgetting to change the Apply to from "Apply to all views" to "Apply only to this view". Thus adding or worse, deleting fields or configurations across all view displays.

Easy solution if you use Drush. I use DDEV for my local so my command is:

ddev drush eval "\Drupal::keyValueExpirable('tempstore.shared.views')->delete('YOUR_VIEW_ID');"

This reverts the temporary changes. :)

Render the first item of a paragraph field in twig- Super easy without a loop.

Editors needed to tag different items to a piece of content. However because the content's header render the logo for the other tagged content, if you tagged more than two, the header would render for each tagged content.

Sooooo I thought I put a loop but because the header was based on a paragraph field, it was cooperating.

Easy solution Side by Side comparison.  (Basically, you just need to add a " .0 " to you twig field. Easy peasy!

Infinite Scroll "Load More" will not go away on taxonomy view when pager is selected.

I hade one page view in the taxonomy view that was showing the Infinite scroll "load more" text when I had the mini pager enable.

Turn out there was a block that displayed nodes with the same vocabulary that was using infinite scroll.

I changed that to a pager and the "load more" went away and my pager on the page view displayed.  

The infinite scroll block was in a completely different view too! 

Weird but I'll take it.

Drupal 9 Views Template Twig if statement for boolean fields

I don't know why this isn't any where on the web... Or at least that I could find.

I needed my block to show an image at full width if the editor selected it and another display if the editor did not select it.

For this to work you need to make sure your boolean field is set to "1/0" in two places.  The content type Fields Display section and in your view in the field.

SQL Server/ SQL Server Management Studio- Importing bacpac file -Error SQL72045:

Copy and paste the code below and execute it in your "master" Database in SSMS. The video above will demonstrate where the "master" is.
 

sp_configure 'contained database authentication', 1;  
GO  
RECONFIGURE;  
GO

Reset a count in a different function javascript (JS) and some Jquery

I have a quiz that allows to user to take the quiz 3 times and if they don't pass on the third time, they don't get a certificate at the end of the course.
The counts reset when the user passes the quiz.

 

//Counts the clicks

Leaving site JS Lightbox Alert- exclude specific URLS as a condition

$("a[href]:not([href*='"+window.location.host+"']):not([href^='/']):not([href*='volleyball'])").on("click",l)}

 

If the URL contains "volleyball' in it, the leaving site lightbox warning does not come up and the user is redirected to the site.

Bad Gateway Error- Power Automate SFTP AWS S3 Buckets

If you are trying to using Power Automate and following "I Am Lu" s Tutorial and you get a Bad Gateway error in your power automate. The Key was not made correctly. I am not sure if it is because I am on a Mac and Lu is on a Windows but if you want the flow to connect to AWS then run the below command in your terminal to get the correct SSH Key.

ssh-keygen -m PEM

The key should start with:

-----BEGIN RSA PRIVATE KEY-----

 

Condition when added a admin token flow Power Automate- Power Platform Connectors- O365 Management API - 401

To add the condition for the Admin token flow here> https://powerautomate.microsoft.com/en-us/blog/automate-flow-governance/

Condition Basic Edit does not exist anymore for you would do this instead.

In the first condition field put an expression containing:

@or(equals(items('Apply_to_each_2')['Operation'], 'CreateFlow'),equals(items('Apply_to_each_2')['Operation'], 'EditFlow'))

in the second field put in an expression containing:

Pages

Subscribe to RSS - blogs