This forum is for assistance with theme development.

How to render a Node "only" in D9 with a custom twig template? (no page/header/footer)

Hi there,

I've been looking for quite awhile for a solution to this problem.  I have a use case where I have Nodes rendered on Pages for normal consumption like on a website.  But, I also want it to be a 'printable' type view mode which will not have header/footer etc and will need custom theming (html, css).  So I have two view modes for the Node, one is for the website the other I want to customize (let's call it Print).

Logo redirect only working in page--front.html.twig

{% if site_logo %}

    <a class="logo navbar-btn pull-left px-5 py-3" href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">

      <img src="{{ site_logo }}" alt="{{ 'Home'|t }}" />

    </a>

  {% endif %}

this is only working in <front> page for other pages or content type if i create its not working

twig theme for order item

Hi, I wanted to add some custom text to my commerce confirmation page. I did that successfully by using:

commerce-checkout-completion-message.html.twig

However I want to add customised message that wont be valid for every order completion.

There is a unique: checkout flow, order type, order item type for this, could I use the name from any of those to add to my twig template? using the debug I don't see any suggestions with any of those value sin them though in the order completion page. 

thanks

Unable to render logo in menu.html.twig

Hello,

<div class="container py-3">

      <nav

        class="navbar navbar-expand-lg navbar-light"

        aria-label="Eleventh navbar example"

      >

        <div class="container-fluid">

          <a class="navbar-brand" href="{{ path('<front>') }}"

            ><img src="{{ logopath }}" class="img-fluid" alt=""

          /></a>

             <div class="collapse navbar-collapse" id="navbarsExample09">

           

Error installing custom theme

I'm developing a new site and have only just started getting to know Drupal itself. I scoured google for answers to this but came up dry.

I created a bare bones custom theme just to get started, but I'm getting an error when attempting to install it:

Drupal\Core\File\Exception\NotRegularDirectoryException: temporary://update-extraction-d208df27/._retrowave is not a directory. in Drupal\Core\File\FileSystem->scanDirectory() (line 665 of core/lib/Drupal/Core/File/FileSystem.php).

Content Type only showing the content without header and footer.

When I add content in a new content type which I created only the content is showing not the header and footer but for the page, I have put code which is common should be rendered in every page I put header and footer code in page.html.twig if I add new page then header and footer comes but its not coming in node, but I think I'm missing something what should I do

Pages

Subscribe with RSS Subscribe to RSS - Theme development