Can we customize the built-in text?
Currently, Otterwiki asks for contributors' "first and last name", but I don't actually want that information from anyone contributing to my wiki. Can I change that text to something else?
Hey @locrianz, thank you for reaching out. There is no option to change this text, it is hardcoded as "placeholder" in the template: https://github.com/redimp/otterwiki/blob/d6d5f3c38a48f2e12859854560248d1d712e2529/otterwiki/templates/register.html#L22
A workaround would be to patch the template ... But how a workaround can be done depends on how are you running An Otter Wiki? Via Docker?
Yeah, I'm using Docker. I assume to patch that template I'd have to build Otter Wiki from the source?
It's not a very elegant solution but it works:
With a docker-compose.yaml:
services:
otterwiki:
image: redimp/otterwiki:2
restart: unless-stopped
ports:
- 8081:80
volumes:
- ./app-data:/app-data
- ./template/register.html:/opt/venv/lib/python3.11/site-packages/otterwiki/templates/register.html
and template/register.html:
{% extends "form.html" %}
{% block formcontent %}
<form action="{{ url_for("register") }}" method="POST" class="form-inline">{# <!-- w-400 = width: 40rem (400px), mw-full = max-width: 100% --> #}
<div class="form-group">
<label for="email" class="required w-150">eMail Address</label>
<input type="text" class="form-control" name="email" id="email" placeholder="[email protected]" value="{{email if email}}" autofocus>
</div>
<div class="form-group">
<label for="password1" class="required w-150">Password</label>
<input type="password" class="form-control" name="password1" id="password1" placeholder="Password">
</div>
<div class="form-group">
<label for="password2" class="required w-150">Confirm password</label>
<input type="password" class="form-control" name="password2" id="password2" placeholder="Confirm Password">
</div>
<div class="form-group">
The password must be at least 8 characters long.
</div>
<div class="form-group">
<label for="name" class="required w-150">Name</label>
<input type="text" class="form-control" name="name" id="name" placeholder="Nickname" value="{{name if name}}">
</div>
<input class="btn btn-primary" type="submit" value="Register">
<a href="{{ url_for("login") }}" class="btn btn-link" role="button">Login</a>
</form>
{% endblock %}
you get