I'm looking for a hook to hook into the creation of a frontend form in TYPO3 (e.g. a contact form) which will allow me to pass the form structure to my extensions the moment a form is created (or edited).
I'm not so sure where to look, and I have asked before, but might have formulated my question unclear. Does anyone know if such a hook exists, or is available in the new formengine of TYPO3 8?
Or if you have a better solution I could use, I'm open for everything.
Thanks!
Related
Upon a form a submission, I wish to determine the time that a Laravel form (built using the Laravel Collective HTML package) was rendered to the user.
I need to check this date upon submission for a variety of reasons.
I have a large existing project and am considering the best way to get this date. I was reading the CSRF middleware (since this token is already included in all forms) to see if it can be extracted from that, perhaps in another middleware adding something like form_generated_date to the request.
It looks like a bit of a stretch, if possible at all. So now I am looking at adding a custom field to every form.
I would like this to be included in all forms, just as the Form::open() method will add the CSRF token. I found information on adding my own macros, but not about extending this method.
Does anyone know if it's possible to get the date from a CSRF token? Or how (or where the documentation is) to extend the Form::open() method.
The Form::open() method looks to be in the FormBuilder.php file (https://github.com/LaravelCollective/html/blob/2f6dc39ab3655724a615fe8a652d8b7f04fc9ac6/src/FormBuilder.php).
This file can be found in /vendor/laravelcollective/html/src/FormBuilder.php
You should be able to add a new hidden form field to the open method, bearing in mind that this will be overwritten in any updates. Not really recommended, but will achieve what you are looking for.
I'm using Typo3 for the first time and have been asked to update a site built on it.
Making changes to existing templates so far has been OK since they were mainly CSS changes or replacing images. Now though I need to create a couple of new page templates.
What's the easiest way to go about this? The existing site has a home.html and layout.hmlt in the fileadmin directory. Do I need to create a new html file there, if so how do I use this as a new template for some of my pages?
I'm coming from a mainly WordPress background in terms of CMS (I've nearly given in a recoded the site as a WordPress site since I think it would be quicker at this stage) but I'd really prefer to figure this out.
Any suggestions would be greatly appreciated as I'm pulling my hair out trying to read through the documentation and getting nowhere. The site is using Typo3 version 4.4.6
Thanks!
How you add a new template to your page depends on how templating is handled. Sadly TYPO3 has a poor templating out of the box, so there is most likely an extension that does the job on your site.
Probably one of these:
automaketemplate
templa_voila
flux & fluidpages
Check if one of these extension is installed and add a new page template according to the extensions manual or specify your question afterwards.
Edit:
If plain TYPO3 was used, you'll find something like
page = PAGE
page.10 = TEMPLATE
page.10 {
file = fileadmin/myTemplate.html
}
in your Typoscript. You can add tmplate files like the ones that are already there. To use a different template on a page, you have to replace the page.10.file with the template you want to use. This can be done with a new template record (crated in backend via the template module). But this is a rather anoying procedure to change the template, because you have to create each time you want to change the page template for a page and its children. That is why mostly extensions are used for this.
The out of the box situation gets better with newer TYPO3 versions but in 4.4.6 there are no Backend Layouts that could be uses for a template switch ot something like that.
In Addition to change the mere file you have to adjust the subparts or marker that are filled with the content. You'll find that configured in your TypoScript as well
SOLUTION
Inline Relational Record Editing is the answer. Handy stuff.
For Documentation
:)
QUESTION
I created a front-end plugin using extension builder in TYPO3 6.1.0. For this plugin, extension builder of course generates few default forms in the backend. However, my intention is to have the forms customized. My plugin has 3 tables related it and all these have to be integrated to be inputted from one common form, than having individual forms, which is not ideal.
Do I configure my TCA stuff for this ?.. If so, please suggest me some good tutorials on that.
Or will using FlexForm do the trick ?...also please suggest some good tutorials.
I also checked out Flux, but did not quite understand the architecture of it.
Thank You :)
EDIT:
I want forms to give the user to fill in records. Lets say I have an extension for creating Calendar Events. I need a form, in the TYPO3 backend, through which an administrator can add events and its details.
I'm looking for a WP plugin which can allow me to create different forms and embed them on pages and following are the requirements:
Only a single textbox required in each of those forms
The submit button will only be shown if a custom entry/answer is inputted into the textbox. (basically a client-side validation)
The submitted answer should be stored in the back-end with the usermeta (or just the username of the user logged in) so that I can export the entries in a format like csv, etc.
Any thoughts?
P.S. I have found one but not sure if the PRO version of this allows me to have a validation for a custom text. This is the plugin: http://wordpress.org/extend/plugins/visual-form-builder/
Gravity Forms is the most robust form builder plugin for WordPress. You can, with the right knowledge and skills, make it do pretty much anything you'd like. You can find it here: Gravity Forms.
Very well, I've found this. There are actually good plugins however, you will have to purchase it. I'm looking for a free one. http://www.webdesignboom.com/2013/formcraft-wordpress-form-builder/
I was wondering what is the best practice for creating forms in Wordpress? As a developer I hesitate to use a plugin like CForms, but I can understand why someone would like to use it. In the end I want to know the following:
What is the best practice for creating forms in Wordpress? (Custom HTML/CSS with Javascript and PHP validation or just using a specific aspect of the Wordpress API?)
I don't use any part of the WordPress API for forms. You could automatically grab the name and e-mail address out of the cookie WordPress creates when someone leaves a comment, if you want to try to auto-populate some fields.
An easy way to handle forms is to use Page Templates. That lets you create a new PHP file for a specific page, overriding the default page template of the theme. Then you can simply have the form post to itself and this one page template handles the processing as well.
http://codex.wordpress.org/Pages#Page_Templates
A lot of what's available for WordPress in the way of addins, and what gets a lot of attention, is stuff that I find makes little use if you have programming and general web skills. Almost always they seem to (necessarily) overgeneralize a requirement with a zillion options and configuration requirements because they are first of all designed for non- or barely-programmers.
Just learn the fundamental paradigms, scratch your head and wonder why nothing is consistently abstracted and/or encapsulated, get over it, and use what you already know about php and HTML-based forms. WordPress doesn't add much in the way of either tools or constraints.
I find the Widget feature applies usefully to most everything these days, and Forms is a candidate. But that's my own WordPress viewing prism - YMMV.
What do you mean by "in Wordpress"? Do you just mean placing the form HTML in a Wordpress template? Or storing data collected in the Wordpress DB? If you just want to create a form on your site, there's nothing Wordpress-specific to worry about. I believe there's some special Wordpress data facilities you can use if you're creating a widget or plugin or whatever they're called now. But if you're not, just create the HTML, and point it at a target URL that processes the values and puts them in a DB, Wordpress or otherwise. That target URL could be a separate PHP resource, or the same page. If it's the same page, you just need to include your PHP somewhere in the main Wordpress flow.