Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8839399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:13:45+00:00 2026-06-14T10:13:45+00:00

I am trying to use block in include: for exemple: layout.jade !!!5 html head

  • 0

I am trying to use block in include:

for exemple:
layout.jade

!!!5
html
    head
    body
        include header
        #footer footer
        block javascript
            script('src'= 'jquery.js')

header.jade

h1 header
append javascript
    script
        console.log('Hi, I'm header')

I have :

<h1>header</h1>
<script>console.log('Hi, I'm header')</script>
<div id="footer" >footer</div>
<script src="jquery.js" ></script>

And I would have:

<h1>header</h1>
<div id="footer" >footer</div>
<script src="jquery.js" ></script>
<script>console.log('Hi, I'm header')</script>

Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:13:46+00:00Added an answer on June 14, 2026 at 10:13 am

    blocks don’t work that way with included files, as far as I know. Blocks work with the extends feature. So you could either revise your code to include the javascript as an include, or revise it to use extend

    here’s how it might look using extend

    layout.jade

    !!!
    html
      head
      body
        block header
          h1 header
    
        block footer
          #footer footer
    
        block javascript
          script('src'= 'jquery.js')
    

    index.jade

    extends layout
    
    append javascript
      script
        console.log('hi');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use jQuery.scrollTo plugin with accordion (where one block expands after clicking
I am trying to get a text block to resize vertically and use the
I've been trying to use http://livepipe.net/control/tabs to get some javascript tabs up and running
I'm trying to use both extends and include tags in one template, just like:
I am trying to use the <hr> tag to style and include different headings
I am trying to use Objective-C blocks in an iPhone 3.1.3 app but am
i'm trying use facebook API to upload photo in my fan page. I downloaded
I am trying use gem tire to search in my application. I have tables
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.