Leaderboard
Popular Content
Showing content with the highest reputation on 04/16/2015 in all areas
-
Hey, as I often just copy someone else's (sometimes my own) modules structure as a starting point for a new module I thought there has to be a better way to archive that. That's why I created the "ProcessWire Module Generator": modules.pw If something missing? Or some more wishes for options or best practices? Let me know Here's a screenshot:21 points
-
Yep possible, what I sometime like to do is prefixing my template names. For example: $templates = $this->templates->find("name^=element_"); and then returning all templates starting with element_. This will save me from 'forgetting' to set family settings & i'm lazy You could write an autoload module and Hook to: $this->addHookBefore('ProcessPageAdd::getAllowedTemplates', $this, 'beforeGetAllowedTemplates'); public function beforeGetAllowedTemplates(HookEvent $event) { $parent_id = $this->wire('input')->get('parent_id'); $parent = $this->pages->get($parent_id); if (!$parent->id) return; // As it is a before hook, replace it $event->replace = true; $array = array(); // All templates starting with name element_ for example $elements = $this->templates->find("name^=element_"); foreach ($elements as $template) { // Do your dingdingdong $array[$template->id] = $template; } $event->return = $array; }8 points
-
Work process of my new website. 1.- Client area - Frontend login - View invoices - Submit a ticket - Change password - Domain Expiration - Hosting plan - Logout 2.- Frontend 3.- Backend6 points
-
6 points
-
@Lostkobrakai: Added all of your suggestions @marcus: Of course! Let me know if I need to change something or if you want the source code @Craig A Rodway: Fixed it. @kongondo: It's written in PHP and doesn't use PW as backend. So I wasn't sure where to post. But probably module section would be the way to go. I moved it there now. And I removed the closing thing. @blad: Thanks!5 points
-
4 points
-
I think it's funnier that he's supermom (I think that word filter is a leftover from when someone was posting links to all sorts of illegal film downloads a year or two ago).4 points
-
@berechar, Not possible out of the box, you need to build a module for that. The good thing is I have a gist that does bidirectional save / remove for 2 pagefields and 2 templates. You have to change the hard coded values in that gist or B) write a proper configurable module for that. (Code a module for this? someone? me not having much time, sorry )3 points
-
I do not want to start a discussion and I can definitely understand both points of view. It's better to contribute to an existing module as reinventing the wheel again and again. But sometimes it's also good to have the possibility to choose between modules so you be able to pick the module which fits the best to your needs. Had I known what was awaiting me during this project, I maybe would have used the existing validation module. On the other site, processwire comes with some great sanitizers which are designed for the special processwire purposes (for example $sanitizer->username). An external validation library will never support this but sometimes you do want to test exactly such behavior and it's already there. Why not use this?3 points
-
Amazing tool, looks massively helpful! Thanks! (Could we put your generator into a wireshell command, kind of like Mike suggested some days ago?)3 points
-
first: "the better one - is the enemy of the good one" (german adage i think) second: this is OT but this fact is one of the little deficits in the modules directory ->is it tested? hmm yes it is in the modules directory ->workd with PW version is not always uptodate....but if you reading some days the forums you learn that almost all older modules work with the actual PW version. maybe there could be a rating like the "Like" function to hit a button for logged in users "Tested with version" and on the Compatibility line it could be a tag like this Compatibility (Usertests) | 2.5 (12) would be very more informative for new PW users and the module autor (or someone else) would not have to set the modulenumber higher since there is an positive test for this version.....and this would give a good filter like "most tested" or modules "tested for 2.5"....just an idea sorry for OT may this post fits in a other threat better. @justb3a: thank you for this one, like Sephiroth wrote GUMP is may not the best option for everyone and your module looks very clean and easy to use i'll try it with the next project (there will be a lot to validate so i will report in a few weeks) !3 points
-
Hi If you don't mind, please would you let us know why Jumplinks doesn't work for you? Redirects isn't able to handle index.php?something requests, but Jumplinks is. In your case, setting it up would be as simple as this: Step 1: Create a new Jumplink. Source: index.php?id={id} Destination: {id|pages}/ Step 2: Create a Mapping Collection called pages, containing the following Collection Data: 33=products 36=contact 37=imprint I'm also sure you'd have more of those to add. Jumplinks will then check the incoming request, find a match, map the page ID to the respective page in the collection, and redirect with a 301 status code accordingly. Really easy3 points
-
I don't think so, its better to have multiple options yeah there's an existing Validator Module however they will always have different design paradigm I for once don't like GUMP, I like this API it's cleaner also it reminds me of Yii, imagine a platform where we only have one option. @justb3a I actually love this Validator, will probarbly fork this and see ways to add custom validation and also a way to inject this in InputForm process input. Good work bro or sis3 points
-
Image Animated GIF v 2.0.2 Module for PW 2.5 stable or newer, but is obsolete for PW Versions greater then 3.0.89 (... read more ...) This module helps with resizing and cropping of animated GIFs when using the GD-Library. The GD-Library does not support this. This module is completely based upon the fantastic work of László Zsidi (http://www.gifs.hu/, builts the initial classes) xurei (https://github.com/xurei/GIFDecoder_optimized, enhanced the classes) I have ported it to a PW module and it works with core imagefields, together with Pia and with CropImagefields that uses the new naming scheme since PW 2.5. ------------------------------------------------------------------------------------------------------------------------------------------ read more in this post about the rewrite from version 1.0.0 to version 2.0.0 ------------------------------------------------------------------------------------------------------------------------------------------ You can find it in the modules directory: https://modules.processwire.com/modules/image-animated-gif/ and on Github: https://github.com/horst-n/ImageAnimatedGif ------ A preview can be found here2 points
-
I changed the directory structure to conform with Processwire standards and renamed the module classname to FormDiceCapture to conform naming conventions. The version number has been increased to 0.1.1. In case you have the module installed you will have to change the calls to $modules->get('DiceCaptcha') to $modules->get('FormDiceCaptcha'). Sorry for any inconvenience caused by that. I though I might rather change that now than later when there is more users.2 points
-
There is currently a dev branch available where I started a complete rewrite of the Module. This is needed because the 1.0.0 Version only handles animated GIFs with photos right, but fails with some sort of graphics: After a short and successful research (5 minutes in a support forum thread of László Zsidis GIFdecoder class) I found an enhanced class of GIFdecoder. With it, I was able to position the frames correct, but has many trouble with background colors and transparency (example). More can be read here at Github, where I asked xurei, the author of the GIFDecoder_optimized class for help. And with an upload of the corresponding GIFEncoder_optimized class, I was able to submit the manipulated frames with respect for transparency, what the old encoder couldn't handle. Sometimes you get lucky! So, a big big thanks to xurei from all future PW users that need support for animated GIFs with GD-lib. The results of the current dev branch, version 1.0.2 looks much better now: Only thing currently missing is cropping with tools like Thumbnails etc (cropExtra). This is on the ToDo.2 points
-
Fascinating - I never thought such an issue would come up. (Not a brightspark when it comes to things like that. And case-sensitive stuff never impacts me as I use Windows. In fact, that could even be the issue - though, I doubt it because only Unix filesystems are sensitive; I wouldn't think that would expand to MySQL.) Anyways, I've just attempted the selector idea, currently on the dev branch. Basically, you can to define your destination path like so: [[template=product-legacy, legacy_item_id={id}]] So that means that anything in double-square-brackets is to be treated as a selector. I've used the following to check - hopefully it is enough... $convertedWildcards = preg_replace_callback("~\[\[([\w-_\/\s=\",.']+)\]\]~i", function ($mapCaptures) { $page = $this->pages->get($mapCaptures[1]); if ($page->id) { return ltrim($page->url, '/'); } }, $convertedWildcards); My test yielded the following log: Page not found; scanning for jumplinks... - Checked at: Thu, 16 Apr 2015 17:30:56 +0200 - Requested URL: http://processwire.dev.local/legacy?id=43 - PW Version: 2.5.26 == START == [Checking jumplink #177] - Original Source Path: legacy?id={id} - Escaped Source Path: legacy\?id={id} - After Smart Wildcards: legacy\?id={id:num} - Compiled Source Path: legacy\?id=(\d+) - Original Destination Path: [[template=basic-page,legacy_item_id={id}]] - Compiled Destination Path: http://processwire.dev.local/testing-this-page/ Match found! We'll do the following redirect (301, permanent) when Debug Mode has been turned off: - From URL: http://processwire.dev.local/legacy?id=43 - To URL: http://processwire.dev.local/testing-this-page/ Which means it works. Nonetheless, please give it a test-run and let me know if you run into any issues, or if anything needs to be enhanced. Once we're all happy, I'll pull to master and update the docs.2 points
-
Wicked Nico! I think this could really help us all get a standardized thing going on with our module development, including using strings as version numbers What about an option to make use of the new module config possibilities: http://processwire.com/blog/posts/processwire-core-updates-pull-requests-and-more-2.5.25/#module-configuration-is-now-even-simpler2 points
-
UPDATE: Now the dev branch also supports centered crop! Only thing missing is cropping with tools like Thumbnails etc (cropExtra) and other API crop calls then centered are currently not tested.2 points
-
I am no expert in htaccess commands so won't help you out with this. But I can't see why those redirect modules do not fit. They return 301 http status codes as far as I remember - you can check yourself with something like this. I still vote for going "the module way" here.2 points
-
// maybe a link to the PDF is enough echo "<a href='{$page->showPdf->url}' target='_blank'> download a nice PDF here </a>";2 points
-
I like the current behavior in that you can save a page unpublished and the populated fields will be saved. Even if you try to publish, the populated fields will be saved, it's just that it won't actually publish until the required fields have been populated. But I would like the option to not show the required warnings unless the user is actually trying to publish the page. On templates with long complicated sets of fields, there are plenty of times you don't want to fill out everything right away and I think the warnings are intrusive at this point. I am thinking this would be a template level setting, but I guess it could also be per field, but that might be a little annoying to set them all? If it was per field, then it should be available as a template context override as well. Of course the title field should be treated differently. Anyone else have any thoughts on this?2 points
-
I was looking for a way to organize service modules for a site and found this topic. As my question is a bit broader, I decided to start this new one in General Support. How do you organize module files in your module folder? Sometimes I get quite a few similar one-purpose modules which I will never re-use. It feels wrong having separate folder for each one (and even having them listed on the module page) as they just change title on save or something like that. Do you group similar functions in one module? Do you batch install them somehow with a master module?1 point
-
Thank you! It was obvious what I overlooked. Having picked a "Template for selectable pages", it works perfectly.1 point
-
Look at the description of how to use "Allow new pages to be created from field?": 1. Both a parent and template must be selected above. 2. The editing user must have access to create/publish these pages. 3. The label-field must be set to "title (default)". Have you specified a template new tags should use?1 point
-
1 point
-
ok thanks - sorry didn't see those instructions; will be back on this tonight and will report back...1 point
-
Since PW 2.5 it is also possible to use a MyModuleName.info.json file instead of the integrated getModuleInfo() method. With it, it is the same case as with the new module config possibilities. Both needs some logic, but worth to support it. (And now the logic can become an own function, because it will be used twice )1 point
-
horst - agreed it will add a complication, but I think a worthy one - otherwise the lazy side of me is going to continue to use the old method, even though some other elements of my modules will likely require PW 2.6 anyways, just because it's easy to copy/paste from existing modules. I think Nico could do a great job of allowing the new option if you check that the module is only compatible with 2.6 anyways. Also Nico, in your validation of fields I think it would be great to enforce camelcase where required. Should be easy enough to compare the entered string to its camelcase version to see if they are the same.1 point
-
Oh Nico, SuperMom, what a fine thing! I have tested it and love it. - Now, after you have removed the closing PHP-tag, the closing class bracket is also missing } - I would remove the option for makin a module permanent. This would be only needed in very very special cases only. - my requires for PW and PHP are not shown in the getModuleInfo() - I have selected to make it a ConfigurableModule and to get a configpage as external file, but it seems it has not all needed code in its result. I the attached zip is the generated code and a screenshot of my choices. @adrian: yes, supporting the new module config possibilities would be nice, but than there is a logic needed in regard of the PW versions a module supports.1 point
-
Got it! You were right! I had to: Once the Language Support Page Names module is installed, go and edit your homepage and click on the settings tab. And I changed it to "en" and it solved the problem. I'm learning Processwire. So, forgive me if I'm bombarding this forum with too many questions. I feel like I've got all the answers I needed for the major part of my website. Thank you, everyone!1 point
-
As multilangual support is not on by default, you have to turn it on by yourself: http://processwire.com/api/multi-language-support/multi-language-urls/. Probably the 1st time you installed PW with multilangual profile, where corresponding module is preinstalled.1 point
-
I changed the directory layout to conform with Processwire module standards. To do so, the github repository had to be renamed. The version number was increased to 0.11 BTW: I asked myself if one should extend this module to allow for arbitrary class additions to parent elements. If there is the need for another selector that adds a class to an element based on the existence of a sub-element I could change the class to allow for that.1 point
-
1 point
-
1 point
-
If you want to see page A on page B you can install the Page References Tab module. This adds another tab in your page showing which pages are linked.1 point
-
I suppose you can, given that the module is still in Alpha. You would then make an announcement here (and especially in your first post). I would also recommend you polish up the readme a bit ....just a little bit about what the module does (I know we 'all' know about captcha...but nice touch to say what your module does all the same). Thanks!1 point
-
There is this module by Ryan. Sounds like that’s what you want. Using the visibility setting to hide a field is probably a bad idea, because that will only hide it client-side with JavaScript.1 point
-
@austin11 I see no value for ProcessWire in your post Next, you're linking to commercial websites in your footer.1 point
-
Naming Conventions: Have a look at these: https://processwire.com/talk/topic/2394-how-to-present-your-module/ http://processwire.com/api/modules/ That is what Horst meant by: Note though that the class name still has to be...ClassName..., i.e. just the way you've named yours.. Directory structure... ....should be fine. PW will automatically create a directory named after the module class (ProcessMakeCoffee) when that module is installed if you've submitted it to the modules' directory. Otherwise, the normal instruction is for your users to create the directory if manually installing the module....Have a look at the GitHub project pages of some of the modules in the modules' directory..e..g. https://github.com/ryancramerdesign/FieldtypeEvents https://github.com/somatonic/MarkupSimpleNavigation https://github.com/horst-n/WireMailSmtp1 point
-
Not really. It is much faster on production, I get 340 ms for the same page on a shared linux hosting. As for me, I always get better results going live. Probably because the server is optimised for that exact task. Most of the time is spent building a page (which is faster on server), not transpoting it here and there. I just checked it in the dev tools - you can get those details)1 point
-
It's a very valid question. It's where it can lead to a module mess much like in every module/plugin based system. The kind of: "I have 20 modules that do validation. Which is better, which really is tested and works? Which works for which PW version..." etc.1 point
-
On the topic of performance, I'm now wondering if I should set up a cache system for Jumplinks. It was mentioned by Antti a while back that Jumplinks is already feature-rich, but I think that caching redirects will actually be a life-saver for some users with large sites. At the end of the day, running the regex engine for every incoming request is sure to be a big performance hit on any server (the way I see it). I'm sure everyone agrees this should be added? There are also a few other fixes and enhancements in the pipeline, the most important one involves optional query-strings (much like the QSA flag for mod_rewrite). At the moment, if you want to match something.php and something.php?foo is requested, the redirect will not occur. In order to get it to work, you'd need to add {all} on the end of the source URI, which is, quite frankly, not the best way of doing it.1 point
-
I've changed it so anyone can set the first tag as a prefix, however staff will need to be vigilant and see that it is being used properly (I believe the original use case was to clearly define the different types of topic in the module forum, which may not be a problem in future with some restructuring anyway).1 point
-
1 point
-
Hey marcus, all, Is there anyone played with the importing / exporting of the fields and templates via json and keeping them on the module. May be we can make that a wireshell command . I was looking at continuous integration of fields and templates.1 point
-
At this point it's a bit like asking to drop php in favor of go. PW is a php/(my)sql framework by nature, and that's what it will continue to be. I would love to see other projects assumidely inspired by pw but built in other systems popping up.1 point
-
Page References Tab This little module adds a new tab, References, to the page editor. There it lists pages referencing the page that is being edited (title, path, field). There are also links to view or edit the listed pages (if they're viewable/editable). Only fields of type FieldtypePage are considered to be references and system fields are not listed at all (roles, permissions). It's nothing much, but as the subject has turned up a couple of times in the forums, I decided to give it a try. So watch out what you're asking! Screenshot Links Modules directory: http://modules.processwire.com/modules/page-references-tab/ GitHub: https://github.com/niklaka/PageReferencesTab1 point
-
You could make your own: // a filename array for scripts in the head (make the name you wish) $config->headScripts = new FilenameArray(); // a filename array for scripts in the bottom (make the name you wish) $config->bottomScripts = new FilenameArray(); // add scripts to the head FilenameArray $config->headScripts->append('/your/wished/path/head.js'); // add scripts to the bottom FilenameArray $config->bottomScripts->append('/your/wished/path/bottom.js');1 point
-
Ah, right. I'll just have to make sure I install the hooks consistently next time then.1 point