Jump to content

bernhard

Members
  • Posts

    6,221
  • Joined

  • Last visited

  • Days Won

    308

Everything posted by bernhard

  1. just tried your module and i love it! great for my geowire project where i'm working on an update right now. i wanted to suggest a fullscreen mode, but i saw it's already on your roadmap... +1 for that. would really be great thanks for the awesome work!
  2. bernhard

    Poll site

    wow! didn't know about mapbox, thanks for that!
  3. great news! this feature is now in the core - and you can guess, ryans solution is far better than my initial module https://processwire.com/blog/posts/processwire-core-updates-pull-requests-and-more-2.5.25/#clear-page-cache-by-matching-pages-with-custom-selector again a great example of how processwire evolves from the needs of every single user. thank you teppo for taking this further! edit: how would i set the "has_parent" id to page id of the page that is being saved?
  4. i did something similar here: https://github.com/BernhardBaumrock/vagrant-pw-lamp/blob/master/bin/grabpw maybe it helps anyone who is as new to bash scripts as i am the part of creating the database is not needed in the new dev versions as this is already built in to core it is part of my vagrant lamp that i use for quickly setting up dev-environments on my windows machine. i really like it! but there are other threads in the forum about this topic... there's a lot more to find: https://processwire.com/talk/topic/9541-pw-cookie-cutter/
  5. of course i read the error message and of course i did investigate some time to find the problem myself... but "$page->setOutputFormatting(false)" as written in the error was not the solution - and i thought i've already done that by calling $np->of(false). fortunately your suggested $pages->setOutputFormatting(false) did the trick! the working code is this $pages->setOutputFormatting(false); $np = $pages->clone($pages->get('/original/'), $pages->get('/original/'), false); // creates a copy of "original" as a subpage of itself $uid = uniqid(); $np->title = $uid; $np->name = $uid; $np->save(); $pages->setOutputFormatting(true); $pages->of(false) did NOT work btw! and i didn't find $pages->setOutputFormatting() anywhere in the docs so i thought it were only for single-page instances ($page). anyway - thanks for the solution!
  6. thank you macrura, but that's not the problem: i have this simple code <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $page->title; ?></title> <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" /> </head> <body> <h1><?php echo $page->title; ?></h1> <?php if($page->editable()) echo "<p><a href='$page->editURL'>Edit</a></p>"; ?> <?php $np = $pages->clone($pages->get('/original/'), $page, false); $np->of(false); $uid = uniqid(); $np->title = $uid; $np->name = $uid; $np->save(); ?> </body> </html> and this is the problem (please see the 1:48min screencast) http://screencast-o-matic.com/watch/coeYbres8Q
  7. sorry for the double-post - nobody an idea? i can imagine that i will need this quite often in future so it would be really important to know how to do this right!
  8. https://processwire.com/talk/topic/5189-pagination-markup-question/ https://processwire.com/talk/topic/5145-paginator-and-seo/ helpful? check the search-link in my sig and welcome to the forum and thanks for bringing this topic to my attention
  9. had the same problem some days ago - clever trick with the hidden field! thank you horst but wouldn't "saveready" be too late for populating the field? shouldnt it be populated at the very first impression of the form?
  10. sorry for being not exactly on-topic but how can i close a fieldset? never used them and wanted to try it reading this thread...
  11. can't you put your images under a new parent (eg /data/images) and then reference it via a pagefield in your repeater? do repeaters support pagefields? I'm always using pagetable instead of repeaters of course that would not be very fancy and maybe cumbersome - but maybe it is ok for your case?
  12. i have problems cloning pages with pagetable field via api... i get the following error: Error: Exception: Can't save field from page 1039: /original-page-1/: Call $page->setOutputFormatting(false) before getting/setting values that will be modified and saved. [Page::statusCorrupted] fields: pagetable (in /var/www/html/wire/core/Pages.php line 1272) #0 [internal function]: Pages->___saveField(Object(Page), 'pagetable', Array) #1 /var/www/html/wire/core/Wire.php(366): call_user_func_array(Array, Array) #2 /var/www/html/wire/core/Wire.php(321): Wire->runHooks('saveField', Array) #3 /var/www/html/wire/core/Page.php(1272): Wire->__call('saveField', Array) #4 /var/www/html/wire/core/Page.php(1272): Pages->saveField(Object(Page), 'pagetable', Array) #5 /var/www/html/wire/modules/Fieldtype/FieldtypePageTable.module(216): Page->save('pagetable') #6 /var/www/html/wire/core/Wire.php(388): FieldtypePageTable->hookPagesCloned(Object(HookEvent)) #7 /var/www/html/wire/core/Wire.php(321): Wire->runHooks('cloned', Array) #8 /var/www/html/wire/core/Pages.php(1627): Wire->__call('cloned', Array) #9 /var/www/html/wire/c This error message was shown because you are logged in as a Superuser. Error has been logged. code used on a test-setup in "home" template (so $page = /home): $np = $pages->clone($pages->get('/original-page'), $page, false); $np->of(false); $np->title = 'New Page'; $np->name = 'newpage'; $np->save(); without the pagetable field everything works fine. using the ProcessPageClone module and clicking on "copy" also works fine! any help would be very appreciated I'm using dev 2.5.22 - though i don't think it is related to the pw version
  13. hi heldercervantes, welchome to the forum. regarding the listing part of your question: there is a commercial module that does your request very well: https://processwire.com/talk/store/category/9-listerpro/ regarding your 2nd part of the question: don't know exactly what you mean by "profile page". but overall it sounds a bit like you are thinking in a way like you would do it with another CMS... organizing your admin-interface in tabs and lists and so on. processwire is quite different on this part! you have everything organized in your pagetree. everything has its place there and if not really needed nowhere else! for example if you had a blog setup. in drumlapress you would have a tab "blog" anywhere in your admin and manage your blog-entries there. then you would have to setup a menu-item listing all your blog-entries. in processwire you would create a page "blog" in your tree, holding all of the blog-entries as children. home '- blog '- post1 '- post2 so if you or your client wanted to create a blog-entry you would just have to click on "blog" and then "new". in my experience this is much easier to understand for the clients than setting up articles and then linking them in the menu. of course in PW you would have to exclude all blog-posts from getting listed in the menu - but thats very easy by using a selector like "template!=blogitem" hope that helps a little i hope it is not offtopic but structuring your content is the key to success in PW
  14. maybe the problem is that the geocoder didn't find your address - try adding a space here: $page->map->address = $node->StrasseNr.", ".$node->Plz." ".$node->Ort; // use this $page->map->address = $node->StrasseNr.",".$node->Plz." ".$node->Ort; // instead of this of course use $page = $page->get( your page to edit ) instead of $page = new Page()
  15. never heard about the 5r/s limit - may be new, thanks for the hint... anyhow, never had any issues with it! but if anybody thinks he is violating google he could also use a free geocoding service (see example) i just tried <?php for ($i=1; $i <= 200; $i++) { $p = new Page(); $p->template = 'basic-page'; $p->parent = $pages->get('/'); // set parent to root $p->name = "Wagramer Strasse " . $i; $p->title = 'Wagramer Straße ' . $i; $p->map->address = 'Wagramer Straße ' . $i . ', Wien'; // populate the mapmarker field in basic-page template // optional: use any other geocoding service like mapquest should be very easy: // http://stackoverflow.com/questions/18661189/getting-data-from-json-using-mapquest-and-php $result = '...'; // then populate lat/lng manually $p->map->lat = $result->lat; $p->map->lng = $result->lng; $p->save(); } ?> and it worked without any problems. took some seconds of course... but if you only need to geocode the addresses once that should not be a problem. @iNoize how did you populate your address fields?
  16. thats not true, google maps geocoding api has a limit of 2.500 requests per day - so you are good here: https://developers.google.com/maps/documentation/geocoding/?hl=de#Limits will come back with a possible solution later...
  17. i don't understand most of what you are talking about - BUT: i understand most of what i am doing with processwire thats what i love about processwire! you don't "see" things that you don't understand and therefore don't need to see. that starts with the admin-interface treeview and continues when you start looking to the file system and furthermore into the code. i just wanted to point out that for a non-professional coder like me these are really important benefits! i like the way PW addresses also beginners and at the same time makes it possible to dig deeper into it if you want to and if you are ready! not before. that said from someone who has created his first hooks some days ago ps: of course i also love discussions like this one on the forum reading about things that i can maybe think of some day.....
  18. thanks - a pity that i didn't google for "weird UI display glitches (with screenshot)"
  19. you are absolutely right - how did you find this out? any way of debugging such things?
  20. i have the same problem here: http://scw.zwergo.net/verein/sportplatz/ i think it comes from one of the jquery plugins but no time at the moment for further research...
  21. meanwhile there's already an option in the htaccess: https://github.com/ryancramerdesign/ProcessWire/blob/master/htaccess.txt#L133
  22. @horst you can add such functionality to your map via google maps api. https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple @Mats nice! @awebcreature i have no experience with this using google maps but using openlayers. of course that's quite a beast regarding complexity and file size - here you have an example: http://openlayers.org/en/v3.2.1/examples/draw-and-modify-features.html. you can also achieve that with the simpler framework leaflet - there are plenty of plugins like this one you would need I'm thinking to create such a module for my master thesis - but you are 2 years early, sorry maybe you find some helpful code in my processwire mapping project "geowire": http://geowire.org/
  23. sorry, no experience in using PW api outside of PW, but i bet being more precise on that I get an error. would increase your chances of good answers
  24. bernhard

    Regexp Help!

    just found another great tool with very different approach! look at this example of a regex to find emails: ^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$ http://ysono.github.io/pegrex/#47%2C%5E(%5Ba-z0-9_%5C.-%5D%2B)%40(%5B%5Cda-z%5C.-%5D%2B)%5C.(%5Ba-z%5C.%5D%7B2%2C6%7D)%24 to be honest i don't understand the tool at the bottom, but i love the graphical mockup of the regex
×
×
  • Create New...