Jump to content

Gary Austin

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by Gary Austin

  1. 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?
  2. 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.
  3. 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).
  4. 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.
  5. 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.
  6. Yes but in his example he was using <li>'s not <select><option>
  7. 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.
  8. 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?
  9. 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.
  10. Does your mysql error log show anything at the time the error occurs?
  11. Here is the setup page for a note showing one field under a category. Each can be repeated.
  12. 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.
  13. 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.
  14. 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.
  15. 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.
  16. I was overriding the css incorrectly I guess the first time (was trying to use add/removeClass). Using $form->setClasses(array('form'=>'uk-form-horizontal InputfieldForm')); did the trick.
  17. I tried overriding CSS of the form as the first approach and that did not work. Basically all the elements have not just standard uikit css, but also Processwire css and changing the form CSS caused lots of other elements to break. I might look into creating a new input/field type with all my fieldsets and text inputs in one field as I do store the final value. Otherwise I'm almost done just not using the API and using a custom admin page.
  18. Oh, Yeah. I know uikit inside out now as I'm doing a webapp using it. No problem with doing my own forms, was just hoping I could tweak Processwire admin forms in the back end.
  19. I have an admin page I want to build with 6 fieldsets of between 6 and 20 text fields each. I really want the input labels to be inline with the actual input entry field to make the forms readable. I'm using the uikit admin and it has a horizontal form option for doing so, but it seems processwire wants to lock down the vertical form option which puts label on top of input. I can't find any api call to change or force this. I'm actually taking all these fields and generating a single json field to be stored in the database. Right now I'm bailing on the processwire form/field api and just going to hard code my own form and field sets, but would appreciate any advice if I am missing an api call to change the layout of labels/inputs on "back" pages. Thanks
  20. Over the past few weeks I had two new Processwire sites I switched to https using SSL certs from Letsencrypt. I had to deal with numerous settings and things with Linux, Apache and my DNS settings (running on a Linode), but at the actual "processwire level" all I had to do was change .htaccess # ----------------------------------------------------------------------------------------------- # 9. If you only want to allow HTTPS, uncomment the RewriteCond and RewriteRule lines below. # ----------------------------------------------------------------------------------------------- RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] So i can confirm just changing those two lines is sufficient and all pages work. Not much else I can offer, other than you need to look elsewhere for issues than just those two lines in .htaccess
  21. That is the exact issue I was up against and searching did not turn up that thread...
  22. Hmmm.. I run an Invision Board site and can edit posts, but I guess here is either not allowed for "Newbies" or at all. Anyway @adrian is what I wanted to add to my post. Edit: I see it must be short time limited...
  23. I'll read it. I'm actually triggering a <form method="post" with jquery to send a post variable with my PDF data. Finally saw 301's and then 200's with no post data and knew something was going a stray...
  24. I know I'm just a "beginner" with Processwire, but just spent hours trying to debug downloading a PDF with a post variable providing the data for the PDF. I must have missed somewhere the need for a trailing / after the page name to get post variables. Googling lots of stuff on templates/ posts/pdf/ etc and finally saw a few threads on the / at end of url meaning something. Added that and now I get my post data.... I don't like having to have a / at the end of the url the customer will see, but at least I can move forward now. Hopefully I missed something obvious... Anyway this forum area is entitled the Pub, and I certainly need a drink.
  25. Assuming $rate is the final string you will output later, you need to set $rate="" before loop and use $rate .= "<sp...." in the loops. the '.=' is the key.
×
×
  • Create New...