This forum is for assistance with theme development.

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

Include javascript but on run onpage load not when ajax is run?

Hi

I have added js to my theme,

Drupal.behaviors.exampleTheme = {
  attach: function (context, settings) {
    $('.example', context).click(function () {
      $(this).next('ul').toggle('show');
    });
  }
};

The js is run everytime ajax is called.

What would I need to do to only make this work on page load and not everytime ajax is called?

How to render paragraph in content type

I have created a content type called Repeat(node--repeat.html.twig) I want to render paragraph type fields in node--repeat.html.twig so I placed <div> in which paragraph is rendered and then I added paragraph field in content type which I have created but the content type is showing empty.paragraph is not rendering nor it's showing in inspect element. But instead of a paragraph if I add  one or more fields those are rendering correctly

this is the code

<div class="container py-5 pb-5 mx-auto">

      <div class="row row-cols-1 row-cols-md-3 g-4">

How to render dropdown menu

I created menu without the child with this  code it rendered correctly with my css -->

<ul class="navbar-nav me-auto mb-2 mb-lg-0">

    {% for item in items %}

    <li class="nav-item">

       <a class="nav-link  " href="{{ item.url  }}">{{    item.title }}</a>

    </li>

    {% endfor %}

    </ul>

Pages

Subscribe with RSS Subscribe to RSS - Theme development