Override form view (v5.8.1)
Permalink 2 users found helpful
Hi community,
I want to override "concrete/blocks/form/view.php".
I create this folder -> "application/blocks/form/", copy the view.php into this folder and edit the view.php.
But it doesn't work. Is this way correct or not?
Cache is not active...
Thanks for your help!
Cheerio
Machomaaan
I want to override "concrete/blocks/form/view.php".
I create this folder -> "application/blocks/form/", copy the view.php into this folder and edit the view.php.
But it doesn't work. Is this way correct or not?
Cache is not active...
Thanks for your help!
Cheerio
Machomaaan
Yes, this is the correct way to do it. I know you said the cache isn't active but did you try clearing it anyhow? Sometimes that fixes things even if it doesn't seem like it should.
Thank you hutman for your answer.
Yes, I cleared cache in Concrete5 and in my browser (Chrome)?!
Yes, I cleared cache in Concrete5 and in my browser (Chrome)?!
Can you provide a link to the page that you're trying to change? It's possible that this is using the express_form instead of the form, which would need that block overridden.
I'm sorry, but this project is local (xampp) until the project is finished.
I checked the parameters again:
- all cache is off
- clear cache manually
- clear cache of browser
- create new form (normal form)
But I don't know, why it doesn't work :/
I take the standard "view.php" from "concrete/blocks/form/" and copy them into "application/blocks/form/". Then I just add the class "buttoni" to the submit-button on line 117.
And I change the echo of "Required" to "*" on line 91.
I checked the parameters again:
- all cache is off
- clear cache manually
- clear cache of browser
- create new form (normal form)
But I don't know, why it doesn't work :/
I take the standard "view.php" from "concrete/blocks/form/" and copy them into "application/blocks/form/". Then I just add the class "buttoni" to the submit-button on line 117.
And I change the echo of "Required" to "*" on line 91.
If you inspect the form on the front end of the site what is the outer div's class? If it's using the form block's view.php it should be "ccm-block-type-form" if it's using the express_form's view.php it will be "ccm-block-express-form"
Hm, you're right, the class is "ccm-block-express-form" :)
So it is the wrong file. But where is the right one?
So it is the wrong file. But where is the right one?
/concrete/blocks/express_form/view.php
This is tricky...
'cause I used a normal form and not an express-form?!
---- EDIT ----
I found the issue:
I need to use the "Legacy Form"... or edit the Express-Form...
If you use the normal form widget you got a question of "new form" or "existing express entity form" and I thought that the "new form" is the normal form...
So... problem solved!
Thank's alot hutman!
'cause I used a normal form and not an express-form?!
---- EDIT ----
I found the issue:
I need to use the "Legacy Form"... or edit the Express-Form...
If you use the normal form widget you got a question of "new form" or "existing express entity form" and I thought that the "new form" is the normal form...
So... problem solved!
Thank's alot hutman!
+1 for a quick resolution.
But it's a thousand pities the block name doesn't match the website directory name here, sure makes the designer's life harder.
If you're going to call the block "Legacy Form" in the editor's UI, why not move its code into a folder called "blocks/legacy_form" (and fix whatever hard-coded internal dependencies c5 might have on the "blocks/form" path)?
But it's a thousand pities the block name doesn't match the website directory name here, sure makes the designer's life harder.
If you're going to call the block "Legacy Form" in the editor's UI, why not move its code into a folder called "blocks/legacy_form" (and fix whatever hard-coded internal dependencies c5 might have on the "blocks/form" path)?