Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by bernhard

  1. you are absolutely right - how did you find this out? any way of debugging such things?
  2. 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...
  3. meanwhile there's already an option in the htaccess: https://github.com/ryancramerdesign/ProcessWire/blob/master/htaccess.txt#L133
  4. @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/
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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>
  10. looks great! can you also render the content of your field in frontend templates with code highlighting?
  11. 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...
  12. 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...
  13. 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
  14. thank you for your reply. could you please go a little bit more in detail on this? "archive process - not only cloned but also updated"
  15. i'll be building a site for a sportsclub very soon. there will be some players and some teams team a - player a - player b - player c team b - player a - player b - player xyz i wanted the players to be selectable via page-field so that changes to player a reflect to both teams a + b. so far so good - but the client asked for a way to archive data.... eg team a (2012, 2013, 2014...) so when i use pageclone to copy data to the archive there will always be the current picture + name + weight + height of all the players and that is not what the archive is meant to show. there should be a kind of history with "permalinks" any ideas how to approach this? maybe use pagecache and permanently save this file? but how to get the image+file data if there is an <img src="...assets...xy.jpg">? thanks in advance
  16. I'm using this function to load the addons together with the great AIOM module /** * loads css and javascript files by name of component from different css frameworks * * @param string component | name of component * @param string framework | name of framework, defaults to uikit * */ function styleAddon($component = '', $framework = 'uikit') { $min = '.min'; // you can set this empty for debugging switch ($framework) { case 'semanticui': // add css if it exists $cssFile = 'semanticui/components/'.$component.$min.'.css'; if(is_file($cssFile)) wire('config')->cssFiles->add($cssFile); // add js if it exists $jsFile = 'semanticui/components/'.$component.$min.'.js'; if(is_file($jsFile)) wire('config')->jsFiles_head->add($jsFile); break; default: // add css if it exists $cssFile = 'uikit/css/components/'.$component.$min.'.css'; if(is_file($cssFile)) wire('config')->cssFiles->add($cssFile); debug('added ' . $cssFile); // add js if it exists $jsFile = 'uikit/js/components/'.$component.$min.'.js'; if(is_file($jsFile)) wire('config')->jsFiles_head->add($jsFile); debug('added ' . $jsFile); break; } } /** * converts the style/script object to an array * * @param string component | name of component * @param string framework | name of framework, defaults to uikit * */ function toArray($obj) { $arr = array(); foreach ($obj as $key => $value) { $arr[] = $value; } return $arr; } /** * log value to javascript console * * @param string text | error message * */ function debug ($data) { // show debug only in debug mode if(!wire('config')->debug) return; echo "<script>\r\n//<![CDATA[\r\nif(!console){var console={log:function(){}}}"; $output = explode("\n", print_r($data, true)); foreach ($output as $line) { if (trim($line)) { $line = addslashes($line); echo "console.log(\"{$line}\");"; } } echo "\r\n//]]>\r\n</script>"; } of course you can remove all the debugging... i found it in the forum and for me it was helpful then in your main markup file: // stylesheets and javascripts $config->cssFiles = new FilenameArray(); // javascript files $config->jsFiles_head = new FilenameArray(); $config->cssFiles->add('uikit/less/themes/default/uikit.less'); // you can use the css version of course styleAddon('lightbox'); styleAddon('slidenav'); styleAddon('dotnav'); styleAddon('slideshow'); styleAddon('notify'); styleAddon('sticky'); // convert css/js object to array for all-in-one-minify-module $cssFiles = toArray($config->cssFiles); $jsFiles_head = toArray($config->jsFiles_head); ?> <!-- load css and javascripts --> <link rel="stylesheet" href="<?php echo AIOM::CSS( $cssFiles ); ?>"> <script src="<?php echo AIOM::JS( $jsFiles_head ); ?>"></script>
  17. ok, this issue comes from the array notation! $array = array($foo, $bar); // is ok $array = [$foo, $bar]; // only php version 5.4+ had this issue today with a different module so i thought it was not specific to this module and did some research...
  18. couldn't try it, because i got this error when i tried to install it Parse Error: syntax error, unexpected '[' (line 20 of /httpdocs/site/modules/FieldtypeFontIconPicker/FieldtypeFontIconPicker.module) pw 2.5.17
  19. hm.. you're right, those links would maybe feel strange beside the image - but i don't have those links in my setup. it just opens a modal to edit the item and that would totally be ok with a linked image in my opinion
  20. with the new dev 2.5.19 there is a problem with this module. i think it must have something to do with the new image handling with retina support: https://processwire.com/blog/posts/new-image-editing-features-2.5.19/ the image is double size on the "wow, that looks great" screen and also on the frontend when displaying via ->getThumb() nevertheless thank you for this great module!
  21. can anybody confirm that images don't display when you have them in the first column? v2.5.19
  22. thanks, didn't search it there because in the breadcrumbs it says "Home > Dev Dir" so i was guessing its a top-level item
  23. is it by intention that the directory is not linked anywhere on processwire.com ? or is it already and i can't find it? what about: "try the demo" - "download latest stable version" - "become/find a developer" still alone in my country btw
  24. hi ndolph, does this help you: http://www.flamingruby.com/blog/processwire-weekly-13/#1-2 https://processwire.com/talk/topic/4822-ckeditor-justify-plugin-walkthrough/
  • Create New...