Submitted by melinda on Sat, 05/11/2024 - 07:37
If you need an Image hard code such as a social media icon, but only want to display when a certain link field is filled out.... Here's your twig code.
My link field is field.hudl.url replace it with your link field.
The twig:
<div id="social">
{% if content.field_hudl_link is not empty %}
Submitted by melinda on Fri, 05/10/2024 - 19:20
<div class = "image">
Zoe
{% set image_url = file_url(node.field_YOUR_FIELD.entity.getFileUri()) %}
<img src="{{ image_url }}") >
</div>
Submitted by melinda on Tue, 03/12/2024 - 12:57
When dealing with a mobile design coming from a custom webpage that needed a lot of regions changed on it to not use the branding of the entire site, particularly, no side bars and fixed width. My mobile design was scrolling right because of extra space on the right and you could only see it on an actually mobile device. Mobile device simulators do not catch it.
If you have a scrolling issue in mobile, sometimes it is a div on the desktop page causing the issue. Using "position: fixed", will break you Y axis scroll (Up and Down).
Submitted by melinda on Tue, 03/05/2024 - 09:40
I had the hardest time piecing all this together. One of the reason was because when you search for image maps, you get a bunch of maps. However after hours of searching and ChatGPTing. I finally mage this thing work. I am sure there is an easier way through some kind of coding platform but this is what I had to do. Hope it helps someone else!
Submitted by melinda on Tue, 02/27/2024 - 06:59
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. :)
Submitted by melinda on Tue, 02/06/2024 - 22:58
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!
Submitted by melinda on Mon, 02/05/2024 - 21:14
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.
Submitted by melinda on Mon, 01/22/2024 - 23:48
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.
Submitted by melinda on Mon, 09/11/2023 - 23:15