Questions tagged [template-inheritance]
59 questions
3
votes
1 answer
Accessing base member functions in class derived from template class
I am developing a library at my work and I have designed a complicated inheritance that includes template classes and deriving from them.
My problem is that a base template class has virtual overloaded operator that takes 2 arguments and returns…

Krzych
- 83
- 1
- 6
3
votes
1 answer
Issues using Russian Doll Caching with Template Inheritance
I have been using both Template Inheritance and Russian Doll Caching (using the cache_digests gem) independently of one another in select portions of a fairly complex Rails application, with much success.
I am having difficulty using the two…

Brad Werth
- 17,411
- 10
- 63
- 88
2
votes
1 answer
C++ template parameter inheritance
I have faced some code snippets that a class can inherited from another class via its template parameter. However, I do not understanding why I need to have the three using line in struct D. I try to call the say_hi() function of d but it states…

TPY-Lawrence
- 21
- 3
2
votes
1 answer
DJANGO: How to access data from ListView and DetailView on the same template?
I am trying to create a webpage which has two parts.
An index list of all items (that persists throughout)
Detail of the selected index item
I created a LIST VIEW and a DETAIL VIEW for the same but the problem is both views cannot be called on the…

Nerdcore
- 23
- 5
2
votes
1 answer
How to overload a method of base class passed as a parameter to a template class in C++?
There are two classes:
class A {
public:
virtual void foo( int bar );
}
class B {
virtual void foo( string bar, int baz);
}
Now, the class(es) I'm building can derive from either class. But there's some common helper code, so I want to…

peetonn
- 2,942
- 4
- 32
- 49
2
votes
2 answers
Why isn't the head section of jinja inheritance loading for me?
I'm trying to do template inheritance to the following two pages and everything is being inherited but the title of my page. I've tried several variations on placing the title in different locations but still nothing. By the way I'm working this on…

Mr.Bill
- 179
- 14
2
votes
1 answer
XSL: Call a more general template first each time a specific one is called
I have an existing xslt file that I've created before with several templates.
Now, the requirements have changed and now before processing one of these specific templates I have to check if the current evaluating node has a specific attribute or…

Jens
- 53
- 5
2
votes
2 answers
Django block.super doesn't render variable set in parent template
I have the following scenario:
2 views:
view1:
return render(request, 'template1.html', {'var1': 'value1'} )
view2:
return render(request, 'template2.html', {'var2': 'value2' } )
2 templates:
template1.html
{% block foo %}
{{ var1 }}
{% endblock…

Dr.Elch
- 2,105
- 2
- 17
- 23
2
votes
4 answers
Template Inheritance in Django
I'm using Django 1.1, and I have this template, a base template, that all the other pages inherit from. It defines a bunch of things that are constant throughout pretty much all of the website, like this navbar:

Enrico Tuvera Jr
- 2,739
- 6
- 35
- 51
2
votes
2 answers
Django Template inheritance causes a bus error
I'm working in a multisite hierarchy in a Django template, whereby I need a master base template (base/base.html), for which I have several master templates extending from, such as base/base_twocol.html. And then I have templates that extend from…

shrewdbeans
- 11,971
- 23
- 69
- 115
1
vote
1 answer
C++ Template using an enum defined by a derived class
Basically here's what my "ideal" code would look like, if it were legal:
template
class Base{
ClassName::units_type units;
public:
Base(ClassName::units_type Units) : units(Units){};
void…

lequinne
- 118
- 8
1
vote
2 answers
Template inheritance in 3.1 for controllers in namespace
I have an application.html.erb in views/layouts as usual, with <%= yield %> for content. Now I'm writing a settings page for user accounts which holds a bunch of different pages (profile, account, notifications,…

Emil Ahlbäck
- 6,085
- 8
- 39
- 54
1
vote
1 answer
Including id element, or variable, from another TWIG template
I have picked up the basics of using TWIG to create my site. I suppose I know how to use {%extend%} {%block%} {%include%} and {%set%}, in the most general sense.
I would like to include a block of code from within another twig file without…

MikeyB
- 460
- 1
- 6
- 22
1
vote
2 answers
Force template parameter class to inherit from another templated class with partially fulfilled parameters
So I have the following two classes:
template < class Cost >
class Transformation {
public:
virtual Cost getCost() = 0;
};
template < class TransfCl, class Cost >
class State {
protected:
State(){
static_assert(
…

A Frayed Knot
- 476
- 5
- 20
1
vote
2 answers
Javascript modules not available templates not inherited from base Django tempate
I have this issue hope you have some idea how to solve it.
In a Django templates which is not a "child" template of base template, I would like to use javascript modules which are in the base template, i.e. Jquery. Is there a way to achieve this…

Jose Romero
- 11
- 2