Jump to content

bernhard

Members
  • Posts

    5,624
  • Joined

  • Last visited

  • Days Won

    257

Everything posted by bernhard

  1. 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
  2. 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?
  3. 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...
  4. 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?
  5. 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
  6. 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
  7. 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()
  8. 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?
  9. 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...
  10. 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.....
  11. thanks - a pity that i didn't google for "weird UI display glitches (with screenshot)"
  12. you are absolutely right - how did you find this out? any way of debugging such things?
  13. 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...
  14. meanwhile there's already an option in the htaccess: https://github.com/ryancramerdesign/ProcessWire/blob/master/htaccess.txt#L133
  15. @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/
  16. 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
  17. 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
  18. i'm not sure if i understand your questions correctly... do you mean something like this? $items = $page->children('limit=10'); foreach($items as $item) { echo '<h1>' . $item->title . '</h1>'; echo $item->body; echo $item->whatsoever; } echo $items->renderPager(); is this question related to your first question? are you looking for truncating text?? https://processwire.com/talk/topic/2849-text-output-limiter/?p=71561
  19. bernhard

    Regexp Help!

    besides regex101 i found also this tool helpful: http://regex.larsolavtorvik.com/ live result for preg_match_all, preg_match, preg_replace, preg_split and copypaste-ready codeline
  20. of course, but i thought maybe there's a simple way to take use of the code highlighting that comes with this module. something like $ace = $modules->get('ace...'); <script src="<?= $ace->gethighlightjs() ?>"></script> <div class="php"> <?= $page->phpcode ?> </div>
  21. looks great! can you also render the content of your field in frontend templates with code highlighting?
  22. thanks arjen - i like the idea of showing a team history to every player and (as almost always) this would be very simple with PW and the approach above i'm only thinking of how to identify the players exactly because when cloning the pages i don't like identifying them by ->find('name=xy') as there could be players with the same name. maybe i'll create an additional field name+birthday or just use any unique hash...
  23. I've already done locking pages via api, thank you - at least this will be no problem thanks also for the link regarding forms! should be able to try this next week...
  24. thank you! seems like cloning all data to an archive and updating all references would be a good option. and i think that will be a good usecase for my first processmodule - i'll try to achieve this with the help of process hello
×
×
  • Create New...