Questions tagged [template-inheritance]

59 questions
1
vote
1 answer

Allow multiple apps to use {% extend base.html %} in Django without clashing?

I have only started with Django recently, and assume there must be a good solution for this issue! After installing django-allauth through pip, it tried to extend base.html from my project/templates folder rather than from its own subdirectory. This…
gatlanticus
  • 1,158
  • 2
  • 14
  • 28
1
vote
1 answer

Symfony2 - How to implement partial / full templates for loading AJAX content in twig?

In my Symfony2/twig webapp I have a twig template, that only contains a
...
, no wrapping. I use this for an ajax call where I embed this into my page layout. Let's call this layout…
Gottlieb Notschnabel
  • 9,408
  • 18
  • 74
  • 116
1
vote
2 answers

in Jade, how I can output the contents of an `extends` block inside of a mixin?

How I can output the contents of an extends block inside of a mixin? This is a simplified example: mixins.jade mixin form() form block layout.jade include mixins.jade body +form block content somepage.jade extends layout block…
Paul Young
  • 1,489
  • 1
  • 15
  • 34
1
vote
2 answers

performing static cast from a non template base class to a templated derived class which has variadic template parameter (c++)

I wanted to store a vector of function pointers, each taking different no. of arguments in a class "Store". So, wrote a templated class "Func" that would store the function as a std::function and its arguments in a tuple. I derived this "Func"…
1
vote
5 answers

Django: How do I extend the same functionality to many views?

I have a parent template that I'm using in many parts of the site, called base.html. This template holds a lot of functional components, such as buttons that trigger different forms (inside modal windows) allowing users to upload different kinds of…
sgarza62
  • 5,998
  • 8
  • 49
  • 69
1
vote
2 answers

Django: Extend template by return value of template tag

In a template, I want to determine the parent template of a sub template via the return value of a template tag. This is the template tag. It returns the app label (the package name) and appends the corresponding template name to be extended: {%…
Martin
  • 4,170
  • 6
  • 30
  • 47
0
votes
1 answer

Python Flask Block template inheretance won't work

I created a simple Html file and Child html file to test a template inhertance using block base.html

TEST BLOCK

{% block content %}{% endblock %} test.html {% extends "base.html" %} {% block content %}Output{% endblock %} I've already…
0
votes
1 answer

How to restrict a class template parameter to a certain subclass?

This is what I am trying: C is a template parameter that is either SomeClass or SomeDerivedClass: class SomeClass { protected: int ProtectedBaseClassMember; virtual void SomeFunctionFromBaseClass(); }; class SomeDerivedClass : public SomeClass…
ruben.moor
  • 1,876
  • 15
  • 27
0
votes
2 answers

Failed template inheritance in django templating

I am in a middle of a project. The project uses basic html at the frontend. I having trouble in template inheritance. This is the basic code : - {% extends 'main.html' %} {% block content %}

Home


{% if…
LEO_007
  • 55
  • 6
0
votes
1 answer

{% block contents %} conditional on a variable Django template inheritance

I am using Django's template inheritance from a base file called base.html. All of my apps, except one, require that {% block contents %} {% endblock %} is present in that file, which is problematic. I am trying to find away to make the inclusion {%…
Radial
  • 342
  • 1
  • 4
  • 14
0
votes
2 answers

django template inheritance: how to NOT display a block from parent template?

how can we hide a block in child template which is being rendered by paent template? for ex: my parent template base.html contains- .... {% block messages %}
aditya k.
  • 35
  • 6
0
votes
1 answer

Inheriting a template base class - scope resolution of base class members

I have written a template base class as below: template class Base { public: Base(T x); void print_base(); virtual ~Base(); protected: T data; }; template Base::Base(T x) : data(x) {} template
thecdoctor
  • 69
  • 14
0
votes
1 answer

Why is logo not rendered in bootstrap navbar dropdown item - linked page?

I am using Flask framework. I have few tabs (Home, About, Services and Contact) in my bootstrap navbar. Services tab is a dropdown Tab which has a dropdown item called profile and it is linked to Profile.html template All the templates (html files)…
Pavan
  • 381
  • 1
  • 4
  • 19
0
votes
0 answers

Can I override a method of a class template if it doesn't use the template parameter inside?

I have the following code: template class A { public: virtual void func() { // Things that don't use T parameter. } }; class B : public A { public: void func() { A::func(); // Working... …
fb9
  • 37
  • 5
0
votes
1 answer

Nest {% block %} in {% for %} Django template inheritance

I am developing a dictionary application using Django. One of the main themes of the app is displaying feeds of definitions. Specifically, I have: an "index" feed where new definitions are listed, a "headword" feed where definitions of a particular…
fredperk
  • 737
  • 1
  • 9
  • 22