This forum is for assistance with theme development.

How to link <div> to another node/page

Hi

I have a div that contains product details(image, product name, and cost) when the user clicks on a product like image or product name it should redirect to the page. I created a link field but it will work for 2 fields if I give same link  for product name and product cost the href works but for image or div  href is not working

code 

<div class=" h-100 prod">

              <img src="{{ file_url(content.field_prod6['#items'].entity.uri.value) }}" class="img-fluid prod1" alt="...">

                <div class="card-body ">

Custom Twig Template for View

I am currently hosting a Drupal 9 site on my local machine, and am running into some Twig Templating issues for a custom view I want to create.

The view to be created's machine name is "d9_at_a_glance". In a template called "views-view-d9_at_a_glance.html.twig", I have access to all of the fields I created at the Drupal View UI level (aka Title and Content Type), however I wish to add a few more custom variables using php code and queries.

Flex is adding white space at top of site

Hi,

It looks as though Flex is adding a white space of 82px at the top of this site - newprospect-bs.com. Incidentally, 82px is the size of the admin toolbar space when logged in.

The issue only occurs when I set the Affix option. After research, I found this page => https://www.drupal.org/project/bootstrap_barrio/issues/3006673

As the theme is based on barrio, I checked it and the “fix” above is included, but the problem remains. How can the white space be removed?

Adding js library to theme

Dear All, I understand that there's a lot of documentation for this, but I can never understand this part and till this day couldn't find a complete example of how it's done.

Simply put, I want to use ScrollReveal in my js for some blocks.

1) I download ScrollReveal in web/libraries folder

2) I go to my THEME.libraries.yml and place

extraneous words either "default" or "hide" appearing on page.

I have a very simple Drupal theme. My page.html.twig files has the following code:

<div id="mc">
      {{ page.content }}
</div>

But on the pages, at the bottom, either "default" or "hide" is displayed. It's generated by Drupal, but how? How do I remove it?

Theming's css without boring clearing cache on each change

My goal is to work on theming's css without boring and time-consuming hassle of clearing cache on every small change. I've collected a few pointers that I've implemented, but even now I still have to clear the cache every time. What is missing from these settings?
What i did
1) Disabled the cache in services.yml
 

debug: true
 auto_reload: true
 cache: false

2) Created the settings.local.php file and enabled it in settings.php
 

Pages

Subscribe with RSS Subscribe to RSS - Theme development