# Finding the Base.html

**URL:** <https://talk.getindico.io/t/finding-the-base-html/2464>\
**Category:** General Discussion\
**Created:** [November 3, 2021, 10:37am UTC](https://talk.getindico.io/t/finding-the-base-html/2464 "2021-11-03T10:37:15Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torben\_Schmeinck](https://talk.getindico.io/user_avatar/talk.getindico.io/torben_schmeinck/32/812_2.png) [@Torben\_Schmeinck](https://talk.getindico.io/u/Torben_Schmeinck)\
**Post date:** [November 3, 2021, 10:37am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/1 "2021-11-03T10:37:15Z")

</div>

Hello together,

in my registration process I have some emails which are based on each other. Therefore i should have a base.html where all of my other files are relating back to. But I can´t find this file in this folder. Based on that I cannot find a macro which is used in one of the other files and which I have to edit. Is there a way to find those files?

Greetings Torben

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [November 3, 2021, 10:39am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/2 "2021-11-03T10:39:45Z")

</div>

It’s a bit unclear what you are asking about… are you modifying Indico’s code or trying to override templates?

---

<div class="post-metadata">

**Author:** ![Torben\_Schmeinck](https://talk.getindico.io/user_avatar/talk.getindico.io/torben_schmeinck/32/812_2.png) [@Torben\_Schmeinck](https://talk.getindico.io/u/Torben_Schmeinck)\
**Post date:** [November 3, 2021, 10:42am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/3 "2021-11-03T10:42:19Z")

</div>

I am trying to override templates. Sry if it is unclear.

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [November 3, 2021, 10:44am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/4 "2021-11-03T10:44:50Z")

</div>

Which ones in particular? Inheritance uses `{% extends ... %}` in the template, but if you have problems finding the base template it’s easier if you tell us which template you are overriding…

---

<div class="post-metadata">

**Author:** ![Torben\_Schmeinck](https://talk.getindico.io/user_avatar/talk.getindico.io/torben_schmeinck/32/812_2.png) [@Torben\_Schmeinck](https://talk.getindico.io/u/Torben_Schmeinck)\
**Post date:** [November 3, 2021, 10:47am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/5 "2021-11-03T10:47:03Z")

</div>

I am overriding nearly each template in the registration folder. The last step before the base.html file is the base\_registration.html file

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [November 3, 2021, 10:49am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/6 "2021-11-03T10:49:26Z")

</div>

OK… so `base.html` is used for _all_ HTML emails indico sends. It’s in `indico/web/templates/emails/base.html`

---

<div class="post-metadata">

**Author:** ![Torben\_Schmeinck](https://talk.getindico.io/user_avatar/talk.getindico.io/torben_schmeinck/32/812_2.png) [@Torben\_Schmeinck](https://talk.getindico.io/u/Torben_Schmeinck)\
**Post date:** [November 3, 2021, 10:54am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/7 "2021-11-03T10:54:36Z")

</div>

Okay i got that. But now my problem extends that i can’t see where I edit the “registration.state.title|lower” or is that not possible? I want to have the registration title in german.

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [November 3, 2021, 10:59am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/8 "2021-11-03T10:59:41Z")

</div>

Ah. So that’s not really related to template overrides nor inheritance. `registration.state` is an enum member:

```auto
class RegistrationState(RichIntEnum):
    __titles__ = [None, L_('Completed'), L_('Pending'), L_('Rejected'), L_('Withdrawn'), L_('Awaiting payment')]
    complete = 1
    pending = 2
    rejected = 3
    withdrawn = 4
    unpaid = 5

```

So if you want to translate those titles in your overridden templates, you’d need something like this:

```auto
{% if registration.state.name == 'complete' %}Abgeschlossen
{%- elif registration.state.name == 'pending' %}In Bearbeitung
{%- endif %}

```

(with more branches for the other states of course)

---

<div class="post-metadata">

**Author:** ![Torben\_Schmeinck](https://talk.getindico.io/user_avatar/talk.getindico.io/torben_schmeinck/32/812_2.png) [@Torben\_Schmeinck](https://talk.getindico.io/u/Torben_Schmeinck)\
**Post date:** [November 3, 2021, 11:23am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/9 "2021-11-03T11:23:07Z")

</div>

Thank you! I have just one question. Only those things which start with render\_ … are macros which can be edited in the html files?

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [November 3, 2021, 11:25am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/10 "2021-11-03T11:25:40Z")

</div>

Any example? In principle any template blocks (`{% block something %}`) can be easily overridden; in case of templates that do not use blocks you may be able to override macros or have to replace the whole template (which is a bit risky during upgrades since you may miss changes that were made upstream)

---

<div class="post-metadata">

**Author:** ![Torben\_Schmeinck](https://talk.getindico.io/user_avatar/talk.getindico.io/torben_schmeinck/32/812_2.png) [@Torben\_Schmeinck](https://talk.getindico.io/u/Torben_Schmeinck)\
**Post date:** [November 3, 2021, 11:27am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/11 "2021-11-03T11:27:17Z")

</div>

One example would be “{% macro render\_registration\_info() -%}”

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [November 3, 2021, 11:29am UTC](https://talk.getindico.io/t/finding-the-base-html/2464/12 "2021-11-03T11:29:55Z")

</div>

Ah yes, those are basically like functions in normal programming code. We use them for that purpose, not for overriding. IIRC. Jinja macros are a bit peculiar when template inheritance is involved, so not sure if re-defining a macro in a template override will work well… (just give it a try)
