This forum is for assistance with theme development.

How to add page templates for content types in Drupal 8?

I'm using the "basic" skin

my type of content is called "apartments"

when a file is added page--apartamenty.html.twig it does not work this way.

I have drupal 8.7.3

I use this method and it does not work what I'm doing wrong?

https://befused.com/drupal/page-template-content-type

overide sub theme on specific page only

I understand that you can use template names to suggest different templates to use for different things such as
page, block, node ect

from a drupal theme (not from a module which defines a block ) is it possible to make a twig different template file render a specific block on a specific page only.

Lost most twig template/field suggestions

Not sure if this is a new issue, but I couldn't find anything with a search that matched.

I have twig debug set to true, and devel is running.

If I look at the source, there is only suggestions on blocks, not on content, or even the main html block. I don't have any sites running prior to 8.7 but I checked on 2 sites I own. One is plain bartik the other is bootstrap 3.

I can't see where to upload any screenshots. And I'm sure this doesn't make sense, but here is what it renders.

Adding CSS and JS to my theme

Hello,

I created a template in which I am using a UI kit from Creative Tim. Now I am trying to turn this template into a Drupal theme, but I am having trouble with getting all the JS to work. I am getting the following errors in my console: https://imgur.com/7XFfOcC

Below is a structure of the CSS and JS files from my template, and then how I am including them in my theme.

In my head (CSS files):

Render TWIG when adding a custom block to panels

Hi,

I created a simple custom block out of "Basic block" and called it "testblock1".

I created a TWIG file called "block--testblock1.html.twig" with a div and background-color:yellow;

When I add the custom block "testblock1" using the block layout, I see the content of "testblock1" with a yellow background (which is great!).

But, when I add "testblock1" from panels->content->add new block, I see the content of "testblock1" but NOT the HTML of the TWIG file with the yellow background.

Theme randomly uses system module templates instead of my own

Hello all!

I have an issue that I don't quite understand.

Sometimes, very very randomly (like maybe once or twice a week), the theme from my production site switch by itself from my theme to the templates used by the system module. But not all of the templates : only the html.tpl.php and the page.tpl.php. The node.tpl.pph for example would be the one from my theme. And it only takes a cache flush to make it back to normal.

Did anyone have this problem at some point? Does someone know when the system module template files are used?

Thanks!

Pages

Subscribe with RSS Subscribe to RSS - Theme development