Questions tagged [html-templates]

Add a template element to your document with children defining your template (including optional `slot` elements to be used with the shadow DOM) and then, as needed, copy its `content` and apply.

The HTML template element can be used for content that is not rendered by default but can be instantiated during run-time. It can have <slot> children which define a pattern for a resulting "flattened DOM tree" (when the template is added as the shadow DOM content of an element potentially with its own children). It is often used within Custom Elements and/or Shadow DOM, but this is not required.

122 questions
0
votes
1 answer

How to display jinja2 template (j2 file) in HTML page with correct format?

I'm able to display jija2 template on HTML page, but the output format is not correct. current output is: Your first name is Tom Your last name is Hanks Expected output is: Your first name is Tom Your last name is Hanks Views.py from…
0
votes
1 answer

How send result to HTML Template From File

How can I send the function result to HTML Template From File, with below effort I am getting an object Object error message Error in HTML Page is : [object Object],[object Object],[object Object],[object Object],[object Object],[object…
0
votes
1 answer

How can i call a list in django template?

Here is my models.py file. from django.db import models from django.contrib.auth.models import User from django.urls import reverse from django.utils.text import slugify import misaka from django.contrib.auth import get_user_model # Create your…
Sayad Ahmed Shaurov
  • 499
  • 1
  • 7
  • 10
0
votes
1 answer

How to add Event Listener to Web Component Template Elements

I'm building a Twitter clone with some added features for my portfolio. I'm using Web Component's template tag to create the tweet template and then using importNode to render this into the DOM when the post tweet button is clicked. This works…
OJM
  • 442
  • 5
  • 16
0
votes
0 answers

How to add value of googlesheets cell into HTML

I am planning to create HTML table to be embedded in email body. The values in the table come from Googlesheets cells. So I start to create script in my googlesheet. But I have no idea to add the cell value into HTML. I start using this…
0
votes
1 answer

stop javascript splitting up variable in html template

In my javascript file, i have a variable that saves a name. I also have a html template where i am rendering that name as a value in an input field. This works fine if the value is one word, but anymore than one, it gets split up. See screenshot for…
b.herring
  • 563
  • 2
  • 18
0
votes
1 answer

Creating a page building framework in javascript utilizing customElements

Me and my friend are trying to make a javascript framework that allows users to make elements and customize them. As well as manage them somehow. We were hoping that we could somehow make a custom element like this class Header extends HTMLElement…
Nik Hendricks
  • 244
  • 2
  • 6
  • 29
0
votes
1 answer

PHP Pear HTML-IT doesn't render after migrating from PHP5 to PHP7

I recently moved one ancient PHP app originally from year 2004 to a freshly installed Linux host. Originally it was written in PHP4 but it worked without any modifications on PHP5. Now there is problem with rendering Pear HTML_Template_IT with PHP7…
ex4
  • 2,289
  • 1
  • 14
  • 21
0
votes
1 answer

Google Scripts error SyntaxError: Unexpected token < (line 119, file "Code")

I get the following ERROR Google Scripts error SyntaxError: Unexpected token < (line 119, file "Code") Doesn't look to me like there are any extra chevrons. http://prntscr.com/rvzsqd "{ ?> Authorized…
0
votes
1 answer

Mailgun. Why is there not a list displayed, what could be the error?

Mailgun HTML template: Request: Result - empty list.
hailovigor
  • 16
  • 1
0
votes
1 answer

can't access image url from template, python django

this is the code in views.py def store (request): products = { 'products':product.objects.all() } return render (request, 'neizer/products.html', context = products) this is the template {% block content %}
0
votes
1 answer

How to dynamically add class in Handlebars template

I am trying to either dynamically create HTML elements in my Handlebars template, specifically: Or I want to be able to select existing elements and add the 'checked' class to them. It's for a star rating…
0
votes
1 answer

neat way to set selected option from javascript literal

I'm trying to set the selected option using Javascript literals. function getHtmlFromTask(task) { let markup = `
Aniket
  • 310
  • 1
  • 4
  • 22
1 2 3
8 9