Recently Browsing 0 members
No registered users viewing this page.
I'm rather new to PW. (And loving it) I have installed PW3 with the FrontendUser module. I tried the standard simple script and that worked. But now I want to add some custom fields that are in my user templates. I have created a page-field called userparent where you can choose another user. I don't know if this is relevant.
The answer is probably on this page: https://bitbucket.org/pwFoo/frontenduser/wiki/Code snippets / Examples
"Add custom form field with hook after field processed
Add an additional form field to the registration form with field processing (add value to user object) inside your template file."
But I'm having difficulty implementing the script due to my lack of knowledge. I keep getting internal server errors. How and where do I define the custom fields I want to make available in the form? I'm not extremely good at PHP but know more than the basic stuff.
I hope someone can help me out.
I'm building my homepage, it contains ~60 custom fields (lines or words I define & translate in the admin in different languages).
The homepage is dynamic and my users are logged.
I'm trying to avoid many MySQL queries to retrieve the fields I've setup in the admin, I think I can do better than 60 different queries to display that content on the home.
Regarding performance, will markup cache a good approach here ?
I understand it makes sense when you have a scrolldown menu which is built within a loop for example but is it still good if I cache 60x a word or a group of words in my code ?
Another idea I had was to dynamically determine which language is used by the user and load a language file which contains the translated text (uk.inc.php) and so on... (less elegant I think, but I'll use that anyway for dynamic expressions such as "you have %nb items in your cart").
I've come to a situation which I have not come across previously and am wondering how best to solve.
I have a template with a heap of "questions" which usually have a yes/no answer, but may also need further detail. So a textfield with a simple yes, no, or other text such are "sometimes" would cover it.
But I'd also like a couple of additional checkboxes to accompany each of these fields as a toggle for display; eg
do you have children? yes, Display this field (yes), Include field in emails (no)
do you have pets? (yes, 2 rabbits) Display this field (no), Include field in emails (yes)
do you have rabies? (sometimes), Display this field (yes), Include field in emails (yes)
...etc, you get the picture. I have probably 50-80 fields like the above. How would I go about doing this? Is this what is referred to in Processwire as a custom fieldtype? Are there any really basic tutorials or examples for something like this?
One thing i cant seem to find is how to add custom blocks to pages.
I.e. I've got a template which includes several content fields - headline, content1, content2 but i also want to add another teaser... it would be great adding "new field" -> teaser into pages where i want to add them to.
is something like this possible,without creating a new template for everypage?
The ACF plugin for wordpress includes options like this and its very convenient.