Leaderboard
Popular Content
Showing content with the highest reputation on 03/17/2018 in all areas
-
Like the last few weeks, most efforts this week focused on resolving issue reports at GitHub and preparing the master version. We are at a point where I think our dev branch is far better than our previous master (3.0.62), in every way, stability included. So there's no reason to delay further—3.0.96 is our new master version. This post covers all the details: https://processwire.com/blog/posts/pw-3.0.96-master/6 points
-
Since all good things come in threes, here's another responsive blog profile for PW3: Editorial Travel Blog Template Like the previous two, it builds upon @kongondo's Blog module and uses @justb3a's Simple Contact Form. It also makes use of @Pete's XML Sitemap and @ukyo's Font Icon Picker. Features: Responsive Slide-in sidebar Homepage with picks and last posts, 3-column layout Selectable widgets, e.g.: Recent posts Recent comments Current month calendar with links to posts per day User-switchable sort order for lists (ascending/descending) Configurable list pagination An online demonstration can be found here. And again: all feedback is welcome!5 points
-
5 points
-
We do really need @since added to the documentation so module developers can know which methods will require which PW versions, and avoid to confusion when working on older sites. Maybe you could "thumbs up" the existing request and hopefully Ryan will act on it soon: https://github.com/processwire/processwire-requests/issues/1585 points
-
4 points
-
As far as I know, the documentation gets generated directly from code comments. For example the WireMail class: API Doc: https://processwire.com/api/ref/wire-mail/ Code: https://github.com/processwire/processwire/blob/master/wire/core/WireMail.php#L9 My personal conclusion: if you want to contribute to the docs, you need to understand the "comments markup" and contribute directly to the github code base via issues or pull requests. Edit: and also that you are now a registered forum member for more than one and a half year: Welcome to the forums!3 points
-
+1 Been using the devs as they come out each week and only found a couple of very minor issues that were fixed almost immediately. Also been using a few of the new features, it's pretty amazing what's been added in the past 12 months.3 points
-
Great job, @ryan! It was really astounding to watch the commits roll in and the open issues melt over the last few weeks, and there are so many new features too! I've been using latest dev versions extensively, and the few minor bugs I stumbled upon were solved before I could report them I even used some of the newly implemented features without realizing it This year already rocks!3 points
-
If you're looking to do an elaborate a page builder with ProcessWire and don't want to pull your hair out, I highly recommended viewing this video: A couple notes: with the css grid specification, you can assign multiple blocks to the same grid-area but they will overlap each other. I've "overcome" this by combining multiple blocks into a parent div and assigning that instead. pretty easy to do. i didn't demonstrate it, if your blocks have a grid structure within them (like built with flexbox), you can still assign that block to a grid-area. so if your blocks themselves have a grid structure, that's ok. for example, if your css grid layout is 6 columns, but you have a block that has a grid inside of it (built with like uikit's grid that's 5 columns), you can assign that block to the grid-area. with the css grid specification, the flow of the blocks does not have to match the flow of the grid-areas. this is insanely powerful. Enjoy.2 points
-
I have been using ProcessWire for a while now and I really like to work with it. I am not a big developer but I much appreciate the way it is setup and how the community is supporting it. Recently I was trying to update a template file and I realised that the function "find" in the core "WireFileTools.php" class was only added rather recently (July 2017) to the 3.1 version of PW. So I have some questions that maybe someone can try to answer for me: - is the online documentation in https://processwire.com/api/ref/ intended to reflect only the most recent develop branch or should it include references to additions and changes done to the 3.x? In this case that the function was added only in version 3.x. - maybe an easier question, how is the API Reference documentation created? Is there a way to contribute on GitHub? Thanks for your help Kaseem2 points
-
If it's working for your purposes then I think it's fine to do it the way you are. My suggestion is that you have the function return false by default rather than true, and reverse the logic in the conditionals. In general, when permissions are involved I'd say it's best practise that the default state be that the user can do nothing, and then you actively add permissions as needed. This post did get me thinking about if you could use the core permissions system for your needs. I found that when creating a new custom permission, if you prefix the permission name with "page-" then it gets some special features: namely that you can activate that permission for a role individually for each template. So that sounds promising for your needs, but I found that the downside is that the user must have the "page-edit" permission in order for the individual template activation to work. So that probably rules the option out because it's likely that you would want these permissions to be usable on roles that aren't allowed to edit pages. Maybe someone can shed some light on how "page-" prefixed permissions work. Are they mentioned anywhere in the docs or a blog post? Is there any other way to assign permissions on a per-template basis besides making them "page-" permissions? And do folks think it would be worth opening a request for per-template permissions that don't require the page-edit permission?2 points
-
http://modules.processwire.com/modules/admin-restrict-page-tree/2 points
-
2 points
-
Thank you @kongondo for this very useful tutorial. The version when find() was added seems to be 3.0.66. I have now created a pull request with the version info of when the functions find() and includeOnce() were added using the @since syntax suggested by @Robin S2 points
-
Currently no, aos is loaded only in the admin and I think it would really mess things up if I would change that. What would be possible to create another module that would use aos functions and settings but of course aos would also need some refact. I would happily assist in this if someone would take up the challenge.2 points
-
Thanks to everyone for the very helpful comments and links @horst and @Robin S. The difficulty I see as a newbie is not so much how ProcessWire is working as it is a very straight forward architecture and well documented with examples. My challenge has been to find my way around the forums and the documentation. So far I hesitated asking questions because I don't want to sound too ignorant and overstretch the hospitality of this community. I appreciate all your help very much and I will see how I can really contribute in the future as I think that PW does deserve wider recognition.2 points
-
2 points
-
And here's another site profile, again based on a free template from html5up.net: Download link: Strongly Typed Travel Blog Template (Responsive) GitHub Repo Features are much the same as in: Additionally, the sidebar can be aligned either to the left or right, and navigation is cached for 24 hours using MarkupCache. As always, I'd be happy about any feedback. Mobile Screenshot:2 points
-
2 points
-
In a project I had to add the attribute 'disable' to some options of a select field (page reference) to show them but make them unselectable. Since I could not find an integrated solution, I wrote a tiny module and a hook. This could also be a POC to similar needs. Install module Add the Module to InputfieldPage in the module settings to make it selectable as Inputfield for page reference fields Create a hook in ready.php to manipulate attributes of the <option> tag for specified items Module <?php namespace ProcessWire; /** * POC Inputfield Select Hook Add Option -- Replacement for InputfieldSelect * * Selection of a single value from a select pulldown. Same like InputfieldSelect * except this version provides hookable addOption() function which allows to modify * attributes of the <option> tag (i. e. 'disabled' to show items but disallow to select them * * @author Christoph Thelen aka @kixe * */ class InputfieldSelectHookAddOption extends InputfieldSelect { /** * Return information about this module * */ public static function getModuleInfo() { return array( 'title' => __('Select Hookable Add Option', __FILE__), // Module Title 'summary' => __('Selection of a single value from a select pulldown. Same like InputfieldSelect. except this version provides hookable addOption() function which allows to modify attributes of the <option> tag (e.g. \'disabled\' to show items in dropdown but disallow to select', __FILE__), // Module Summary 'version' => 100, ); } /** * Hook in here to modify attributes */ public function ___addOptionAttributes($value, $label) { return array(); } /** * @see InputfieldSelect::addOption() * */ public function addOption($value, $label = null, array $attributes = null) { if (!is_array($attributes)) $attributes = array(); $attributes = array_merge($attributes, $this->addOptionAttributes($value, $label)); return parent::addOption($value, $label, $attributes); } } Hook /** * This example hook modifies the attributes of the selectable options of a Pagereference field named 'test'. * The selectable pages have the template 'test' assigned which includes a checkbox 'disallow'. * The attribute 'disabled' will be added to the selectable page if the user does not have the role 'user-extended' and 'disallow' is set. * */ $wire->addHookAfter('InputfieldSelectHookAddOption::addOptionAttributes', function($e) { // quick exit if ($e->object->name != 'test') return; if ($this->wire('user')->isSuperuser()|| $this->wire('user')->hasRole('user-extended')) return; // disable items (pages) in select $restrictedPageIDs = $this->wire('pages')->find('template=test,disallow=1')->each('id'); if (in_array($e->arguments[0], $restrictedPageIDs)) $e->return = array('disabled' => 'disabled'); });1 point
-
1 point
-
You were on the right path but that file is only a sample. Copy it elsewhere to templates/scripts for example and load it in assetpaths. I don't know what is that, will do a search.1 point
-
1 point
-
@adrian excellent, tyvm **update to add, this works like a charm!1 point
-
@neosin - not sure how ML imports work with this module, but thanks to sponsorship by @bbeer BatchChilldEditor supports it, although it work differently to the way you described - you need one CSV file per language.1 point
-
1 point
-
A friend of mine is very happy with this one: http://amzn.to/2Dz2zRB I think it's an interesting concept and I'll give it a try1 point
-
Ha! I feel like Sherlock Holmes now! There IS a way to do what I need without CSS tweaking or installing hooks. It is just very hidden. Probably not even Ryan knows about it. In Modules -> Configure -> AdminThemeUikit under "Masthead and Navigation" change "Masthead logo click action" to "Open offcanvas navigation". Then, as "preview" user click the PW logo (top-left corner), then click your login name, and then you will see "Logout" and "View site" links. It works, but I think it should be more visible.1 point
-
Following up on @Robin S suggestion, I have thumbed up the suggestion regarding the @since to the syntax used for the generation of documentation. I guess technically I can go ahead and suggest a corresponding change to the PW git repository and once @ryan gets around it he can include it if he thinks it is helpful. Would anyone help me with another question flowing from the above? How can I find the PW version in the file history on github? I have found the change when the function "find" was added to "wire/core/WireFileTools.php" https://github.com/processwire/processwire/commit/786995f85e3664615fe2cc5ff269f4bd59b6a7f2#diff-fd4a44895145a0f0ea6d437d7e7b62c0 Where can I find the PW version under which this commit was later released?1 point
-
After reading this, I looked into your github page and found out that you also converted the strongly typed template. One month ago, I picked up three themes from HTML5up as starting points for low budget or honorary projects: The "Editorial", the "Strongly Typed" and the "Phantom" = 66% accordance1 point
-
Is there an easy way to enable/disable Tracy debugger via API? As I am still on my way to create test with PHPUnit it would be awesome if there's an easy way (ideally via config.php) to disable tracy if it's called from the phpunit testing scripts.1 point
-
Hi @Robin S, would you mind if I add this to AOS? I've made some changes, eg. display description + filename in the menu (if there's no description, use the basename without extension), and hide the menu when clicking outside of it. The latter is handy on a multilanguage site as the menu doesn't stay open when clicking to another language tab. Of course this happens only if you don't click on a menu item. I also plan to make it more ML-friendly by adjusting the description per language (some day).1 point
-
I see, thanks for your input. At this moment, Its working in the way : unix to unix ok unix to windows ok windows to unix, testing it right now1 point
-
1 point
-
My experiences in 15 years with PHP on windows told me to not make any (platform) differences with filesystem related stuff. Simply use the / forwardslash for everything as long as you can achieve all operations with PHP internal functions! (copy, delete, ZIP!, etc) The one and only rule where you need to convert forwardslashes to backwardslashes on windows is, when you do calls in the commandline via exec() or system(). All other stuff is handled well from PHP internallly across all platforms. So, on windows you should not use functions like realpath() or dirname() without to convert backslashes to forwardslashes afterwards! Thats the only rule I followed all the time. (locally detect windows = convert \ to /)1 point
-
1 point
-
Hello guys, just to let you know that I am working on the module. @Karl_T As i need the module working on windows ASAP, I tested your fix on my Windows 2008 r2 server / PHP 7.0.28 and it throw error on $zip->close(); with an error : "No Error" ? Which version of Windows and PHP you are working on please ?1 point
-
This is awesome, @Jonathan Lahijani!!! Great work!! For those eager to learn CSS Grid, I recommend this excellent (and free) course by Web Bos: https://cssgrid.io1 point
-
Just came across this need for the SEO module as well. I have posted this request: https://github.com/processwire/processwire-requests/issues/170 Until there is some progress on that, here is my hacky solution. I am sure it could be improved, but it works for now. $this->addHookBefore('ProcessModule::executeEdit', function($event) { if(!$this->wire('user')->isSuperuser() && $this->wire('input')->get->name !== 'MarkupSEO') { throw new WirePermissionException('You do not have permission to configure this module.'); } }); $this->addHookAfter('ProcessModule::executeNavJSON', function($event) { if(!$this->wire('user')->isSuperuser()) { if($this->wire('input')->get->site === '1') { // note \/admin\/module\/ - if your site admin is at /processwire/, then use: \/processwire\/module\/ $event->return = '{"url":"\/admin\/module\/","label":"Modules","icon":"plug","list":[{"url":"edit?name=MarkupSEO","label":"MarkupSEO","icon":"gear"}]}'; } else { $event->return = null; } } }); That results in this - Modules > Site contains just the SEO link and all the others are empty. Thanks @Robin S for the headstart on this!1 point
-
I got tired of having to open the link dialog in CKEditor in order to check where a link is pointing to, so made this simple plugin. Link Hover A plugin for CKEditor. Shows the href attribute of a link in a tooltip when the link is hovered. This saves you from having to open the link dialog in order to check where a link points to. Installation This readme assumes installation in ProcessWire CMS. The plugin folder must be named "linkhover" – if necessary, rename the folder to remove the "-master" suffix added by GitHub. Copy the "linkhover" folder to /site/modules/InputfieldCKEditor/plugins/ In the field settings for each CKEditor field that you want to activate the plugin for, check the "linkhover" checkbox at Input > Plugins > Extra Plugins https://github.com/Toutouwai/linkhover1 point
-
Besides Adrian's excellent suggestions... Many of the common inputfield properties are outlined here: https://processwire.com/api/ref/inputfield/ For properties specific to a particular inputfield type you can read the code comments in the core files, or if you have the very handy API Explorer pro module you can browse the properties in a nice interactive interface within the PW backend:1 point
-
If you go to a field's settings in the admin and then open the Request Info panel in TracyDebugger you'll see this. It's most of the settings available, but some like "required" doesn't show unless you have it checked for the field in question. Alternatively, also while visiting a field's settings, you can do this in the Console Panel:1 point
-
Here's a document I've been working on https://docs.google.com/document/d/1peY-FUpevKgy87cKOxIVz8jwcv2-3c61zbiJr3QKO6c/edit?pli=1# Flexible Page Layouts in Processwire. It's still rough, but I've been using it to help collect all my thoughts/notes on all the ways to achieve flexible layouts in Processwire. I love hearing about other ways people are structuring their websites. Here is another document that helps me wrap my head around some of the different field types in Processwire. (all on one page) https://docs.google.com/document/d/1VcSluQyjl9AhMBcJA3R4-uZb9IUYdKXGSh7Phclf34Y/edit?pli=1#heading=h.ysvx3k7ssuw7 Hope it helps someone.1 point
-
Here we go .. The basic idea is an textarea fieldtype with a function somewhat similar to an website blocks builder, I know that currently this can be achieved using a Repeater, Repeater Matrix or Hanna Code, but perhaps this way would be easier for the developer/user and more flexible. The idea came after seeing this plug-in: https://formbuilder.online/ ... and the implementation could be based on these modules: https://github.com/blynx/TextformatterFunkyFunctions from @blynx https://github.com/outflux3/SettingsFactory from @Macrura https://github.com/Toutouwai/HannaCodeDialog from @Robin S Based on TextformatterFunkyFunctions we would have a folder for this type of field with the design blocks that we want to make available to the user: These block files would have main three sections: The Settings section for the Block UI could be based on the SettingsFactory code. A mockup of the user interface of the field would be: It would have drag and drop to add and sort the blocks, and display the generated Form by each block in order to enter the block data The field will have three display modes in the backend: BUILD - the first where field content is configured in visual and interactive mode: CODE - The second is the "real" configuration of the field as required by TextformatterFunkyFunctions and is the data that is stored in the Processwire DB. This mode could be hidden for some users: PREVIEW - The third one is the visualization of the field output, it could be done using Ajax requests to the module into an iframe or inserting the response in a DIV using jquery. Maybe some code of this module will work: http://modules.processwire.com/modules/fieldtype-runtime-markup/ from @kongondo I hope that I have been able to explain the idea correctly, but I can not wait for it to be inspired to make a perfect explanation, .. waiting for that moment and it has been in my trunk for a long time .. It's just an idea to debate, maybe it will be an inspiration for other things, or for someone who wants to develop it (as a commercial module or not)1 point
-
Hello, I found & fixed an issue wich gives you an illegal string offset error in the latest PHP version. (7.1). Around line 429 you declare $return = ''; and then fill it up as an array doing $return[$key] = $value; at line 435. All you got to do is declare $return = array(); instead of $return = ''; and it should be fixed. Filling up an empty string as an array caused the errors. Can you fix this and push it to github? Kind regards, Jonathan private function parseCustom($custom) { if(trim($custom) == '') return; $return = array(); $lines = explode(PHP_EOL, $custom); foreach($lines as $line) { list($key, $value) = explode(':=', $line); $key = preg_replace('%[^A-Za-z0-9\-\.\:\_]+%', '', str_replace(' ', '-', trim($key))); $value = trim(wire('sanitizer')->text(html_entity_decode($value))); $return[$key] = $value; } return $return; }1 point
-
Hello @abdus, congrats on your really great venture. Much appreciated. Is there any news about your newsletter module?1 point
-
Currently the Map Marker inputfield does not support AJAX-loading. I have opened a GitHub issue for this. Until an update is released you can fix the problem by adding the following to InputfieldMapMarker.js: $(document).on('reloaded', '.InputfieldMapMarker', function() { $(this).find('.InputfieldMapMarkerMap').each(function() { var $t = $(this); InputfieldMapMarker.init($t.attr('id'), $t.attr('data-lat'), $t.attr('data-lng'), $t.attr('data-zoom'), $t.attr('data-type')); }); });1 point
-
hi kass, it could also be an option to do something like this (pseudocode): <?php $page; // current page being displayed $active = $page->parents->add($page); // all parents of current page + page itself if($active->has($page)) echo 'class="active"'; didn't read your post deeply but maybe that's a point in the right direction good luck1 point
-
Today I made the update for VersionControl from version 1.2.7 to version 1.2.8 using the ProcessWireUpgrade module. My test site runs PW core version 3.0.52. After the update the site was producing the following error which I found in the error log file: Compile Error: Cannot redeclare class VersionControl (line 18 of /home/chr/ac-test-pw/site/assets/cache/FileCompiler/site/modules/PageSnapshot/VersionControl.module) I noticed that there are now two folders containing the file "VersionControl.module": "VersionControl" and "PageSnapshot" After removing the folder "PageSnapshot" with the old version of "VersionControl.module", everything seems to work properly again. It actually appears that installing the module using "Modules > New > Add module from URL ..." will install it in the folder /site/modules/PageSnapshot where as the "ProcessWire Upgrade" module will create a new folder /site/modules/VersionControl which is the recommended folder for the installation of the module according to the module page http://modules.processwire.com/modules/version-control/1 point
-
Issue has been opened on GitHub: https://github.com/processwire/processwire-issues/issues/1831 point