Comments (5)
@rhukster in your opinion should page.route include the lang code? Or should uri.rootUrl? Or should we add a separate method to Uri that returns the root url including the lang?
from grav-plugin-form.
Just for those in this situation, it's possible to avoid the 404 setting the form.action value in the YAML frontmatter of the page as the name of the route.
For example my form is in
mysite.local/en/contact (where en is the language code).
So for the file that renders the above route (i.e. form.en.md) add the value form.action: contact
For example for italian translation my route is
mysite.local/it/contatti as I have set the slug as contatti, so set form.action: contatti
And so on.
from grav-plugin-form.
page.route()
should definitely not have the lang code forced.
Better option would be to use page.url()
as this will prefix with the lang code. Can someone test that?
from grav-plugin-form.
So how about changing the action
line in the plugins/form/templates/forms/default/form.html.twig
file to:
action="{{ form.action ? base_url ~ form.action : page.url }}"
This way the base_url
will have lang code if required also.
from grav-plugin-form.
@rhukster . This seems to have solved my problem as I outlined it in Gitter earlier today.
from grav-plugin-form.
Related Issues (20)
- Frontend File field tooltip blocks remove button when file is too large HOT 1
- Email plugin? HOT 1
- Default values for date type fields inside elements: only 1st default value is set.
- basic-captcha not showing image (404) HOT 24
- Split up langauges.yaml in separate language files for better maintainability
- Empty basic-captcha field allows bypassing the captcha HOT 3
- failed basic-recaptcha leads to error page HOT 2
- basic captcha: no letters are displayed HOT 4
- Unable to config turnstile using admin plugin HOT 1
- How to add math captcha? HOT 4
- Can't translate basic-captcha error message
- Can't update Flex User field from empty textarea HOT 1
- Math Captcha. x Multiplication operator works incorrectly. HOT 4
- Revisit: Field 'file' does not save file when used in front-end form
- Feature request: Possibility to modify the time format of the date field and to choose the first day of the week
- Addition to recent update on development build - Turnstile build still missing language / tooltip help info
- no longer processing after update - message: TypeError HOT 4
- Email form invisibly allows spam by default HOT 4
- [FIX] Critical Bug - Form save: File with extension not allowed HOT 7
- Form 7.3.0 Cloudflare Turnstile Captcha Help Text
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grav-plugin-form.