Can a nunjuck template literal be nested within another nunjuck template literal in A-Frame?

I am looking to incorporate a 'glass' template literal within my 'building' template literal.

<script id="building" type="text/x-nunjucks-template">
  {% for x in range(0, 5) %}
  <a-entity template="src: building.template; type: handlebars" position="{{ x * 5 }} 0 0">
  </a-entity>
  {% endfor %}
</script>

<script id="glass" type="text/x-nunjucks-template">
  {% for x in range(0, 5) %}
  <a-entity template="src: glass.template; type: handlebars" position="{{ x }} 2 2">
  </a-entity>
  {% endfor %}
</script>

Although I recognize that they should be executed within .HTML files, I am curious if there is a way to set it up like this:

index.html --> building.template --> glass.template

Your assistance on this matter is greatly appreciated.

Answer №1

Employ the {% raw %} tag.

{% raw %}
  utilize some nunjucks scripting
{% endraw %}

This will prevent it from being displayed in the main template.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with implementing MUI Style Tag in conjunction with styled-components and Typescript

I have created a custom SelectType component using Styled Components, which looks like this: import Select from '@mui/material/Select'; export const SelectType = styled(Select)` width:100%; border:2px solid #eaeaef; border-radius:8px ...

Strategies for organizing your week with a calendar

Hello, I am working on creating a weekly calendar using PHP and I want to add events to the calendar like in this example. However, I am unsure how to display the events in the calendar at the correct time of day. Here is the code snippet I am currently u ...

What are the steps to create a basic chrome extension that functions as a countdown clock?

I am a beginner in the world of coding and I am currently working on creating a chrome extension that serves as a timer. My goal is to include the timer within the HTML popup file, allowing users to customize the settings themselves. Do you have any advice ...

Obtaining a csv file from a local directory in order to create a Chart without relying on a server

Using the D3 library, I am creating a GeoMap chart. Recently, I downloaded a dataset from github called "geonames" and wanted to incorporate this data into my map to test my code. I utilized console.log to ensure everything was functioning properly, and it ...

Is it possible to utilize onclick for various table cells in jQuery?

I have a situation where I need to loop through dates and display table content accordingly. Could someone please assist me in figuring out how to do this? index.html.erb <% @batches.each do |batch| %> <tr> **<td class = "pie" id ...

What is the best way to ensure that the vue template runs before the script?

While attempting to set up an ASCII camera using Vue, I encountered a problem trying to access the canvas from the template. In the bootCanvas() method, when attempting to access the canvas with this.context = this.$ref.canvas.getContext('2d'), a ...

The Expressjs router prioritizes resolving before retrieving data from Firestore

UPDATE: Upon further investigation, I discovered that by adding "async" to the function signature, the output now displays in the intended order. However, I am still encountering an error regarding setting headers after they have already been sent, even th ...

Determine in React whether all values in an array of objects are false and then return true

Is there a way to determine if all objects in an array are false in React? Below is the structure of my array: [{"filter":"ASIA","key":0,"isChecked":false},{"filter":"INDIA","key":1,"isChecked":false},{"filter":"MANDYA","key":2,"isChecked":false},{"filter ...

Using Vue.js, send information from an Ajax request to a Laravel controller for processing

As someone new to development, I have a little confusion with handling data from a multi-step form in an AJAX request on my controller. While I've been able to successfully collect all form inputs at once, I'm struggling to use the data from $req ...

Managing Time Before Browser Refresh in AngularLearn how to monitor and examine the time remaining before

In my Angular web application, I am facing an issue where the user's login status is lost every time the browser is refreshed or reloaded. I want to implement a feature that allows the login status to remain active for a short period of time after the ...

Import HTML document into a Bootstrap Popup

Currently, I am working on creating a modal that loads content dynamically. Below is the JavaScript code I have been using for this task: function track(id,title) { $('#listenTrack').modal('show'); $('#listenTrack').f ...

jquery-validation error in gulp automations

I've encountered a sudden error in my gulp build related to jQuery validation. There haven't been any recent changes that would trigger this issue. Interestingly, one of my colleagues is experiencing the same problem, while another one is not. We ...

What could be causing JQuery to not hide my div when using Bootstrap classes, but instead working with a Bootstrap row?

I've encountered an issue with hiding two div elements in my HTML using jQuery. One is working perfectly fine, but the other one seems to be causing problems. The first div that works has a single class attribute class='row', while the probl ...

<div><!-- including: unknown --></div>

Need some assistance with this issue. The ng-include path I am using is "http://localhost:8080/coffeeprojects/calc.html". I tested the path and it seems to be working. However, despite organizing the files and improving the path as suggested in some resp ...

Why does a Drone CI job abruptly end before a Selenium-based npm script is completed?

I currently have a drone set up and my pipeline is configured to do the following: pipeline: test: image: node:8.3.0 commands: - npm install --only=dev - npm run automation The automation script in my package.json looks like this: ...

Changing styles with the use of bootstrap.css themes on the fly

I'm experimenting with toggling between a custom dark and light theme in my MVC application. On the _Layout.cshtml page, the default theme is loaded by the following code: <link id="theme" rel="stylesheet" href="~/lib/bootstrap/dist/css/Original. ...

Incorporating the chosen value from a dropdown box as a variable in PHP

Seeking assistance with using the value selected in a drop-down box as a PHP variable in my functions.php file. I attempted to utilize jquery-ajax for this purpose. $(document).ready(function(){ $("#pa_color").change(function(){ var result= $(this).val( ...

A method to deactivate a button cell after it has been clicked within a for loop

I am struggling with correctly disabling a button in my React code when it is clicked. I attempted to pass in an array and handle the button click, but it consistently results in errors. This task seems more complicated than it should be. How can I ensure ...

Utilize the onClick Event to Trigger Function with an Array in ReactJS

Every time I attempt to pass an array as a value to a function by clicking on a div, I encounter the error below: Uncaught Invariant Violation: Expected onClick listener to be a function, instead got a value of object type. If passing an array to a fun ...

Disabling GPS with HTML5/phonegap: A step-by-step guide

Looking to create a function that can toggle GPS on and off for both iPhone and Android devices ...