Leaderboard
Popular Content
Showing content with the highest reputation on 07/30/2016 in all areas
-
A series (currently 10 episodes) of video tutorials in German by Leonid Lezner https://www.youtube.com/channel/UCwkKKtIeOzfIqF8X5gNP0_g7 points
-
Hello @Mercury and welcome to the forums, Do you really want to use MySQL queries? Why not the API instead? See, for example: https://processwire.com/api/selectors/ I do not know what you have read/watched so far, but probably the best article to start with is this one: https://www.smashingmagazine.com/2016/07/the-aesthetic-of-non-opinionated-content-management-a-beginners-guide-to-processwire/ A tutorial that I can also recommend (among other things it utilizes the twig template engine which you might not need, but other important concepts are also demonstrated): http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-1/5 points
-
The latest post includes coverage of weekly updates to the ProcessWire core, as well as a look at how to create your own custom utility hook functions… https://processwire.com/blog/posts/pw-3.0.28/4 points
-
Hi everyone, very sorry for the delays - as you may know, I've been too busy of late to attend to Jumplinks 2. I'm making time as a go along, and would like to briefly discuss the current work taking place. I may or may not have mentioned that I'd like the new Jumplinks to be powered by FastRoute. This improves processing time by quite a bit (haven't measured, but there is far less preg_* going on) and makes development somewhat easier. By using it, however, the syntax for each jumplink would change; but I believe this to be a good thing. As you well know, Jumplinks currently uses the {name:type} base syntax, where type is optional (this invokes smart wildcards). By moving to FastRoute, the base syntax would change to {name} only, which catches [^/]+ by default. That regex is typically used in an MVC framework context, and so may not be completely suitable for the purposes of this module - as such, I am sure this can be changed by overriding the RouteParser (we can default to what is currently used for the segment any type: [\w_-]+[\w.-_%\=\]+). Then, the concept of smart wildcards would disappear, and you would be able to specify your own expressions instead - this is done in the format {name:<exp>}, where <exp> is the expression you would normally use inside of a regex capture group, such as [a-z0-9]+. However, we could add support for aliasing expressions so that the module behaves the same way as it currently does, by silently converting the aliases to their respective expressions, but also allowing more complex expressions to be used. (Note that I chose FastRoute as its syntax closely matches the current Jumplinks syntax, and allows for greater flexibility.) Before Jumplinks 2 is launched, the current dev branch (which will then be moved to master) will be updated to include a JSON/CSV exporter to the Jumplinks 2 format. As an example, the exporter will automatically convert {page:segment} to {page:[\w_-]+}. However, if we choose to use the wildcard type aliasing (discussed above), then this exporter need only export the data on an as-is basis. Note: Due to Jumplinks 2 development, all new features requested by the community will not be added to v1, but will be implemented in v2 instead. It will, however, be easy to migrate from v1 to v2 in order to use those features. I also plan on making v2 compatible with only ProcessWire 2.8 and 3.0, and Mapping Collections will still be supported. I'm writing about this now so that we can discuss it - I'd appreciate your thoughts on the change, which I think is beneficial to the module going forward. (I hope everyone is doing well - haven't been around often enough to see new modules and some of the new progress on PW3; but getting there slowly.) Update: I forgot to mention that FastRoute also allows for optional segments which allows us to jump from, say, /page.php?parent={parent}[&child={child}] to either, say, /{parent}/{child}/ or /{parent}/, depending on the input. Sure, I don't see a wide variety of use-cases for this feature, but I'm sure it'll come in handy to some.3 points
-
Dynamic Selects Released 27 July 2016 Dynamic Selects is a commercial module that enables the creation of dynamically related/dependent ajax-driven chained dropdown lists (aka cascading selects) for display and storage of multiple types of data. The module can be used both in the front- (display only) and backend (display and storage of data). Setting up Dynamic Selects is very easy. With minimal effort, site developers can set up simple or complex chained selects. By making a selection in a trigger dropdown, via ajax, values are fetched and dynamically populate options in the dependent select. In turn, making a selection in the now populated select triggers the same action further down in a dependent select. The module only uses/stores ID references to selected options in the selects meaning the most current/up-to-date data will always be displayed in the selects. Currently only ProcessWire managed data are supported. If there is enough demand, we may incorporate external data sources (typically JSON). The module consists of 4 modules ProcessDynamicSelects MarkupDynamicSelects FieldtypeDynamicSelects InputfieldDynamicSelects Video Demo: https://youtu.be/wkhx8xQ5ue4 Documentation: http://dynamicselects.kongondo.com/ Shop: https://processwireshop.pw/plugins/dynamic-selects/ Requires: ProcessWire 2.5 or newer and jQuery if using the frontend module (MarkupDynamicSelects) Features Easily create powerful ajax-driven cascading/chained selects/dropdowns Unlimited number of select dropdowns per field Data-mapping made easy thanks to multiple possible combinations of data relationships, triggers and sources Mutlipe data relationships to chose from ID-based data referencing ensures your data values always stay fresh Remote and local caching to speed up data access and reduce ajax-requests to server User-friendly, intuitive and easy to set up IMPORTANT Before using this module in the frontend, you will need to thoroughly read the security section in the documentation.2 points
-
I'm so confused. Today it just started working. I didn't even do anything. Maybe opcache related? Even tested on different PW2 and PW3 sites. HI @adrian and @horst. I tried Tracy debugger and here is what it shows (see attachment) It also confirmed that I was editing the correct php.ini file. Thank you both for your help. I'm hoping it won't happen again2 points
-
Aliasing is done now. As you can see from the "fromLog" (which logs changes to the "from" property), the original "from" contains a mix of a expression-based parameter and an aliased parameter, which then gets expanded to include the applicable parameter type, and then finally converted to the FastRoute-compatible regex. Originally, I wanted to have aliases convert directly to the regex equivalents, but we convert from parameter types to their regex equivalents anyway, so no need to add an extra step. I think I have everything sorted now - just need to start moving this into a freshly-baked module. Hopefully I can release a beta in the next week. Edit: Completely forgot about destination selectors (even though I can only really implement these in the module itself). I'd thought about re-conceptualising these, but something tells me the current implementation is fine. Only thing worth considering for me is changing from double-parenthises to single. Multi-language (feedback needed, please): I'd love some insight from those familiar with multi-lang setups on how I could possibly go about incorporating awareness into the module. The problem I see is that each multi-lang setup is different, and so it's impractical to implement a solution that only caters for one group of people, and I also think it's impractical to have too many solutions and bloat up the module. As such, feedback from anyone who has experience with the different kinds of multi-lang setups on how I could go about this would be most-appreciated. (Sorry for all the test logs - just showing that it works in case there are any concerns/suggestions.) Request URI: string(44) "blog/post.php?id=882991&title=This_is_a_test" Matched Jumplink Object: object(stdClass)#2 (4) { ["from"]=> string(47) "blog/post.php?id={id:\d+}&title={title:[\w_-]+}" ["to"]=> string(26) "post/{title}/?ref=post.php" ["deepClean"]=> bool(false) ["fromLog"]=> array(3) { ["original"]=> string(39) "blog/post.php?id={id:\d+}&title={title}" ["alias_expansion"]=> string(47) "blog/post.php?id={id:\d+}&title={title:segment}" ["regex_conversion"]=> string(47) "blog/post.php?id={id:\d+}&title={title:[\w_-]+}" } } Captured Parameters: array(2) { ["id"]=> string(6) "882991" ["title"]=> string(14) "This_is_a_test" } Parameter 'title' cleaned (deep = no) from 'This_is_a_test' to 'this-is-a-test' Compiled Destination: string(33) "post/this-is-a-test/?ref=post.php"2 points
-
I don't know homebrew, but to me it looks like the ini setting for "always_populate_raw_post_data" isn't (finally) set to -1. Have you checked it on runtime? The issue simply is, that you get a PHP warning as return of an ajax request, what then breaks your app (PW), as it expects another return, (a json object, and not a PHP server warning). You need to disable all php warning output, other then logfile, you need to check your ini settings for the mentioned setting on runtime, and / or you should set the mentioned setting on runtime too. Sometimes there are multiple php.ini files on a system, and it isn't quite obvious which one(s) are involved. So, additionally you may scan your filesystem for all php.ini files and explicitly set "always_populate_raw_post_data" to -1 in every file, if the runtime check shows that it isn't set to this.2 points
-
Surprising myself, I have figured out how to hook into Page::addable. class MemberBranchAddable extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Member Branch Addable', 'version' => 3, 'summary' => 'Grant addable access to users on their member page', 'singular' => true, 'autoload' => true, ); } /** * Attach hook to Page::addable * */ public function init() { $this->addHookAfter("Page::addable", $this, 'addable'); } /** * Page::addable hook * * Add children permission is granted based on edit. * If they have edit access, then they can also add children, * but only apply this if the $page->template = 'member' * */ public function addable(HookEvent $event) { $page = $event->object; // If page template is $singular continue // That $singular should come from the // configuration if ($page->template->name == 'member') { // If page is editable and generally can have children, then allow addable if ($page->editable() && !$page->template->noChildren) { $event->return = true; } else { $event->return = false; } } } Which takes care of: And removes the requirement to manually edit wire/modules/PagePermissions.module2 points
-
2 points
-
Have a look at the sql_mode setting of your MySQL server. This looks like ONLY_FULL_GROUP_BY is enabled.2 points
-
2 points
-
There have been a few issues raised here in the forums that seem to relate to SQL mode settings. There is nothing stated on the requirements page about SQL mode but it seems that certain mode settings can cause problems, and maybe even settings that are now enabled by default in MySQL 5.7. Might be a question for @ryan, or does anyone else know: What are the SQL mode requirements for ProcessWire?1 point
-
1 point
-
I have tried to improve the page list but I have to admit it's close to perfect as it is (at least for me). I see that this tweak could save some space but I'll wait until other page list related needs arise.1 point
-
In addition to @horst's comments, in case you don't know, you can find out which php.ini file is being used from phpinfo() - if you have Tracy installed, turn on the PHP Info panel. Otherwise you can get this info from php -i|more in your terminal. Sorry if this is already basic knowledge for you!1 point
-
No sign of any warning/notice anymore. Thanks a lot! I will probably turn this profile into a Foundation 6 based "base profile" of mine, in order to jump start my future projects.1 point
-
Those are just for github, so you'll see the nice text below the repo and other git related files. They do not include any further translations, so no need to upload them.1 point
-
I was using PHP 7.x maybe thats why I didn't see those errors. I'll check with 5.6.1 point
-
I should check those. What version of php are you using? What is your config for error reporting? Thanks1 point
-
1 point
-
Odd. Well you can always change the admin password $u = $users->get('ghost'); $u->of(false); $u->pass = 'your-new-password'; $u->save(); put that in the _init.php or another place. (later remove it when its done )1 point
-
See if the htaccess is active. normally Processwire installer transforms htaccess.txt to .htaccess About that line if (!$canonical) { $canonical = wire('page')->httpUrl; } maybe I should change to isset or not null?1 point
-
Thank-you BitPoet. That was it! I logged into MySQL on the server and used the following to fix it: SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); This was a brand new server that my boss had just spun up and moved the site to. I hadn't thought of whether a configuration issue could be the cause. pagefield.first.title doesn't seem to work on the multi-page fields, but just pagefield.title does, and it seems to behave as I would expect pagefield.first.title to behave.1 point
-
1 point
-
"mystyles" is working normally for me in the latest PW 3.0.28. Where do you see the error message - in your browser JS console? The error sounds like there is an attempt to load "mystyles" twice. Just guessing here - do you have anything in the "Custom Config Options" for the CKEditor field that refers to mystyles?1 point
-
1 point
-
Glad that helped @Torsten17 I am not someone who deals with multilanguage, but your suggestion sounds good to me, although I would have thought you'd want a double underscore to make the "dir" translatable? It might be best to make this suggestion in a Github issue so it gets Ryan's attention.1 point
-
Now you can see a fully functional website using this profile http://ninjas.cl1 point
-
$input does also have a url/httpUrl option if you're using urlSegments and you want those to be included.1 point
-
@MuchDev There is no $config->httpUrl but I can certainly do $pages->get('/')->httpUrl and that gives me what I need. Thanks for reminding me httpUrl. I forgot all about that because I was looking at the $config options only! @adrian It certainly does give me the port. Thanks for that1 point
-
Hi, I posted a link to Free Books earlier and it dawned on me belatedly I should post this too. Basically I was looking for some free components to use with ASP.NET MVC and came across Syncfusion's Community License program. I've used Syncfusion's suite of components many moons ago when I was working in Finance, and whilst all these component suites do have a bit of a learning curve they do provide a lot of components and robust functionality out of the box that you can leverage. It's unheard of that a well established company like this would provide a free, community license when they could easily charge 1500-2000USD for a license but I'm guessing they must be losing market share to their competitors like Infragistics, DevExpress, Telerik etc and this is a bid to claw some back. Again, a lot of the things lean towards Microsoft .NET technologies but there's certain things that might be of interest like the Javascript controls for Web/Mobile as well as some Excel/Word/PDF/Powerpoint libraries and Data Science library. And calling a .NET/C# method in a DLL/Class from php is possible using this https://github.com/david-garcia-garcia/netphp instead of http://php.net/manual/en/class.dotnet.php which only allows .NET 3.5 or below. Enjoy!1 point
-
I have found a strange bug in Jumplinks module, whereby entries can not be edited. I have opened a ticket on Github, with video and solution. https://github.com/rockettpw/jumplinks/issues/111 point
-
Looking again at my above implementation for additional content in the marker popup feels a bit hacky because the content of the popup is being constructed in MarkupLeafletMap.js I think the cleaner and proper way of doing it would be to construct the HTML that goes into the popup on the template file level and then pass it to the map render function. Something like this: $options = array(); $options["markerPopupContent"] = "<b><a href='{$page->url}'>{$page->title}</a></b>{$page->body}"; // ... more options $map = $modules->get('MarkupLeafletMap'); echo $map->render($items, 'map', $options); Hope to get your opinion on this. I would then implement the code into my fork of this module.1 point
-
I hate bumping really old topics, but since I've recently been looking at responsive images with regard to a central focal point, and this was the only topic that came up in a search (that I could tell was directly related), I thought I'd chime in and mention that there's a jQuery resource for defining a focal point when using various dimension based images in a responsive image layout. https://github.com/jonom/jquery-focuspoint I haven't looked closely enough (yet) on how best to possibly integrate this without requiring custom code in the templates, but it looks like a similar solution to the PHP-based solution offered here (and possibly more efficient overall). Below is an example of the script in action: http://jonom.github.io/jquery-focuspoint/demos/grid/lizard.html My buddy, the developer behind Statamic, built this (but customized) in to his CMS' control panel and his demo of it was awesome. It made me jealous that PW didn't have it, so the first step I did was to figure out which script he based it off of. So far I've only completed Step 1.1 point
-
There's no fieldtype or module for this, because PW already has all the things you need to do flexible and powerful tagging. Using page reference and the powerful inputfields it offers is the way to do it in PW, it's not an "alternative" way, it IS the way. It is far more flexible and powerful than what you have in MODX and most other CMS'. Everything else that stores tags in a textfield comma separated isn't going to give you the power you usually need with tagging. You won't easily be able to use that in selectors and so on. If you're building a new fieldtype, inputfield for tagging, you don't really understand what PW offers already and you will using the same approach at the end anyway. There was already lots of discussions and people were trying to come up with modules or fieldtype for it, but none of them really is a better solution. You can now install the Autocomplete module that comes with PW and use that to search and create tags on the fly. It has even improved from Ryan's blog profile, to create new tags without saving the page. The interface is simple and clients have no problem with it. As mentioned before, I also mostly use ASM select and the Autocomplete feature. Takes couple minutes to setup and can flexibly be used to later expand and use the tag pages for different stuff like listings,sorting and filtering etc. The page find selectors are there to do powerful stuff with page fieldtype already. Further you can use the tag pages later on to expand it with additional fields for and image or description. Possibilities are endless and a feature I love the most in PW (one of the big reasons I love to use PW).1 point
-
Hi Michael, I have not seen any fields like that, but as an alternative you could try using a "page" type field. It would create a new page for each tag, but has a nice friendly interface for the user to manage them. 1. Add a new page in your tree called "Tags Collection", and make it hidden. 2. Create a new field called Tags and make it a "page" type. 3. On the input field settings, make the "Parent of selectable page(s)" the Tags Collection page 4. For the "Input field type" try one of : Select Multiple, asmSelect or PageListSelectMultiple (I prefer the asmSelect) 5. Check the “Allow new pages to be created from field?” to allow the user to easily add new tags directly from the field1 point