Hey, i have nextcloud and pico cms running on a vps in a docker container. i’m a noob to all of this, so please bear with me.
Now i want to put html-POST forms into pico-cms pages. Access to these forms needs to be restricted to a usergroup, thats why pico-cms seems perfect for this purpose.
Unfortunately, simply putting the HTML code into the markdownfile doesn’t work. So i thought, that twig might be the issue here and i tried this:
{% autoescape false %}
form
…
/form
{% endautoescape %}
But that doesn’t work either, the form isn’t shown, when accessing the page. Only text within it.
My question is, is it at all possible to use pico cms for my purpose? I have no experience with accessing a docker container file system and before i try that to try changing the pico settingsfile, i’d like to know if there is even a chance of making this work.
Thanks and greetings
You can’t use HTML forms in Markdown files with Pico CMS for Nextcloud for security reasons. However, you can still use Twig. Just keep in mind that Markdown is for contents and Twig for theming, so putting Twig markup in your Markdown files won’t work. You’ll have to create a custom theme with the appropriate HTML forms and create a website using this custom theme.
It should parse HTML. It is very simple and efficient to use.
Have a look here https://korskyrkan-intra.dedyn.io/s/j6q9axS7Z8YYxXN
This is the manual which foillows with the default theme.
I think you should install PicoCMS and found out if it suits you.
Thanks for you reply. I probably have something wrong on config files probably, because the HTML code is displayer as text. On the md files editing with the nextcloud default app I edit the index.md file that is within the picoCMS website and it is displayed as text, it does not process the tags
on the .twig file I can write HTML an it is processed, but on the md file itself it is not processes, a simple < b > Hello World < / b > is displayed as text.
Do you have to config something on picoCMS or Nextcloud ?
Thanks for you reply. I probably have something wrong on config files probably, because the HTML code is displayer as text. On the md files editing with the nextcloud default app I edit the index.md file that is within the picoCMS website and it is displayed as text, it does not process the tags
on the .twig file I can write HTML an it is processed, but on the md file itself it is not processes, a simple < b > Hello World < / b > is displayed as text.
Do you have to config something on picoCMS or Nextcloud ?
HTML forms in Markdown files are stripped out by Pico CMS for Nextcloud due to security reasons. You must not allow users to use active content (like user-defined HTML forms), otherwise they could potentially take over your Nextcloud instance. However, if you need HTML forms (e.g. for a contact form) you can easily create a custom theme to incorporate the form you need. Any other non-active HTML (like <b>Hello World</b>) is passed through as-is.
From this thread I’m surmising the Nextcloud PicoCMS strips it. I’m not overly happy with that as an explanation, repeatedly stated, for security reasons I admit, though I could live with it I guess if we had a clear doc online that explained what was filtered out and what not and above all where. As in is there a setting we can tweak, page specific, template specific, CMS wide? that permits some, or all HTML tags through?
I found for example in config.yml.template:
twig_config: # Twig template engine config
autoescape: html # Let Twig escape variables by default
But no documentation anywhere could I fund as to what values this config variable can take and what they do.
I could of course put this into the template and will try just that. The workaround probably being to set a meta tag in the page asking for an embedded calendar, and then the template renders it. I’ll experiment.