Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use custom templates in Lizmap-Docker? #25

Open
skvo1977 opened this issue Jun 14, 2022 · 8 comments
Open

Is it possible to use custom templates in Lizmap-Docker? #25

skvo1977 opened this issue Jun 14, 2022 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@skvo1977
Copy link

Hello!

I'm using Lizmap 3.5 with Docker on Ubuntu Server 20.04.
And I have a question

Сan i use custom templates as described in documentation here ? - https://docs.lizmap.com/current/en/publish/customization/template.html
And where should the template files be placed in this case?
Do I need to add a folder "var/themes/default" in section "volumes" for "lizmap"- servieces in docker-compose file?

Thanks you.

@nboisteault
Copy link
Member

Hi!
Yes, please try to add - ${LIZMAP_DIR}/var/lizmap-themes-default:/www/lizmap/var/themes/default after :
https://github.com/3liz/lizmap-docker-compose/blob/master/docker-compose.yml#L17

And tell us if it works. If it is ok, could you please make a Pull Request?

@nboisteault nboisteault self-assigned this Jun 14, 2022
@nboisteault nboisteault added the question Further information is requested label Jun 14, 2022
@skvo1977
Copy link
Author

skvo1977 commented Jun 15, 2022

Thank you very much!
It works.
I'll try to make a pull request, but this will be my first time. So sorry if this isn't quite correct. :)

@skvo1977
Copy link
Author

skvo1977 commented Jun 16, 2022

I'm sorry. I reopen this topic because I find error in the work of the administration interface after changes.
My changes:
I change docker-compose.yml - add new line ${LIZMAP_DIR}/var/lizmap-themes-default:/www/lizmap/var/themes/default
Copy only modified template main.tpl in ${LIZMAP_DIR}/var/lizmap-themes-default/view
The map view interface work correct.
But, when I go to administration interface I have this error "Error 500. A technical error has occured. Sorry for this trouble."
er2
The login form have this view:
er1

In log-files in /lizmap/www/var/log/errors.log I see
"2022-06-16 14:51:11 10.0.2.2 error 2022-06-16 14:51:11 [18] Unknown module in the selector "jauth~login:out@classic" /www/lib/jelix/core/selector/jSelectorAct.class.php 70"

In log-files in /lizmap/var/log/nginx/lizmap_access.log
10.0.2.2 - - [16/Jun/2022:12:51:11 +0000] "GET /admin.php/admin/config/?auth_url_return=%2Fadmin.php%2Fadmin%2Fconfig%2F HTTP/1.1" 500 178 "http://192.168.2.67:8090/admin.php/auth/login/?auth_url_return=%2Fadmin.php%2Fadmin%2Fconfig%2F%3Fauth_url_return%3D%252Fadmin.php%252Fadmin%252Fconfig%252F" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"

If I delete line about lizmap-themes-default in docker-compose.yml - all work correct.

@dmarteau
Copy link
Member

It appears that there is some content needed in the directory required for lizmap to run properly. (Lizmap is not fully docker friendly yet :-/).

My guess is that you will have to modify the docker-compose file to fit your needs: i.e explicitely mount the files/dir required for your needs.

@skvo1977
Copy link
Author

Thank you.
I found what files were needed for the administration interface.
Everything is working correctly now :)

@nboisteault
Copy link
Member

@skvo1977 Could you change your PR accordingly? Thanks.

@toniodlab
Copy link

toniodlab commented Jul 19, 2022

Hello there. I find why this issue is triggered.

Adding the following line will erase some content in lizmap/var/themes/default folder :
- ${LIZMAP_DIR}/var/lizmap-themes-default:/www/lizmap/var/themes/default

I instead added this line - ${LIZMAP_DIR}/var/lizmap-themes-default/view:/www/lizmap/var/themes/default/view and everything is working fine.

I may need to add a line for every modules I want to rewrite, but it's not a problem for me.

If you have a better solution I'll take it :)

@laurentj
Copy link
Contributor

With the image of Lizmap 3.6 and higher, there is no more static files into lizmap/var, so you can mount /www/lizmap/var/themes/default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants