This forum is for assistance with theme development.

Custom Theme Not Showing Up in Drupal 9

This is my first time creating a Drupal custom theme, and I'm having a problem getting it to show up.  Here is what I have currently:

Unable to get product url alias in Twig

Hi everyone,

I'm completely unable to retrieve a url alias in a view Twig.

I tried different solutions including the Path function of the Twig helpers but it doesn't seem to be designed to deal with products...

Danland 2-Column Layout [sidebars]

Sorry for this question but I can't find how to change the Danland theme layout!

I don't see it in the Danland theme handbook (https://www.drupal.org/node/768350), nor in the theme settings page, where there is nothing on layout.

I added a right sidebar in Structure > Blocks but it does not show up, neither do the other Danland regions. I checked the style.css, template, and page.tpl files, and they look normal. This installation is many years old, maybe I hacked some file long ago, I can't remember:

Newbie - Building a new node---pagetest.twig from scratch

I went almost directly from D7 to D9, so from the tpl.php files to the Twig files, which I have now read up on a little.

In order to have a partially different layout in a node type (just the node, not the whole page) and create a layout made by a set of rows and columns, so I need to use css-flex massively, I decided to try building a 'node-testpage.twig' template from scratch.

The first approach seems to be going well, and I am not experiencing any problems whatsoever with content management.

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.

Pages

Subscribe with RSS Subscribe to RSS - Theme development