Jump to content

bernhard

Members
  • Posts

    6,648
  • Joined

  • Last visited

  • Days Won

    365

Everything posted by bernhard

  1. hi adrian, that is great!! i was also a little uncomfortable with the pagetable and external parent setup. are there any issues regarding pagination or will this also be solved when numChildren is hookable?
  2. hi naldrocks98, on the api side image fields are always multi no matter what the settings say! $society->society_logo->removeAll(); // add this line $society->society_logo->add("http://www.thefilipi...ogo/accp.jpg"); $society->save(); explanation by ryan: https://processwire.com/talk/topic/2597-multiple-image-bug-when-using-api-resolved/?p=25452
  3. ah, of course! thank you changed it to this: $form->insertAfter($button, $form->get($field)); edit: got an error on unpublished pages so i excluded the button there: $process = $event->object; $form = $event->return; $page = $process->getPage(); if($page->is(Page::statusUnpublished)) return; // added this line
  4. hi LostKobrakai, thanks for that cool snippet of code! I will use it on my next project. unfortunately the button appears an all tabs of the admin (also on children, delete, settings...). how can we hide the button on the other tabs?
  5. thank you soma, that's a quite recent post - don't know how i missed that! it's not exactly what i wanted but as i'm thinking a bit of it i think sorting by filename makes possibly more sense than sorting by upload time. images from cameras will always be named ascendingly and with your linked solution also the manual sort feature is preserved! thank you
  6. hi soma, of course i've already searched the forum: https://processwire.com/talk/topic/5362-explicitly-set-image-sort-order/ https://processwire.com/talk/topic/5168-zipupload-images-and-sortorder-in-imagesfield/ especially this one: https://processwire.com/talk/topic/4587-sort-images-by-title-in-image-inputfield/ but i don't think that's a really good solution because you would totally lose the manual sorting feature from the backend if i am right?! wouldn't it be better if the images were stored in the same order they were uploaded? the problem is, that the images are different in filesize so on upload some images will be faster on the server than others and therefore "overtaking" them during ajax upload. i think the core image field should somehow store the initial order on the client side and map that on the server side. what do you all think? have you never had issues with changed sort order in your image fields?
  7. this is a general question to core image field usability what i have always found a little bit annoying was that on uploading images via ajax the sort order is changed: any ideas how this could be fixed? it is not really nice if one uploads images from an event and the closing ceremony appears before the event's beginning... uploading files as zip would work, but that's no option if you want to upload files for an image gallery as the zip would likely grow over the maximum allowed filesize rapidly.
  8. You can also do a var_dump($event); die(); in the module to see its content or use $event->return or $event->arguments if $event alone does not work
  9. hi roman, welcome to the forum sorry i forgot to update the description after updating the module to version 2!
  10. bernhard

    Logo carousel

    Please share how you got slick to slide your images permanently like shown in the example
  11. i offered msummers to take a look at his files and i think i got everything working. thats what i did: did a clean 2.3 installation copied the old site-folder to the new installation (overwrote existing files) replaced the database looked up admin url (db table "pages" id = 2 showed "sample" so admin url was example.com/sample/ ) find out username of superuser and reset password $admin = $users->get(41); $admin->setOutputFormatting(false); $admin->pass = 'admin'; // put in your new password $admin->save(); echo $admin->name; die(); backup working 2.3.0 site (files+db) copied ProcessWireUpgrade to modules folder and installed it... error: Error: Cannot call constructor (line 85 of /var/www/html/site/modules/ProcessWireUpgrade/ProcessWireUpgrade.module) renamed wire -> wire2.3.0 index.php -> index2.3.0.php .htaccess -> .htaccess2.3.0 downloaded pw 2.6.1 and put into old site: wire index.php .htaccess installed processwireupgrade module installed site profile exporter and exported 2.6.1 site profile with data from old page old version had a custom admin - don't know how/where to activate this in 2.6.1 as it shows the standard admin again. have no more time to investigate further, sorry.
  12. Very interesting Adam do you have any benchmarks compared to the standard template cache or to no cache?
  13. database backup/restore seems to be 2.5+ so it could get a little tricky to get the old data into the new installation. i would go with kixes solution but start over with a blank profile i'm still confused what was the problem with only using all the files + db dump... good luck and also welcome to the forum
  14. I would do a blank Installation of a pw 2.3 (you find the old versions on github) and change the site folder like explained above. A new installation is a matter of minutes. Trying to replace the profile is more pain I think. When you have your 2.3 site running I would install http://modules.processwire.com/modules/process-wire-upgrade/ (it says it is compatible with 2.3) and let it do the upgrade for you
  15. i think he wants to get the version of the old installation which is not running (only html + sql, right?)... you can find the old version number here /wire/core/ProcessWire.php: 32 class ProcessWire extends Wire { 33 34 const versionMajor = 2; 35 const versionMinor = 6; 36 const versionRevision = 1; was also my guess but i don't know to be honest. i would try it with blank-profile. good luck! edit: in admin you see the version on the bottom left corner
  16. today i had the problem that loadHTML added doctype, html and body elements to my modified string. see http://stackoverflow.com/questions/4879946/how-to-savehtml-of-domdocument-without-html-wrapper this worked for me: if(!$str) return; $dom = new DOMDocument(); $dom->loadHTML(mb_convert_encoding($str, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NODEFDTD); $div = $dom->createElement('div'); $div->setAttribute('class', 'table-responsive'); foreach ($dom->getElementsByTagName('table') as $item) { // clone the wrapper div $div_clone = $div->cloneNode(); // replace the table with the div $item->parentNode->replaceChild($div_clone, $item); // put the table into the div $div_clone->appendChild($item); // set table class $cls = $item->getAttribute('class'); $item->setAttribute('class', 'table table-striped ' . $cls); } $str = $dom->saveHTML(); $str = str_replace("<html><body>", "", $str); $str = str_replace("</body></html>", "", $str); i'm wrapping all tables inside responsive divs and making them look nicer with the "table-striped" class
  17. can't replicate it google maps api response is also ok: https://maps.googleapis.com/maps/api/geocode/json?address=S6%201ND
  18. have you added google maps to your frontend <head>? <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?sensor=false'></script> if yes: maybe you can show us some code?
  19. Thank you! 1) thanks, did read it and together with the blog post it was very helpful: https://processwire.com/blog/posts/new-module-configuration-options/ 2) thank you! 3) damn... i looked at this file but didn't see the info in the comments
  20. thank you mike! where would i find this info on my own? i looked into several modules on github but didn't find it anywhere... i knew i've read it somewhere but couldn't remember... are there any docs? or in which file would i have had to look into to find all available options? or could i've done a var_dump() or something?
  21. thank you mike! does anyone know how i can define the minimum processwire version? is it possible? i used the new config method from pw 2.5.5 https://processwire.com/blog/posts/new-module-configuration-options/ so i guess it's only compatible for PW2.5.5+ and i would like to add this information somewhere...
  22. hi fliwatuet, sure you can, but you will have to do some research first to get the idea of how access control works in PW http://lmgtfy.com/?q=site%3Aprocesswire.com+users+and+access
  23. update version 2 i was not sure where to put the images folder to be honest. changed it to /site/templates/TemplatePreviewImages - added 2 fields to configure width + height resizeing is done via jquery because i did not know how i would change the CSS dynamically based on module configuration. i tried to create a style.php instead of custom.css but that one was blocked (i guess by the pw htaccess?). thank you for your suggestions lostkobrakai
  24. hi everyone, i'm happy to share my first little module that could have broader use... use at your own risk! i'm quite new to module development Usage Just install the module and place your preview images in the folder /site/templates/TemplatePreviewImages filename = template-name.png Github https://github.com/BernhardBaumrock/TemplatePreviewImages Notes jquery image picker used in this module (MIT license): http://rvera.github.io/image-picker/ Room for improvement / roadmap: Images are resized via CSS (height: 200px) Images could be placed via masonry or the like create image-field to upload preview images directly to the template looking forward to hearing your feedback ps: is it intentional that i am only allowed to choose from 2 templates when adding the page and have more options available when editing the template settings of the page like you can see in the video? i'm wondering why this should be like this?!
  25. hi ngrmm, you can also make it dynamic to not rely on the id 1019 like this: $page->parent->children->first() // instead of $pages->get(1019)->children->first()
×
×
  • Create New...