I have an HTML theme that I am converting to a theme in Drupal 8.7.0.

I have created content type Hero content. Then I created fields inside:

  • title
  • body
  • image (there are multiple images)
  • offer(text)

I have keep 3 records under the hero content.

Now I need to pull all fields into my theme one by one.

My HTML is as below.

<div id="theme-banner-one">
    <div class="illustration wow zoomIn animated" data-wow-delay="1s" data-wow-duration="2s">
      <img src="images/shape/banner-shape1.svg" alt="">
      <img src="images/shape/banner-shape2.svg" alt="" class="shape-one wow fadeInDown animated" data-wow-delay="1.8s">
      <img src="images/shape/banner-shape3.svg" alt="" class="shape-two wow fadeInUp animated" data-wow-delay="2.7s">
    <img src="images/shape/oval-1.svg" alt="" class="oval-one">
    <img src="images/shape/shape-1.svg" alt="" class="shape-three">
    <img src="images/shape/shape-55.svg" alt="" class="shape-four">
    <img src="images/shape/shape-56.svg" alt="" class="shape-five">
    <img src="images/shape/shape-57.svg" alt="" class="shape-six">
    <img src="images/shape/shape-58.svg" alt="" class="shape-seven">
    <img src="images/shape/shape-59.svg" alt="" class="shape-eight">
    <img src="images/shape/shape-60.svg" alt="" class="shape-nine">
    <img src="images/shape/shape-61.svg" alt="" class="shape-ten">
    <img src="images/shape/shape-62.svg" alt="" class="shape-eleven">
    <div class="container">
      <div class="main-wrapper">
        <div class="slogan wow fadeInDown animated" data-wow-delay="0.2s"><span>70% Off</span> **{{ hero_title }}**</div>
        <h1 class="main-title wow fadeInUp animated" data-wow-delay="0.4s">Digital Agency <br>with Excellence <br>Services.</h1>
        <p class="sub-title wow fadeInUp animated" data-wow-delay="0.9s">The 3 golden rules professional graphic designer don’t <br> want you to know about.</p>
        <ul class="button-group lightgallery">
          <li><a href="about-us-standard.html" class="more-button solid-button-one wow fadeInLeft animated" data-wow-delay="1.5s">More About us <i class="fa fa-angle-right icon-right" aria-hidden="true"></i></a></li>

          <li><a data-fancybox href="https://www.youtube.com/embed/aXFSJTjVjw0" class="fancybox video-button-one wow fadeInRight animated" data-wow-delay="1.5s">See live demo. <i class="flaticon-play-button icon-right"></i></a></li>
      </div> <!-- /.main-wrapper -->
    </div> <!-- /.container -->
  </div> <!-- /#theme-banner-one -->

In each <div> I would like to pull the fields value. How can I do that?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.