Contact page for users in the footer

Hello,

I’m running indico version 3.3.1 and wondering how I can create a custom ‘Contact’ page in the footer?

For example if a user does not know the “Managers”, how can that user contact that manager directly? Hovering over the name does not show any email address, or contact button.

I can create PUBLIC_SUPPORT_EMAIL but instead of having a general support mail, it would be easier if I could list all the “managers” for each category in page in the footer, it would be great.

I found this Installation — indico-plugin-custom-footer 2.0.1 documentation
But after the installation and enabling the plugin indico stops to work. Same procedure works fine but with Zoom.

Can I do something with CUSTOMIZATION_DIR>/files and have my custom footer.html in this CUSTOMIZATION_DIR and replace the footer.html in this location: /opt/indico/.venv/lib/python3.12/site-packages/indico/modules/core/templates\contact.html

Thanks!

Best regards

Yes, the easiest way would be to use a template override for the contact.html template. Do not modify/replace files inside site-packages.

Put your custom template in <your customization dir>/templates/core/core/contact.html (yes, having core there twice is correct: once for “indico core” and once for the actual template path), and then use something like this for its content:

{% extends '~core/contact.html' %}

{% block content -%}
    <p>
        If you need support regarding the Indico instance system in general, you can use the following email address:<br>
        <a href="mailto:{{ indico_config.PUBLIC_SUPPORT_EMAIL }}">{{ indico_config.PUBLIC_SUPPORT_EMAIL }}</a>
    </p>

    <p>
        <strong>For support concerning an event, please use the contact information stated on the event website.</strong>
    </p>
{%- endblock %}

Sorry, I’m not able to sort this out.

In my indico.conf i have typed:

CUSTOMIZATION_DIR = '/opt/indico/custom/templates/core/core/contact_html'

I have created the path: /opt/indico/custom/core/core
-rw-r–r-- 1 indico www-data 437 apr 14 09:11 contact.html

and the contact_html I have

% extends '~core/contact.html' %}

{% block page_class %}fixed-width-standalone-text-page{% endblock %}

{% block title -%}
    {% trans %}Contact{% endtrans %}
{%- endblock %}

{% block content -%}
    {% trans %}some text:>
    <a href="mailto:{{ indico_config.PUBLIC_SUPPORT_EMAIL }}">{{ indico_config.PUBLIC_SUPPORT_E>
{%- endblock %}

and then restarted

systemctl restart apache2.service indico-celery.service indico-uwsgi.service
systemctl enable apache2.service postgresql.service redis-server.service indico-celery.service indico-uwsgi.service

CUSTOMIZATION_DIR = '/opt/indico/custom'

is all you need in the config

The template file should be in /opt/indico/custom/templates/core/core

That was a fast reply! Thank you! But it still doesn’t work.

My indico.conf

# Disable system notices
SYSTEM_NOTICES_URL = None
PUBLIC_SUPPORT_EMAIL = 'test@test.se'
STATIC_FILE_METHOD = 'xsendfile'
PLUGINS = {'vc_zoom'}
CUSTOMIZATION_DIR = '/opt/indico/custom'
drwxr-xr-x  3 indico www-data 4096 apr 14 09:04 custom
drwxr-xr-x  3 indico www-data 4096 apr 14 09:42 core
drwxr-xr-x 2 indico www-data 4096 apr 14 09:19 core
rw-r--r-- 1 indico www-data  437 apr 14 09:11 contact.html

Any suggestions?

Best regards

uh, hard to say with just those short ls snippets.

why don’t you enable CUSTOMIZATION_DEBUG like the docs suggested - then you should get the correct path to use in the log file…

I added this in my indico.conf
CUSTOMIZATION_DEBUG = ‘/opt/indico/custom’

then I see

2024-04-14 09:55:29,967 DEBUG 64c998f7a2f14701 - indico.customization Customizable: core/core/contact.html (original: /opt/indico/.venv/lib/python3.12/site-packages/indico/modules/core/templates/contact.html, reference: ~core/contact.html)

So if your custom template is in /opt/indico/custom/templates/core/core/contact.html it should work.

Thank you, that worked!

Sorry another question, I’m trying to use a custom css for the table below.
I have placed my contact.css in the same location as my contact.html and added the <link rel=…">

Seems that contact.html does not find the contact.css ?

{% extends '~core/contact.html' %}

{% block page_class %}fixed-width-standalone-text-page{% endblock %}

{% block title -%}
    {% trans %}Contact{% endtrans %}
{%- endblock %}

{% block extra_head %}
    {{ super() }}
    <link rel="stylesheet" type="text/css" href="core/contact.css">
{% endblock %}

{% block content -%}

    <table border="1">
        <tr>
            <th>Category</th>
            <th>Admin</th>
            <th>Email</th>
        </tr>
        <tr>
            <td>Category1</td>
            <td>Admin1</td>
            <td><a href="mailto:admin1@name.se">admin1@name.se</a></td>
        </tr>
        <tr>
            <td>Category2</td>
            <td>Admin2</td>
            <td><a href="mailto:admin2@name.se">admin2@name.se</a></td>
        </tr>
    </table>

    {% trans %}If you need support contact, you can contact the following email address:{% endtrans %}<br>
    <a href="mailto:{{ indico_config.PUBLIC_SUPPORT_EMAIL }}">{{ indico_config.PUBLIC_SUPPORT_EMAIL }}</a>
{%- endblock %}


You are mixing up filesystem paths and web/URL paths. In modern webapps there’s a very good chance that there’s no direct/clear mapping between those two, and Indico is no different here.

The documentation mentions how to include global CSS, and as long as your selectors are not super generic (and collide w/ something from Indico itself), that would be the easiest way to get your CSS into Indico.

Alternatively, if you want to include custom CSS just on that page: put it in /opt/indico/custom/files/contact.css, and use {{ url_for('assets.custom', filename='contact.css') }} to get the URL inside your <link> tag.

Also, where did you find this extra_head block? Such a block does not exist. Check the indico/web/templates/indico_base.html template content on GitHub. Unfortunately there is no block that’s explicitly doing what you’re trying to do (hence my suggestion w/ using the proper customization method to add your stylesheet), but if you want you can “misuse” the late_js or extra_meta_tags blocks, depending on whether you want your stylesheet to be loaded before or after the core ones.


You can remove this from your custom template btw - by extending the default one, any blocks that you do not override are taken from the original template:

{% block page_class %}fixed-width-standalone-text-page{% endblock %}

{% block title -%}
    {% trans %}Contact{% endtrans %}
{%- endblock %}

Thanks again!

By creating this path /opt/indico/custom/css and placing my contact.css in the css folder

and the contact.html with the following as you suggest, it works now :slight_smile:

{% extends '~core/contact.html' %}


{% block title -%}
    {% trans %}Contact{% endtrans %}
{%- endblock %}


 <link rel="stylesheet" type="text/css" href="{{ url_for('assets.custom', filename='contact.css') }}">

{% block content -%}

    <table border="1">
   ...