Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/11/2016 in all areas

  1. Function Following tpr's request here, this module allows Radio Buttons in the admin interface to be deselected. Links Github Module Repository (once moderation has taken place) Version History 1.0.1 Merged tpr's mods 1.0.0 Initial Release
    7 points
  2. This is a very beta version of the separate functions I use to generate srcset/bgset markups. There's some similar functions floating around in the forum but this one is a bit different because you can set "named image sets" which you can use easily site-wide. It's definitely work-in-progress so use it at your own risk. MarkupSrcSet Generate srcset and bgset markup for lazysizes. Features generate srcset/bgset markup for lazysizes set image sizes in JSON array add required JavaScripts automatically (optional) fallback to smallest image size if JavaScript is not available Usage Image sets JSON (in module settings): { "hero": [ [640, 210], [1080, null], [1920, null] ], "featured-image": [ [360, 240], 1.333, 2.667 ], "gallery-thumb": [ [240, 120], [480, 300], [800, 576] ] } Image methods $image->srcset(): <img <?php echo $page->featured_image->srcset('featured-image'); ?>> $image->bgset(): <div <?php echo $page->images->first()->bgset('hero'); ?>>Lorem ipsum</div> https://github.com/rolandtoth/MarkupSrcSet
    5 points
  3. I've got that covered for ProcessWire vs WordPress. Coming soon. It's very in depth.
    5 points
  4. Ok, another one for @netcarver // enable unchecking radio buttons // http://stackoverflow.com/questions/6191621/jquery-check-uncheck-radio-button-onclick#answer-13575528 $page->addHookAfter('render', function ($event) { if ($this->page->template != 'admin') return; $js = <<< HTML <script> $(document).ready(function(){ $("input:radio:checked").data("chk",true); $("input:radio").click(function(){ $("input[name='"+$(this).attr("name")+"']:radio").not(this).removeData("chk"); $(this).data("chk",!$(this).data("chk")); $(this).prop("checked",$(this).data("chk")); }); }); </script> HTML;
    4 points
  5. Problem originates from the use of __debugInfo() magic method that comes with v5.6. Try using PHP 5.5. Processwire + xDebug doesn't play well with PHP >= v5.6.
    3 points
  6. PageimageSizerImagick isn't compatible with PW greater than 2.5.11 ! It doesn't support the then (2.5.11) introduced naming scheme for image variations in PW. It was more like a case study. But maybe you can switch to PW 3 devns, there you will find support for Imagick PHP-Extension, ImageMagick-CLI and NETPBM-CLI supported. If you can do, you need to read upon how to "convert" CroppableImage to work with PW 3. KentBrockman and noodles have posted this into its support thread: https://processwire.com/talk/topic/8709-croppableimage/page-7#entry113941
    3 points
  7. Version 1.1.2 is released: http://mods.pw/BC - Updated packaged php-mf2 library to version 0.3.0 - Added config option to automatically monitor a page for approved vouch domains (see below). - Better authorship algorithm support. One of the bottlenecks for the Vouch protocol is "how do you easily manage the list of domains you will accept a vouch from?" In the 1.1.0 release, it was just a text field that you had to manually enter each domain into. As of version 1.1.1, there is a new config field “Vouch whitelist URL.” You can enter the URL of your blogroll or other whitelist. It will be monitored once a day and new domains will be added to the list of approved vouch domains. Links must use the h-card microformat. No domains will be removed from the approved vouch domains. This should help automate the approved vouch domains list. I'm trying this out on my own site currently: http://gregorlove.com/following/ If you're using this plugin, I'd love to hear from you! Feel free to send webmentions to this post: http://gregorlove.com/2016/02/quite-pleased-to-officially-release/
    3 points
  8. v002 is up on GitHub: https://github.com/rolandtoth/MarkupSrcSet
    3 points
  9. I just learned today that the website for "Zurich IT Days 2016" is made with PW. Sadly, it's not mentioned anywhere (except in a meta tag), but might as well be later on. This is just a preview: informatiktage.ch/ Still has a few bugs... unpublished events are linked, and some CSS bugs, but it's getting there. Each company that does workshops has a login to create and edit blog posts, event infos etc. I just have an editor admin login, can't see what modules have been used, but it looks promising. Wonder who built it... Edit: it has gone live now (changed dev to live URL above)
    3 points
  10. #1: Only Superusers can see the modules (listing) page #2: No (but I think you are referring to this? It (can auto-check but not auto-upgrade) - ProcessWire Upgrade
    2 points
  11. bernhard - I am rethinking this - I think that szabesz and horst make some compelling arguments - in particular I like the idea that Tracy can make your life easier when you're not at your normal dev machine, so adding this could be useful. Do you have a preferred solution? How did you set up what you have in that screencast? I was looking at: https://github.com/micheh/w3c-validator but was wondering if you were just passing a URL to an iframe of the w3c validator? I actually like the idea of being able to color the panel icon in Tracy depending on the report status, so I think something like that Github library might help in that. PS Mismatched html tags is a great example of a bug that should be dealt with, so from that perspective I think it might fit nicely with Tracy.
    2 points
  12. I decided to look into this. It's definitely related to PW 3 vs 2. For 3.x you need this instead: $hooks = array_merge(wire('pages')->getHooks('*'), wire('hooks')->getAllLocalHooks()); In Tracy I just used a conditional based on whether: wire('config')->version is >= 3
    2 points
  13. Perfmon Debug Toolbar is a Processwire module used in performance monitoring and optimization. This module has been kicking around for some time, but I finally got around to publishing it. The user interface is heavilly influenced by django-debug-toolbar if anyone is familiar with that project. During install, $config->debug must be set to true for the toolbar to run, the module is not intended to be enabled on production. The primary goal of the module is to identify bottlenecks and help tune up code. More information is here: https://github.com/KeeneState/DebugPerfmon Please let me know if you have any difficulty installing or running it. It's intended to be run on a development instance, though it can exist in a dormant state in production. Collapsed presentation (top right of screen): Expanded Presentation:
    1 point
  14. This is the way I use to integrate both worlds together. 1.- _header.php ( or whatever is called the file that contains your <body> tag ) <head> ... <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script> <script>var app = angular.module('myApp', [])</script> </head> <body ng-app="myApp"> ... 2.- yourTemplate.php <script> app.controller('myCtrl', function ($scope) { $scope.myvar = []; $scope.myvar = <?=getChildren("template=yourtemplatename")?>; console.debug("my Object form php",$scope.myvar); }); </script> <!-- now $scope.myvar is accesible --> <div ng-controller="myCtrl"> </div> 3.- getChildren is a function that I include in _func.php function getChildren($pageId) { $pagina = wire('pages')->get($pageId); // fields to be avoided $avoid = array("FieldtypeFieldsetOpen", "FieldtypeFieldsetClose","FieldtypeFieldsetTabOpen","FieldtypeFieldsetTabClose"); // fields that must be returned $wanted = $fields; // selector $paginas = $pagina->find($selector); $arr = array(); foreach ($paginas as $child) { $array = array(); foreach($child->fields as $field) { $array['id'] = $child->id; // if we dont' want all fields back if ( !in_array($field->type, $avoid) && in_array($field->name, $wanted) && (count($wanted)>0) ) { $array[$field->name] = htmlspecialchars($child->get($field->name)); } // we want all fields back if ( !in_array($field->type, $avoid) && (count($wanted)==0) ) { $array[$field->name] = htmlspecialchars($child->get($field->name)); } } array_push($arr, $array); } echo json_encode($arr); }
    1 point
  15. Function Allows all admin-side text areas to auto-expand as they are used. Description Following on from tpr's mini-tutorial, I went ahead and wrapped it up as a module. I'm re-posting it here in the module's forum and will submit it to the module repository to prevent it from becoming one of PW's "ghost" modules - modules for PW that exist on github (or elsewhere) and have a relatively obscure link from the forum or a blog post somewhere else. Links The module on Github. The module in the module repository. Version History 1.0.0: Initial release.
    1 point
  16. Hi @adbus - many thanks for the heads-up. I googled around and it seems that there was some kind of xdebug issue with __debugInfo() that was fixed in 2014 and there seem to be others recorded quite recently that haven't been fixed as yet. I don't want to go backwards with respect to PHP version so, I'll just have to put up with whatever issues arise on the odd occasions that they do. Again, I really appreciate you taking the time to point this out!
    1 point
  17. Adrian's Migrator does that => https://github.com/adrianbj/ProcessMigrator Allows automated migration and sharing of page tree content along with their templates and fields via JSON files. These JSON files can be imported into another PW installation to recreate the entire structure and content, including files and images.
    1 point
  18. Hi Ryan, Strange, I've never seen this message before. Do you need to save the file or could you generate it dynamically when a download is requested? I'm thinking that maybe the combination of calling $pdf->save() first and then $pdf->download() afterwards has some issues. You could try these two approaches: 1) Save the PDF to the disk and let ProcessWire download it: $pdf->save($page->filesManager->path . $file_name); wireSendFile($page->filesManager->path . $file_name, array('forceDownload' => true)); You can also omit the forceDownload and see if it works. 2) Don't save the PDF to disk, always create it dynamically and download it: $pdf->download($file_name); Does any this work? Cheers
    1 point
  19. Hi Robin, glad you are finding this module useful! The reason why the modal stays open is that there are several scenarios in which I think this would be desirable. One is when you're creating a new page and it is a 2-step process. The modal needs to stay open after the initial page creation so that you can then edit the new page. The second is when there is an error on the page. I wanted the user to be able to see the error and make any corrections before closing. Ideally, I would just have the modal stay open only in those scenarios, but accomplishing that in the PW admin isn't straightforward at this point. It is something that I would like to look into, though right now I'm pretty swamped with other projects.
    1 point
  20. Works great now - thanks!
    1 point
  21. I think the FOUC has been squashed in github (1.0.2). Thanks for the report, Adrian.
    1 point
  22. Are you sure the files aren't compressed (.tar or .gz or the like)? If they are PW core files, check if file sizes compare to those on git.
    1 point
  23. Thanks for the update. Yes, the modules directory will update from Github once a day, but you can also manually update it by simply editing your module in the directory and saving.
    1 point
  24. The error says PHP run out of memory (some tasks may still be in memory and still trying to run). Have a look at this thread (see @Nik's and @Diogo's posts especially) on how to optimize such tasks. What PW version are you using? Only asking to confirm what line #111 in the PageTraversal Class does. Sorry, I don't have a direct answer on how to resolve this.
    1 point
  25. Thanks Adrian, I'll get this update into the github repo this week--definitely a big plus to get 3.0 compatibility. Update: fix is on github, and version revved to 1.0.1--somewhat off topic, but do any module developers know if module pages (modules.processwire.com) pick up changes on github?
    1 point
  26. Nothing in processwire does automatically update, so what exactly do you mean?
    1 point
  27. In addition to LostKobrakai, the function schema looks like: public function mySrcsetFunction($event) { $image = $event->object; $markup = "<img src='{$lqip}' data-src='{$image->url}' {$aspectratio} class='lazyload lazypreload' alt='{$image->description}' />"; $event->return = $markup; }
    1 point
  28. $this->addHook("Pageimage::srcset", $this, "mySrcsetFunction"); The image is $event->object in the hook function. From this you could simply call your current global functions if you like.
    1 point
  29. I see the processwire force is strong with ralberts in holland Congrats with catching a website for het muziekgebouw in Eindhoven. I lived 10 years in "lightcity" Eindhoven, still miss it.
    1 point
  30. Terrific site! Congratulations to you and the team. My suggestion if to try to compress images a bit more, maybe using minimize.pw to automate the process. And enable GZIP for the static files.
    1 point
  31. Just had a quick look on my phone. Looking really slick and easy to use. Well done. PS on your own site the 'vacatures' banner covers the menu when i open it via the hamburger.
    1 point
  32. Your German is very clear to me, I think your screencasts will be useful for some language learning
    1 point
  33. @Asmordean You might want to have a look at https://github.com/mozilla/pdf.js Widely used code for embedding PDFs in a standards-friendly way. As szabesz said, you still need to check for the client's browser setup and act accordingly if you want to make sure that the PDF is embedded in your HTML. Here's some code to point you in the right direction: https://gist.github.com/falexandrou/9753871 Instead of using an Iframe you could embed it as an object (see the first link above).
    1 point
  34. DAM it ;-) I love this. This modules makes ProcessWire a respectable Digital Asset Management. Great job kongondo
    1 point
  35. I think I know what you mean. Try changing line 119 in AdminPageFieldEditLinks.module from this: $newPageParent = $event->object->newPageParent ?: $event->object->parent_id; to this: $newPageParent = $event->object->newPageParent; Now just make sure that you are specifying a particular template and don't select a parent for new pages. Now when you click "New" it should now ask you where you want to put the new page, based on the template's family settings. I haven't tested, so let me know if that works.
    1 point
  36. Yes, if the WordPress site supports webmentions. If the site doesn't support webmentions and does support pingback, this module will fallback to sending a pingback. There are WordPress plugins to add webmention support,. See http://indiewebcamp.com/WordPress for more info. As I understand it, there's actually two plugins to get the full features: Webmention and Semantic Linkbacks. The latter gives you more user-friendly text for linkbacks (of all types). There's a pretty active group of WordPress users in the indiewebcamp community and I know they'd love to help anyone get set up with these plugins. Feel free to stop by the IRC for any help: http://indiewebcamp.com/IRC
    1 point
  37. New methods: $page->getPage() $page->getPage(1015) $page->getChildren() $page->getChildren(2024) $page->getChildren('template=products')
    1 point
  38. Module updated 1.- Added methods $page->getChildren() $page->getPage() 2.- Now you can inject scripts trough module configuration
    1 point
  39. If you install this module you´ll be able to use angular and use it in your templates directly. Example of a list of all children of the actual page. <script> app.controller('myCtrl', function ($scope) { $scope.children = []; $scope.children = <?=$page->getChildren()?>; }); </script> <div ng-controller="myCtrl"> <ul> <li ng-repeat="child in children">{{child.title}}</li> </ul> </div>
    1 point
  40. Hi! Look for Custom Editor JS Styles Set in the field configuration and enter a path for .js file. In this file you can define your custom styles like this: CKEDITOR.stylesSet.add('mystyles', [ // Block-level styles { name: 'Heading 1', element: 'h1'}, { name: 'Heading 2', element: 'h2'}, { name: 'Heading 3', element: 'h3'}, { name: 'Introduction', element: 'p', attributes: { 'class': 'introduction'} }, // Inline styles { name: 'Link button', element: 'a', attributes: { 'class': 'button' } }, { name: 'Highlight', element: 'span', attributes: { 'class': 'highlight' } }, // Object styles { name: 'Stretch', element: 'img', attributes: { 'class': 'stretch' } }, ]); Also make sure you have Styles toolbar item enabled.
    1 point
  41. Wow ok, thanks for the encouraging comments guys I've worked with PW for quite a while, surfing the core silently in the background (I'm a little shy like that). But one day apeisa gave me a proper kick in the knee and told me to grow a pair - I did, ergo, here I am. I must say you have a really good thing going on here and I'm very happy to be part of it!
    1 point
  42. The funny thing is, ProcessWire works like this for the exact same reason: to reduce loading of not needed modules If you really, really want to do this yourself, then you would have to create a container inside the main module (or create a new module), that holds the relationships (this can even be a module configuration field). Then each "sub" module registers themselves as a conditionally loadable module with the main module. This would be done inside their ___install() -method. Then in your main module's init(), you fetch all the registered "sub" modules and load them. This would work - I can even write you an example. But to be honest, I'd just autoload the damn the module Though just let me know if you still want an example of what I described.
    1 point
  43. I have read it. My point is that during ProcessWire bootstrapping, the class does not exist yet, and the existence (i.e. your conditional autoloading function) won't be checked after ProcessWire becomes ready() Edit: Just to make this clear - the only thing you have when your conditional autoloading function is called is a placeholder module, the actual class hasn't been included yet - so it doesn't exist (unless it's an autoloading module or your module cache is empty). It will be included and replaced when you request the module inside your template - but like I have said, this does not trigger any conditional autoloading for other modules. There is guarantee for the conditional autoloads - they are triggered when ProcessWire goes ready().
    1 point
  44. Hi taqtaq, you could use Ryans sitemap-template. it works pretty good in different languages. No need to install LanguageLocalizedURL. For your different languages you should just add something like: <url> <loc>http://yoursite.fi/</loc> <xhtml:link rel="alternate" hreflang="en" href="http://yoursite.fi/en" /> <xhtml:link rel="alternate" hreflang="it" href="http://yoursite.fi/it" /> </url> http://processwire.com/talk/topic/3846-how-do-i-create-a-sitemapxml/ I will check if I could write a small function to implement this for every language in the system. EDIT: Here comes Ryans template with added language alternate-links like recommended by google for multilanguage support. more information here: https://support.google.com/webmasters/answer/2620865?hl=en important: name of language should be same like international language-code (name your pages en for english, de for german, es for spain etc. Just Follow Ryans instructions to use the template, everything else is done by the template. Update 29.02.16 This update is made for PW 3.0. To prevent endless redirects in 2.7 and lower please read instructions (comments). You need to comment out the line with the redirect. multilang-sitemap-xml.php.zip
    1 point
  45. Just thought you guys might like to know that the priority setting just got another user Needed to solve the conflict between RedirectIds and 404Search modules. Thanks again Ryan for thinking of everything!
    1 point
  46. Sevarf2, you are correct about something here in that theoretically, supplying the template to the find() call should enable it to run faster. ProcessWire needs to know the template for a page before it starts loading it. So it'll query the DB for the page's template if it doesn't already know it. However, we don't have that optimization in place for $pages->find() at present, so your $pages->get("id=123, template=book"); doesn't benefit from that. But you can take advantage of that optimization by using the $pages->getById() method. It would technically be the fastest way to retrieve a page, but it's rare that I would be up for using it when developing a site (I only use it for core development). But it may be worth trying if you are trying to optimize a large amount of page retrievals. I'm not sure it'll make much difference in the end, but it's worth a shot. $template = $templates->get('book'); $page = $pages->getById($page_id, $template)->first(); The getById() method is really meant for retrieving multiple pages, which is why it returns a PageArray. If you have multiple pages using the same template, you can retrieve all of them here: $pageArray = $pages->getById(array(123,456,789), $template); If you can also supply a parent_id to the method (meaning, you already know all the provided page IDs have the same template and parent), it can use that for a little further optimization: $pageArray = $pages->getById(array(123,45,789), $template, $parent_id); Btw, the purpose of $pages->getById() method is as a support for all the other get(), find() and children() methods in ProcessWire (or anything else that returns a Page or PageArray from the DB). All pages loaded from the database are loaded by the getById() method, so all the other get/find methods are actually front-ends to it. getById() was never intended to be part of the public API though.
    1 point
  47. This is how html5boilerplate does it. the nice thing is it works without specifying your domainname and could easily included in your own default htaccess: # Rewrite "www.example.com -> example.com" <IfModule mod_rewrite.c> RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] </IfModule> https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess#L344
    1 point
×
×
  • Create New...