Gary Austin
Members-
Posts
25 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Gary Austin's Achievements
Jr. Member (3/6)
10
Reputation
-
Mystery spaces from empty textarea fields appearing
Gary Austin replied to BFD Calendar's topic in General Support
The "spaces" are actually \n\n newline characters which get displayed as spaces. textContent: " \n\n King of the English" textContent: " \n\n \n\n \n\n \n\n Notorious cannibal" Are you using a new editor, copy/paste method, browser or type of machine in the past 3 weeks? -
Need help to output flag icon in drop down (multi language)
Gary Austin replied to Flashmaster82's topic in General Support
Don't know if this helps, and sorry I don't have time to dig into exactly what you are doing, but if you are on the url for one of these subpages with the servicearea template then the data for that page is in $page without you doing anything in the servicearea template. The $page variable contains all the field data for the subpage (like "carpenter") that you are on. -
Need help to output flag icon in drop down (multi language)
Gary Austin replied to Flashmaster82's topic in General Support
I'm just a beginner at ProcessWire, so not much help as I can't figure out your code/structure at a quick glance as it is structured so different than the way I'm using PW. On your first issue with the flag images, you really need to use the code with ul/li that flydev showed you. Going with a javascript select is really overkill for what you are trying to do as you do not really need a select at all. Just a ul with li's containing anchor tags and <img src="image url"> tag inserted before the $language-title piece. Then the the css to make it look like a select (which may work with the classes he provided, but I don't know that piece of code and where the css is coming from). -
Need help to output flag icon in drop down (multi language)
Gary Austin replied to Flashmaster82's topic in General Support
Not sure I fully understand what your asking. If it is basic template/pages then the template is passed the $page variable with all the fields and you just use it like you did in the 2nd line $page->phone. You don't load the page like you are showing in the first line as that will always get what ever /start/section1 is. -
Need help to output flag icon in drop down (multi language)
Gary Austin replied to Flashmaster82's topic in General Support
I don't believe background images for <option> work across all browsers, but it has been awhile since I messed with it. This is not PHP or Processwire, but basic HTML. You'll need to build your own select (like flydev's first example using <li>'s) or use a jquery or other type of javascript plugin. -
Need help to output flag icon in drop down (multi language)
Gary Austin replied to Flashmaster82's topic in General Support
Yes but in his example he was using <li>'s not <select><option> -
Need help to output flag icon in drop down (multi language)
Gary Austin replied to Flashmaster82's topic in General Support
I don't believe you can have image tags inside an <option> tag. I think you will need to use a replacement jquery plugin like select2, or create your own select using li's. Google "image in option select" and you will find suggestions on how to do this. -
So you should double check the url being used for your submit and probably post it here. What response code are you getting from the server?
-
When you first started this thread you were using Javascript ajax to send your post request... So someone showed how to use $config->ajax to check for request. In your latest example you are using a normal html form submit. To test for submit in that case you would use if ($input->post->submit). Javascript ajax and normal html form submit are sent in two different ways to server.
-
Does your mysql error log show anything at the time the error occurs?
-
Letting users "select" fields to add to a form
Gary Austin replied to louisstephens's topic in API & Templates
-
Letting users "select" fields to add to a form
Gary Austin replied to louisstephens's topic in API & Templates
As far as rendering, for PW side I just generate form html using inputfield rendering as I loop thru the json (converted to PHP array) and generate the form. I use this technique to generate a version of the form with the ability for the user to modify the option selects and add an extra field or two. As I said I merge those in with the "fixed" data for each type of note. I also use the same json form data to generate the form and organize the display of note data in javascript on the client side as this is actually for a web app. -
Letting users "select" fields to add to a form
Gary Austin replied to louisstephens's topic in API & Templates
I started with a big multi-level repeater field to allow adding an input, specifying its name and picking type (text,select,multiselect) and then adding options if allowed. I then saved this as a new template by writing json to a file with a name keyed to type of note. When the user selects to start a note I pull the corresponding json file and generated the form. I had planned to offer some option with repeater fields to users down the road for generating their own, but right now it is too difficult as notes have 30 or more input select fields with lots of options for each note. For now I allow a few customization options for each user that gets stored also in a json/text field and then "merge" with an existing note as I generate the final form. You could certainly just write the note html versus intermediate structure, but I needed an easy way to allow the user to change select options and the json structure allows me to match the original structure with the user customization at final generation. -
Letting users "select" fields to add to a form
Gary Austin replied to louisstephens's topic in API & Templates
So I have a bunch of templates that define fields for different types of "notes". I put them under a parent page and then use a Page Reference field on the parent page of the templates. The user can select from the templates using a radio box (I allow multiple options, but you could use other input options to just get one). I later then process their templates as needed by reading in the template page and processing it. To add a new template I just add a page and it is then available without having to edit the option box. I may also use a loop on the children of the template parent with my own code to generate the select options. This would allow the templates having an extra value to indicate which group of user can see them. In this case a page reference field would not work easily (that I know of) as I want to filter the templates based on the "type" of user or some other property the user has. -
.htaccess RewriteRule HTTPS mod causing 404 errors
Gary Austin replied to dweeda's topic in Security
If you have not googled "404 only home page working processwire" there are many threads discussing various issues, most involve .htaccess not working and sites in subdirectories.