Recently Browsing 0 members
No registered users viewing this page.
I recently have received a client who has various page layouts. I wanted to give them the ability to simply add their HTML into a body field with CKEditor to allow HTML customization.
However, the client isn't very familiar with HTML.
This has left me to build a template that has multiple of the similar field types.
The thing is, I cannot use the repeater since I cannot repeat lets say an image for repeated item 1 and only body field for repeater item 2.
Therefore, I have to literally add 15 fields for them to totally be able to edit the page without issues.
What are your thoughts on this approach?
Also, I have to name the template according to what it contains, so I was thinking of using numbers instead of words.
Reason being, numbers can describe the amount of title fields, body fields and images.
Therefore something like, 3-3-2.php or three-three-two.php
I have never run into a situation where the client needed so many fields. I was always able to get around it with repeaters etc.
By Kiwi Chris
Forms are an essential part of most websites, and it's no surprise that there's an excellent premium module Form Builder but what if you're on a zero budget for whatever reason?
It is possible to build forms quickly and easily by making use of a couple of free modules and the admin UI to give you a great deal of flexibility and speed of development, particularly if you need multiple forms on a website with different fields.
1. First you're going to need to install a couple of modules:
Form Template Processor
Fieldtype Select External Option
2. For each form that you want to display, create a template without a template file and add fields to it as you normally would. (eg I have formContact, formRegister etc)
Tip: under the Advanced tab in the setup for each template, I add a tag Forms so that all my forms templates are nicely grouped together in admin.
3. Create a new field of type Select External Option and call it formTemplate
In the section Create options from any database table select
templates as the source table id as the Option Value name as the Option Label 4. Create a new template file and call it renderForm.php (or whatever else you like)
Add an email field to this form - This will be the email address that forms get submitted to. Add the formTemplate field you previously created to this form. This will allow you to select which of the templates you previously created such as formContact, formRegister etc you want to render. Add any other fields as usual that you want to render on the page. Add the following PHP code to the template file. $recipient = $page->email; $form = $modules->get('FormTemplateProcessor'); $form->template = $templates->get($page->formTemplate->label); // required $form->requiredFields = array('contactName', 'contactEmail', 'contactMesssage'); //Optional: This can be improved by having a field in the page template with a CSV list of required fields eg $form->requiredFields = explode(',', $page->requiredFields) $form->email = $recipient; // optional, sends form as email. FormTemplateProcessor can also save forms to the database. $content .= $form->render(); //generate the form to display. Note: this doesn't actually render the form at this point, but you have it in the $content variable ready to output wherever you want in your template.
Add any template HTML or other PHP code and echo $content; wherever you want to render the form.
5. Create a page using the renderForm template, and provide an email address, and select a form that you want to display.
6. Use CSS to style the form as required.
7. View your new page, and check that the form renders correctly.
8. You can modify the templates you created at step 2 or create new ones as required if your requirements for what fields forms display changes.
Note: The Form Template Processor module can also save form input as pages, and the FieldType Select External Option can be set up with filtering, so this solution can probably be refined further.
Hello There fellow PW gurus.
I am trying to make a field show as open only if the field is filled out with at string.
for example: "my_styles.css" and stay hidden if the field is empty.
The field in question is of type "text" if that helps.
And i put in the "show this field only if"
because the field name is "css_filename"
But no mather what the field is closed because i have choosen it as "closed" as default.
What am i doing wrong?
i am running PW 3.0.83 Dev.
This is the new topic for the Settings Factory module (formerly known as Settings Train).
I'm not sure what versions this is compatible with, it has only been tested on 3.x branch;
it is not namespaced, and i'm not sure if namespacing is necessary or a benefit for this module; if any namespace or module gurus can weigh in on this, let me know. I'm also not sure if there needs to be a minimum php version;
I have one live site using this now and it's working great; But before submitting to mods directory, would be better if there was some additional testing by other users.
is there a way to declare numbers other than integer and float?
My issue is that intgere is not enough for me because i'm dealing with multiple of bilions (let's say something like 111,532,372,567)