Leaderboard
Popular Content
Showing content with the highest reputation on 04/11/2017 in all areas
-
<?php foreach ( $pages->find('template=calendar-post, limit=8, Start_date>=today, sort=Start_date') as $single ) : ?> You can use Start_date>=today as a selector to only show items with a Start_date that is either today or in the future.5 points
-
Greetings. I am here to share my first module. I make this module because I cannot find one to suit my need. I like SessionHandlerDB but I do not want to use mysql database to store session for performance. So, Redis seems to be the best choice. I have tried to use netcarver's SessionHandlerRedis but it lacks something I need, those are the active session checking and the easy module configuration while I do borrow some code from it (thanks to netcarver). So I take this chance to merge them together to form a new module. I am new to use github and I don't know if it is appropriate to publish another similar project, or fork from them. You may grab this from Github: SessionHandlerDBRedis I hope this could give somebody a help. Updated to v0.4 changelog: v0.3 - added ability to get forwarded IP instead of normal remote IP. v0.4 - added session lock2 points
-
No issues here But since the amount of modules is (luckily) pretty small in ProcessWire I guess it would be wise to join forces instead of creating several modules with overlap. If 90% of the code is changed, I'm not really sure if a fork is appropriate, but it might be. I guess we have to wait until @netcarver joins the discussion.2 points
-
@Juergen In leaflet JS there is a method invalidateSize() which checks if the size of the map container has changed and then updates the map. When you call the UIKit modal, the size of the map container changes and therefore your map needs to be updated manually. So you need to listen to the show.uk.modal event and attach a handler that updates the leaflet map. The problem here is that the map object is not easily accessible from the global document scope because the JS that renders the map is executed inside an anonymous function call. You should find a script like this just before the closing </body> tag: <script type="text/javascript"> $(function() { var mleafletmap1 = new jsMarkupLeafletMap(); mleafletmap1.setOption('zoom', 18); mleafletmap1.init('mleafletmap1', 49.572056, 10.878165, 'OpenStreetMap.Mapnik'); var default_marker_icon = L.AwesomeMarkers.icon({ icon: 'home', iconColor: 'white', prefix: 'fa', markerColor: 'darkblue' }); mleafletmap1.addMarkerIcon(default_marker_icon, 49.572056, 10.878165, '/maptest/', 'maptest', ''); }); </script> So if you try and get the map object with $(mleafletmap1), this will not return what you need. In order to have the map object available in global scope, you need to change some module code. You can find the changes at my fork in MarkupLeafletMap.module. Just copy this over your local file. Now the script before the closing </body> tag should look something like this: <script type="text/javascript"> var mymap; $(function() { var mleafletmap1 = new jsMarkupLeafletMap(); mleafletmap1.setOption('zoom', 18); mleafletmap1.init('mleafletmap1', 49.572056, 10.878165, 'OpenStreetMap.Mapnik'); var default_marker_icon = L.AwesomeMarkers.icon({ icon: 'home', iconColor: 'white', prefix: 'fa', markerColor: 'darkblue' }); mleafletmap1.addMarkerIcon(default_marker_icon, 49.572056, 10.878165, '/maptest/', 'maptest', ''); mymap = mleafletmap1; }); </script> And you can now access the map object in your script with mymap.map. Example code: <script> var myModal = $('#yourmodalID'); mymodal.on('show.uk.modal', function(){ mymap.map.invalidateSize(true); }) </script> While this is just a workaround it should help to display the map correctly. @Mats Maybe we should add something like this to the module code so in future versions a map object will be returned by default? Or do you see another way to access the map object with the module as is?2 points
-
Menu Builder As of 29 December 2017 ProcessWire versions earlier than 3.x are not supported Modules Directory Project Page Read Me (How to install, use, etc..) For highly customisable menus, please see this post. If you want a navigation that mirrors your ProcessWire page tree, the system allows you to easily create recursive menus using either vanilla PHP or Soma's great MarkupSimpleNavigation. In some cases, however, you may wish to create menus that: 1. Do not mirror you site's page tree (hirarchies and ancestry); and 2. You can add custom links (external to your site) to. That is primarily where Menu Builder comes in. It is also helpful if you: 3. Prefer creating menus via drag and drop 4. Have a need for menus (or other listings) that will be changing regularly or that you want to allow your admin users to edit. The issue of custom menus is not new here in the forums. The difference is that this module allows you to easily create such menus via drag and drop in the Admin. Actually, you can even use it to just create some list if you wanted to. In the backend, the module uses the jQueryUI plugin nestedSortable by Manuele J Sarfatti for the drag and drop and is inspired in part by the WP Custom Menu feature. Please read the Read Me completely before using this module. For Complex or highly-customised menus, it is recommended to use the getMenuItems() method as detailed in this post. Features Ability to create menus that do not mirror your ProcessWire Page Tree hierarchy/structure Menus can contain both ProcessWire pages and custom links Create menu hierarchies and nesting via drag and drop Easily add CSS IDs and Classes to each menu item on creating the menu items (both custom and from ProcessWire pages) or post creation. Optionally set custom links to open in a new tab Change menu item titles built from ProcessWire pages (without affecting the original page). E.g. if you have a page titled 'About Us' but you want the menu item title to be 'About' Readily view the structure and settings for each menu item Menus stored as pages (note: just the menu, not the items!) Menu items stored as JSON in a field in the menu pages (empty values not stored) Add menu items from ProcessWire pages using page fields (option to choose between PageAutocomplete and AsmSelect [default]) or a Selector (e.g. template=basic-page, limit=20, sort=title). For page fields, you can specify a selector to return only those specified pages for selection in the page field (i.e. asm and autocomplete) For superusers, optionally allow markup in your menu titles, e.g. <span>About</span> Menu settings for nestedSortable - e.g. maxLevels (limit nesting levels) Advanced features (e.g. add pages via selector, menu settings) currently permissible to superadmins only (may change to be permission-based) Delete single or all menu items without deleting the menu itself Lock down menus for editing Highly configurable MarkupMenuBuilder - e.g. can pass menu id, title, name or array to render(); Passing an array means you can conditionally manipulate it before rendering, e.g. make certain menu branches visible only to certain users [the code is up to you!] Optionally grab menu items only (as a Menu object WireArray or a normal array) and use your own code to create custom highly complex menus to meet any need. More... In the backend, ProcessMenuBuilder does the menu creation. For the frontend, menus are displayed using MarkupMenuBuilder. Credits In this module's infancy (way back!), I wanted to know more about ProcessWire modules as well as improve my PHP skills. As they say, what better way to learn than to actually create something? So, I developed this module (instead of writing PW tutorials as promised, tsk, tsk, naughty, naughty!) in my own summer of code . Props to Wanze, Soma, Pete, Antti and Ryan whose modules I studied (read copied ) to help in my module development and to Teppo for his wonderful write-up on the "Anatomy of fields in ProcessWire" that vastly improved my knowledge and understanding of how PW works. Diogo and marcus for idea about using pages (rather than a custom db table), onjegolders for his helpful UI comments, Martijn Geerts, OrganizedFellow, dazzyweb and Mike Anthony for 'pushing me' to complete this module and netcarver for help with the code. Screens1 point
-
A proof-of-concept session handler module for PW that uses Redis as the session database. You'll need access to a Redis server (IP address and Port) and you can configure the session prefix, the Redis DB that the sessions will be stored in and a time-to-live for the sessions. Please let me know if you run into any issues with this module. Here it is on Github. Here it is in the modules repository.1 point
-
1 point
-
Try it you'll quickly find out if it does support that. Also these requirements are only applicable to apache/lighttpd. There are also nginx rules somewhere on the forums, which do the same.1 point
-
I doubt that Facebook plays a huge role in blogging. Medium on the other hand does, which is surely killing of a lot of smaller independent blogs.1 point
-
@Pretobrazza Did you also update the leaflet-markercluster files? Because the inputfield map is not using the marker cluster plugin.1 point
-
Oh, that easy, hehe. Works great Thank you very much, was struggling with that for some time before I decided to ask here. R1 point
-
Second edit: hooking after Page::render works <?php wire()->addHookAfter('Page::render', function (HookEvent $e) { header('x: test'); // works });1 point
-
@Pretobrazza I just installed latest version of this module on PW 3.0.47 I updated the getLeafletMapHeaderLines method for injecting JS and CSS then lines 168 and 173 to load @1.0.3. Then I got a JS error about the MarkerCluster. I updated all 3 files in the module's assets/leaflet-markercluster/ folder to the latest 1.0.4 versions. You can find them here: https://github.com/Leaflet/Leaflet.markercluster/tree/v1.0.4/dist After that the map is showing up fine with no errors. Pls let us know how it goes for you.1 point
-
v0.0.5 released. Allows use of the dropdown/dialog in CKEditor fields that do not have the Hanna Code textformatter applied to them, in order to support $hanna->render() usage.1 point
-
Thanks for the report. Are you running PHP 7.1? I think that's the version that started enforcing stricter numeric values and throwing errors like this. I tested in PHP7.1 and I can't reproduce this issue. Also, I can't see how this error could be connected to HannaCodeDialog. From what I've read the "non well formed numeric value" error occurs when some arithmetic or other operation that expects an integer receives a string instead. And line 118 of Database.php is: $timerTotalSinceStart = Debug::timer() - $timerFirstStartTime; So probably Debug::timer() or $timerFirstStartTime is not an integer, but this is core code that relates to the debug mode tools and HannaCodeDialog has nothing to do with that. Do you see the error as soon as you install HannaCodeDialog? Do you see it if you have no Hanna codes defined when the module is installed (I'm wondering if the problem is with one of your Hanna codes rather than the module itself)? If you uninstall HannaCodeDialog does the error go away? I will support this in the next version. The intention was to avoid needlessly attaching the plugins to every instance of CKEditor if the textformatter wasn't applied to that field, but I guess to support $hanna->render() there's no way to know if a CKEditor field needs the plugins or not. I'm having trouble understanding exactly what's going wrong for you here. Make sure you meet the prerequisites and have completed the installation process: TextformatterHannaCode must be installed. TextformatterHannaCode must be applied as a textformatter to your CKEditor field. You must have at least one Hanna code created. Install HannaCodeDialog module. Edit the settings for your CKEditor field and in "Input > CKEditor Settings > CKEditor Toolbar" add "HannaDropdown" (to be precise, with a comma space separating it from the other items there)1 point
-
OH BTW, in terms of marketing and Design, i think Craft does an excellent job. We nearly went for this becaus it just "felt" so nice... the website and the backend looks amazing. PW to me seems to be the best option around there at the moment, it has a great community, awesome API, Simplicity also for admins, this could attract so many people when presented well...1 point
-
Welcome back GuruMeditation! 1. I wish there exist something like that. While we are figuring out how to do it, you can show your interest by supporting the basic here (like or something...) EDIT: do not for get @teppo's Weekly Newsletter: https://weekly.pw/ which might be used to skim through all the happenings. 2. Time will tell, but your question is a valid one. UIkit keeps evolving too, so it should be updated from time to time. Things are still in beta stage.1 point
-
You mean Auth0? How about you join forces and release a module? I would love to help by testing1 point
-
1 point
-
Hi @Ivan Gretsky - you need to manually set the output mode to "DEVELOPMENT" to make the User Switcher work. I initially set it up this way as an additional security layer, but I am thinking about revising the need to do this. Let me know if you still have any problems.1 point
-
@palacios000 - you need the "filename" rather than "url" of the attachment. Also if the files field allows more than one, make sure to do first() etc as well.1 point
-
Well, it's been a long time coming, and not sure if it's exactly what you had in mind, but I just added a new "Git Info" panel that displays Git branch, latest commit message, etc for your site (assuming you have it under Git version control). This is just the first version. My goal is to add color coding of the icon (like many other panels) to get your attention. I am looking for feedback on this though. I could either make it possible to configure different colors for different branches, or else I could try to match the branch name against the subdomain / extension, eg. dev.mysite.com, staging.mysite.com or mysite.dev, mysite.staging, etc and color green if they match and red as a warning if they don't. Anyone have any thoughts on the best approach? On another note, I just had to do quite a bit of work fixing the "Versions List" feature on the ProcessWire Info panel - two recent Tracy core updates broke this functionality and I just noticed. Also, it looks like Github changed the way they handle line breaks inside <details> tags, so also had to tweak that, but I think everything is working again now!1 point
-
Here is a pre-release version on Github: https://github.com/outflux3/ImportExternalImages Still needs some cleaning up, but works fine so far in limited testing on 3 sites...1 point
-
If it's the title field you want to populate the address from, you could use a hook to set the address when a new page is added. In /site/ready.php: $this->pages->addHookAfter('added', function($event) { $page = $event->arguments('page'); if($page->template != 'my_map_template') return; $page->my_leaflet_map->address = $page->title; $page->save(); });1 point