Jump to content

bernhard

Members
  • Posts

    6,670
  • Joined

  • Last visited

  • Days Won

    366

Everything posted by bernhard

  1. 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
  2. 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>
  3. 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...
  4. please keep us informed about your solution
  5. 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
  6. 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
  7. 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!
  8. can anybody confirm that images don't display when you have them in the first column? v2.5.19
  9. thanks, didn't search it there because in the breadcrumbs it says "Home > Dev Dir" so i was guessing its a top-level item
  10. 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
  11. 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/
  12. nice overview on using/switching to ssl:
  13. that's true but will not be the case in my project. any better ideas for solving my usecase from the first post?
  14. thank you! updated
  15. i created a little module that does the trick, maybe it's helpful for anybody else: https://github.com/BernhardBaumrock/ProcessWireModules/blob/master/ClearCacheForDescendants.module does the "clear cache for children" option of procache clear only children pages or all the descendants?
  16. that's what i guessed - thanks for confirming
  17. thanks for wireRenderFile until now i was doing this like it is done in the blog profile: https://github.com/ryancramerdesign/BlogProfile/blob/cca31ebb7ec10f7614044156161abe3042abbbed/templates/categories.php#L20 drawback was, that the api variables where not directly accessible in the template file ( wire('page') instead of $page ). is there any reason why the blog profile uses a different approach?
  18. thanks again - i had a backup and restored the folder from there. as i said - was just curious and will not delete those files next time
  19. thank you - that's not an option if you deleted those files and folders like i did anyway - the issue was not related to pw 2.5.17/18 but i was just curious if there was a way of downloading those "versions"
  20. is there any way to get all the 2.5 dev realeases listed like in the link above? some days ago i had an issue with 2.5.18 and wanted to roll back to 2.5.17 but there was only 2.5.18 available on github
  21. I'm using EMO for this: http://modules.processwire.com/modules/email-obfuscation/ sorry didn't read your post carefully, but no problems with emo so far
  22. i think this shoud find its way into the docs - no word about that: https://processwire.com/api/variables/page/ but how? stumbled over this today and once more found the answer quickly in the forum but anyway, i'm sure there are others not knowing about this different behaviour of counting children...
  23. nice to know that procache has this option steven thank you
  24. Current options For a new project going online very soon i would need an option "clear cache for the saved page and its children". should not be that complicated to implement? i'm wondering why this is not already built in - didn't this need come up before? use-case: i have a catalog-like site structure. for every page i have a point of contact (POC) to choose. if nothing is chosen, it will show the POC of the parent page (recursively). that way i can define POCs for whole sections at once - with the only problem that when caching is turned ON and the client changes the POC of one category the POC will still remain on the cached children maybe anyone can point me to the right direction for hooking or forking this request on github? thanks
  25. hi gebeer, also doing some ab testing here how did everything work out for you? http://stackoverflow.com/questions/579450/load-testing-with-ab-fake-failed-requests-length any insights in that aspect?
×
×
  • Create New...