Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by bwakad

  1. I could use some help in suggestions upon a process flow. The registration currently only add the user page for login purpose. I know the member page (with username) can be created at the time before actually creating the user page. Right now I keep things separate in this way (not to be confused with page tree): GUEST - registration (add user page) MEMBER - login - logout - delete (should also delete member page if present) PROFILE - add details (add member page) - change details So after a user registered, they can go to the profile submittance form, and after submittance, member page is created. Now, how do I prevent the member for browsing other members until his/her member page is created? isloggedIn() will not be good for this. Or do I create user AND member page upon registration BUT set status on member page to hidden, how? Still, I would need to prevent this member from browsing.
  2. I am happy! at least for now...using the google api3 autocomplete through a plugin. Now my form has: - address field, which autocomplete as soon as someone starts typing. - 3 disabled input fields, that automatically catch this input as Country, Division and City, before submitting the form. Upon submit, I can now: - check if these values exist as a page, and if not, create it - OR - simply use these values in a member profile field. (have to deside on this) - Do I really need to create pages for this I can search by $page->name/title OR by $field->value... Benefit of the API - that it can also check a users location. For instance, if I had a user providing information like being in USA, but according to API is in Europe... - I could simply catch this value hidden, and display this value on it's profile saying "false location provided ....etc".
  3. Okay, so what I understand is: 1. I need to create the field, choose Page, select a parent-page, then choose single. multi, or any other... 2. I then add it to the template. 3. Go to the page I want to add page reference to 4. and select the pages that need referencing. ---
  4. I think for many this is a stupid question, but what exactly is a Page Reference Field and how do I create one? Was trying to see if there was a special field for that upon creating a new one. Also checked modules. But really, could not find it...
  5. I believe there are some moduls for importing / porting... Never done it like that. And I would not know if you would have to create your structure first or adapt it later. Look in the modules - forum and area.
  6. Okay, I have a dillema... I need to have Country > Province > City for a registration form. But to set up all those values is a bit too much. My approach is to limit the countries and expand as time goes by. I also want to limit the tree up to province/state/county UK : county | NL : province | US : state. But the all mean the same thing!... I named it "location". Adding cities is as I said way too much, and I thought maybe postal codes, but that presents the same problam as just entering cities. so I was thinking, maybe the MapMarker module is good for that. Now I have 2 select fields in the form: country and location. Those are binded by .js to give the right locations of the country. I understand I can add a input field to my form and have it saved as $page->marker->address = 'Miami'; At least after saving I would like to add this name in the tree (somehow) so I can use it in future with autocomplete (if possible). And is it possible to limit this address field to the country and location selected?
  7. Just checked: http://processwire.com.statstool.com/ At first it was a page from a year ago. After the update, value went down, traffic went up. Amazing facts though. But I am afraid Ryan has to sell his house. lol
  8. Adrian, your module is good. - EDIT - on pasting JSON It was because I pasted the snippet above but forgot to change template name. I chose, Import > Append > Paste Json. And received Invalid value sent to Page::setTemplate Only thing was, it did not remember the entry, and no back button. Had to choose again: setup > migrator. Then do it all over. When I changed the template name (from andora) it all works fine... although I chose parent "countries" which created a "countries" as child. So your module is working great! - EDIT - on shared JSON On shared JSON, one thing... it says I have to select 1 level up. Confusing. countries > US > still empty here US-states > state-names (imported correctly) when I redo everything and choose as parent : countries > US I received SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'alabama-1987' for key 'name_parent_id' which is strange since this should be assigned a new ID.
  9. lol. Just looked up something I frequently use upon normal mail.... postal code / city : 1338 AM 30, Almere or sometimes: 1338 AM 28 or streetname 22 Almere Which all represents Almere-Buiten and get's delivered by our good employees of postal offices!
  10. Okay, that's cool. I have taken the liberty of pasting part of your data to see how it's done. I am not sure about the parent name (empty), I think status and sort are PW build in. I believe 'sort' is the order in which it appear in the tree. Will try to import this as json to see what happens.... - EDIT - after some errors on my side (template name / parent name) This one is a great module! If there was a convention of names, everyone could export and post it on the git to be re-used for import. For instance, if everyone say "countries" for the parent page, and "country" or "country_template" for the children, things were easy to share in this community. Like JSON, functions among others... {"pages":[ {"name":"countries", "parent_name":"", "page_template":"countries", "status":1, "sort":6, "sortfield":"title", "data":{"title":"Countries"}}, {"name":"andorra", "parent_name":"countries\/", "page_template":"countries_items", "status":1, "sort":0, "sortfield":"sort", "data":{"title":"Andorra", "iso_2":"AD", "iso_3":"AND", "iso_numeric":"20"}} ]}
  11. lol. the keyword here is: province and municipal - or in dutch : Provincies en Gemeenten (towns and villages get overrated)... Example, if I send a letter, I would use the Gemeente, not the part like town / village. YES: Almere NO: Almere-buiten, almere-binnen, almere-haven, etc. As far as I know, there are about 403 gemeenten in NL.
  12. I am curious to know what the format is for the json: parent / childpage / subpage all by title
  13. @sinnut: You right about that. I have thought about how to get to a destination Country/Province/City - And it's getting ridiculous amounts of pages, just for that. But I do not see any other way. And if I think about PW - were a page is not really a physical page, it will be fine I guess. Considering people store this in database all the time. @adrian: thanks for the links, I am not sure about the link to php, but I think the module is good to use. If you are interested, I have a json format of brazil, up until cities.... really huge!
  14. I used those frequently for adding or changing quickly. But I am more looking for a way to bulk import a large quantity. Say for example Spain has 52 provinces (title only), and each province can have about 20+ childpages (title only). So even with CSV (pasting) I would need to do the same thing 52 times: 1. select template 2. select parent (wrestle through the tree) 3. go to my file 4. select and crtl c 5. go back to PW 6. scroll down again 7. click to open 8. ctrl v Can you imagine with batcher or the other one you mentioned, I would need to type and use TAB. Isn't there some automation to perform?
  15. read on>> http://www.bbc.com/news/magazine-27140505
  16. I know of the import module CSV / paste data. Basically it let me select a parent and required (in my case) a template. But how to import to make, 12 pages, each with 15 childpages, and inside that about 20 subpages. title for every page. But pages, childpages and subpages have different template. Now, I need to do the whole routine for (12x15) minimum. Exhausting!
  17. Dang! and I just made and assigned the templates. Which also work fine. Anyway, thanks Soma (new title for you > life-saver) I do have a question, because my posts (eventually lead to the same thing) but are scattered so much. I have the topics: "states and cities", "select - then auto values", and this one "trouble with selector". Is it possible to merge them and call it "Cascading / Dynamic Selects front-end". or something similar... The cascading is working between 3 selects, and only need to fine tune some parts...
  18. to answer first question: Maybe I should do it like this... country-template = for country names province-template = for province names city-template = for city names I could probably query for : "template=province, name=drenthe" fetch children. Even though the province-template holds more names from other countries. your second question: I use it to fill a select by the parent/child name - in this case "drenthe". Path from root is: /personal-info/countries/nl/drenthe/. So I am on any level... It's just that I do not know the /nl/ part. It could be fr, de, etc.
  19. Not really because children are nested inside each parent: Tree: - home - personal-info -- countries --- NL >>>>>>>>>>>>>>>>>>>>>>>>> same level parents DE || FR || etc. ---- Drenthe ----- child ----- child First I was thinking of a template for each country, but that would still leave me with a problem: NOT knowing the country name. The only thing I know IS the province name "drenthe".
  20. I am having trouble with a selector. In a normal way I would know the "country-name" and "province-name". So this would work: foreach ($pages->get('/personal-info/countries/country-name/province-name/')->children as $child) { But I only know the "province-name" for example "Drenthe". parent="/drenthe/" does not work, how do I get to those children? Tree: - home -- personal-info --- countries ---- NL ----- Drenthe ------ child ------ child
  21. According to documentation I have to create 2 var and then pass those in the data. The bind I am not sure of: $(function() { $("#country","#province").bind("change", function() { var country = "country":$("#country").val(); var province = "province":+$("#province").val(); $.ajax({ type: "POST", url: "/getcity/", data: {country: country, province: province}, success: function(html) { $("#city").html(html); } }); }); });
  22. Yes I did. The script is not inside head.inc or foot.inc, I used it with and without this line and still works (strange)... but in my foot.inc I have this : <script> $(document).foundation(); </script> And I want the script which I need for cascading, under that foot.inc script later... Just don't now if the foundation is already calling $(document).ready(function(){.
  23. Now for the third select (city) which is more difficult... I need to bind #country AND #province.... and then POST both values. But I am not really sure how to proceed with this. My selector will be: foreach($pages->get("/personal-info/countries/{$country}/{$province}/")->children() as $city) { <script type="text/javascript"> //$(document).ready(function(){ $(function() { $("#province").bind("change", function() { $.ajax({ type: "POST", url: "/getcity/", data: "country="+$("#country").val(), "province="+$("#province").val(), success: function(html) { $("#city").html(html); } }); }); }); </script>
  24. For some reason it now works with the code as is ! As I was looking for the $_POST return I thought, maybe the location of the file was an issue... Changed the physical location of "getprovince.php" - which did not work. I then placed the file back in it's original physical place. After that I thought, in /getprovince/ let me echo out $_POST["country"]. I went to the front end form and it was working. I then removed the echo statement again, and everything still works. VERY STRANGE ...........
  25. Maybe it has to do with the data: "country="+$("#country").val(), I read it as: $_POST['country'] = $country.val() should I change that?
  • Create New...