Leaderboard
Popular Content
Showing content with the highest reputation on 07/05/2016 in all areas
-
New Template Editor panel just added! This is an alternative to the Template Path panel (which I still think is a great option) if you need to edit a live site, which of course you never do The difference with this compared to Nico's Template File Editor (http://modules.processwire.com/modules/template-editor/) is that it allows you to test changes without affecting other users currently viewing the site. Note that there are three buttons: Test: This will reload the page using the code in the editor - no changes are made to the template file or the code served to all other users of the site. Push Live: This will save the editor code to the template file, making this a live and permanent change. Reset: This will reload the page (and the code in the editor) with the code from the saved template file. Possible use scenarios Use this panel similarly to your dev console for tweaking CSS/HTML - it still requires a page reload, but there are likely less clicks than your normal workflow. Use it to tweak a live site if you're away from your computer and need a quick way to fix something, but want the ability to test first without breaking something temporarily due to a simple syntax error mistake or more serious code mistake. Use it to add debug statements: fl(), bd(), d() etc to your template code without ever touching the actual template files. This is a first version of this panel - I am looking for feedback and feature/behavior suggestions. At the moment this only lets you edit the template file for the currently viewed page. I am considering adding a dropdown where you can load other files (included files, JS, CSS files etc), but want to see what you guys think.9 points
-
Hello friends, I saw the great videos tutorials that Processwire got in English and German, but not in Spanish. So this is my first video, also was a good practice for learning ScreenFlow and Video Edition. This video covers a simple Installation on a local server using MAMP.7 points
-
Wow, the new Pingdom Website Speed Test result is... amazing Grade D, 10.29 seconds load time, 3.5 MB page size, and 206 (!!) requests.6 points
-
@Ivan Gretsky, there is a crypto module here that can create random token strings for you. If I remember correctly, you can just do this; $num_chars = 32; // The length of the token you want. Adjust as needed $random_key = CryptoPPP::genKeys(1); // Generates a seed key $token = CryptoPPP::keyToToken($random_key, $num_chars); // Convert to string token You can also define the character set that the random string is to use if you aren't happy with the default one. In fact, if you are going to use the token in a returned link, you'll definitely want to change the default character set used in the generation to only use url-safe characters.5 points
-
It's not unusual to hear of a website moving from WP to PW but this is the first time I've heard of one going the other way. Call me crazy, but I thought a business that wants us to believe they are qualified to pass judgement on the software used to develop websites might be capable of doing their own website development and customisation in-house.5 points
-
Nice - love the Textile reference I blame you and your forebears for this crazy language!2 points
-
2 points
-
Your English is just fine I was just taking a dig at you for not clicking "Like". English is such a weird language and please note that those definitions of "taking a dig" that I linked to sound a lot stronger than how most people think of it when using that phrase. Ribbing is probably closer to what I was doing.2 points
-
The whole process is not that difficult. Create a long random string and store in in the db. When a link is hit, check the db for that token and if found (and still valid?) login the user and delete the token from the db. The only real pain point could be the "create a random string" part depending on how secure the whole thing should be.2 points
-
I think that you: a) have only used short syntax for echo(ing) strings: <?= what is not the same as the short php opener. Please check and confirm. b) now, it is parsed and tells you that you have a parse error. A parse error at the last line of a file occures when you somewhere have an unclosed level of, e.g. foreach, if statement or something else. You have to go through your code and check if you have closed each opened one. In tis regard, I want to say that the code you use is not the best solution. I personally find it really hard to read, and it also is hard to maintain. There are many ways to keep the logic aways from the markup. Big and small solutions. But everything seems to be better than that. For example, you can do the php logic in the top of the file, and than merge it together with the markup. <?php // open the file in PHP mode, /** add comments to the file if needed. * This is a good place here. :) **/ // define a markup template with placeholders $myMarkupTemplate = " <a href='#'> <div class='port'> <img class='pic' src='[_URL_]'/> <div class='portbgrdtext'> <h5>[__GENRE__]</h5> <p>[__TEXT__]</p> <button class='portbtn'>Read More</button> </div> </div> </a> "; // now get your page and loop through your selections $portfolio = $pages->get("name=portfolio"); foreach($portfolio->portfoliopreviews as $portfoliopreview) { $search = array('[_URL_]', '[__GENRE__]', '[__TEXT__]'); $replace = array($portfoliopreview->portimg->url, $portfoliopreview->portgenre, $portfoliopreview->porttext); echo str_replace($search, $replace, $myMarkupTemplate); } Another approach could be <?php // get your page and loop through your selections $portfolio = $pages->get("name=portfolio"); foreach($portfolio->portfoliopreviews as $portfoliopreview) { $url = $portfoliopreview->portimg->url; $genre = $portfoliopreview->portgenre; $text = $portfoliopreview->porttext; echo " <a href='#'> <div class='port'> <img class='pic' src='{$url}'/> <div class='portbgrdtext'> <h5>{$genre}</h5> <p>{$text}</p> <button class='portbtn'>Read More</button> </div> </div> </a>\n"; } or you ommit the temporary variables and put out the field values directly: <?php // get your page and loop through your selections $portfolio = $pages->get("name=portfolio"); foreach($portfolio->portfoliopreviews as $portfoliopreview) { echo " <a href='#'> <div class='port'> <img class='pic' src='{$portfoliopreview->portimg->url}'/> <div class='portbgrdtext'> <h5>{$portfoliopreview->portgenre}</h5> <p>{$portfoliopreview->porttext}</p> <button class='portbtn'>Read More</button> </div> </div> </a>\n"; } There are many ways one can go.2 points
-
I especially dig the last two use-cases. Debugging an issue on the live site by now used to be lot's of if($user==…) statements.2 points
-
I just wanted to share this library here: http://barbajs.org/ It's a pjax implementations specifically for handling page transitions without full page-reload as simple as possible. It's super lightweight and can literally be installed by pulling the library in, adding two classes to your pages and a single line to initialize the whole thing. I've just added this to my personal site (https://kobrakai.de/) and beyond some js refactorings – mostly so that animations are not only triggered on page loads – it was a very smooth experience to add. Also I've probably only scratched the surface on this simple site. The docs look like this could handle even more complex setups if needed.2 points
-
No need for repeaters here. Pages are the most common solution for most things and are a right choice for this case too. Make a dog template, create all the fields you need, assign fields to dog template. Place all dog pages under same root (something like dogs). You can configure all dog pages to be automatically placed under the dogs page on creation. If you got the budget get ListerPro for admin - it will make finding the right page in the admin a breeze. If you don't, you can create a custom Process module for that. For the frontend filtering take a look at skyscrapers profile (live demo here).2 points
-
Thanks GuruMeditation, couldn't find the right topic. Seems understandable where they are coming from. WordPress does have some choice of prefabricated community plug-ins. If you aren't a developer or if there is no business case for custom development the choice is obvious. Hopefully they won't get hacked2 points
-
Here my friends at Jumpitt Labs used Processwire as the Main Framework for their website (because I recommend it to them) http://labs.jumpitt.com They are nice folks and make mobile apps and applications in Valparaíso, Chile. I didn´t make their website, I´m just post it to show it here Verification http://isit.pw/?url=http%3A%2F%2Flabs.jumpitt.com Image1 point
-
If you only need the images to be created and you know the sizes upfront, then simply call those width functions as part of the import process. $img = … // Create thumbs $img->size(700, 300); $img->width(200); …1 point
-
That's down to my not so perfect english. Thought this would mean a bit more of "liking something" instead of "understanding something".1 point
-
I would go with method 2 - let each person be a page on his own. That will make it easy for you to add properties (fields) for them in the future. For example, their performance stats or sоmething. You can use Page Table field (or RepeaterMatrix if you got ProFields) to manage all the team members on the same page, but it is optional. Each person this way can have an image field (gallery) on his own. You can get the first image from a person page on the team page to make a list of team members. I think it could beneficial for you to see the code of skyscrapers profile (live demo here). It is by Ryan and can open your eyes on quite a lot of ProcessWire possibilities.1 point
-
Thanks for the really detailed response @horst. I'll definitely try out all of these options as I continue to work with PW and get stronger at it. The first approach you've suggested is a cool solution!1 point
-
Just been there, thanks. I am hoping to find something on-site (or at least with an integration as a module) . P.S. And I think this link has all the rights to be here, Sergio.1 point
-
This sounds like you're missing a <?php or a ?> somewhere in that file either or some other syntax error, which puzzles the parser. Essentially the parser is mixing up php and html content different to what you intended.1 point
-
You should really try to read and understand the code of MapMarker. I was in the same situation as you are, and finaly made my own fieldtype very easily. I implemented LeafletJS easily just by reading the comments and the code (and found that the module was already done in the forum lol...). Take this module as tutorial, in this module you can find how to store and get data from. https://github.com/ryancramerdesign/FieldtypeMapMarker/blob/master/FieldtypeMapMarker.module#L142-L199 You will find an example there, and of course by looking at others module's code. Later, for exemple, you will certainly ask what are ___wakeupValue and ___sleepValue, and/or other methods. The step is to go through the forum and search. You will find good topics and hints here and there to understand. Also, you should experiment a bit, try to modify the code/datas, check the DB wih PhpMyAdmin and learn from. You will see your module's table with datas. And do not hesitate to ask help on the forum.1 point
-
Take a look at auth0.com: https://auth0.com/docs/connections/passwordless/spa-email-link1 point
-
No. Never. Should I? From time to time I dream about some code someone might need and put it inside a module Thanks @LostKobrakai for pointing out the sandbox mode. more about sandbox mode1 point
-
@bernhard Just noticed that before you wrote, glad it's fixed. AOS v026 is uploaded with two tiny update: allow ctrl+s on the first step of Add new page + adding sequential tabindices to inputs (textareas, selects). The latter solves the issue that often TABbing doesn't jump to the next input because there are other inputs in between. This solution isn't perfect but it's very simple, and it would do in most cases. Also works with ajax-loaded fields/tabs.1 point
-
Just gave barba.js a try and it's great, thanks for mentioning. I had to remove a similar but more clunkier solution of mine, but this is much better. There are some js events I have to modify in order to make them work but it's a no-biggie.1 point
-
How cool is that?!!!! ? One little suggestion is to add an orange status bar somewhere when the code differs from the original template file. Otherwise it could happen that you inspect/view other code than all live site users and don't know it1 point
-
I think they should have hire a in house developer. Its very important in any business to have the right people, sure wordpress its fine for publishing content but that should not be the main reason for ditching out processwire. At least they helped Processwire grow, Hanna Code was made for their use case of migrating a wp site to pw.1 point
-
Ok , I'm just putting this up here with the hope it might save someone else a bit of time. Both the issues I ran into have been resolved. I decided to install Ryan Cramer's Blog Profile. I used PW 2.7.2, and I am on MySQL 5.7.9. I discovered the first problem I hit had already been reported here : site-blog not appearing in intallation profile dropdown Of course I decided to Google it AFTER I had figured it out for myself - DUHHH. The second problem apparently was with the file install.sql located of course in the install folder. This sql was using a zero date '0000-00-00 00:00:00' to populate a timestamp field. I think there were about 90+ instances of this in the sql file. These inserts all threw errors. I didn't put too much time into looking for a solution on this. I found this but didn't care for allowing bad dates Allow Invalid Dates - MySQL What I did as a fix, was to change '0000-00-00 00:00:00' to Now() in the install.sql file and re-ran it. That seems to have worked. When I went back into the Admin I had all greens on the update steps. Thanks to Ryan four years after the fact for providing us with this ready made Blog profile. Good stuff! I hope to learn from it AND use it as well. Have a good one...1 point
-
@David Karich - Thanks. I've committed your fix to the dev branch and commented. @OllieMackJames - This could very well be the fix you need. Please would you test it as well?1 point
-
This is taken from their website.... https://www.cmscritic.com/extreme-makeover-cms-critic-edition/1 point
-
Hi, I was just browsing cmscritic.com and noticed that it felt quite slow. Looking at the source it seems that they moved back to WordPress? Does anyone know what motivated this move?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
-
So, it's a PW 3.xx issue. Once we have an official stable release of PW 3.xx I'll test all my modules to ensure they are version 3.xx-compatible.1 point
-
http://modules.processwire.com/categories/premium/ I agree, that "one shop to rule them all" would be best for everyone. Even better, if it would be integrated into ProcessWire somehow.1 point
-
Thanks, these make sense. Another feature request (from the client) is to be able to reset multiple or all jumplinks' hit counters. Currently there are only a few but this sounds handy, eg when going live and would like to start with a clean slate. Looking forward to v2!1 point
-
1 point
-
@tpr - Thanks, glad you like it. I have started building Jumplinks 2 from the ground up, but haven't had the time to continue work on it of late. With regards to the state-toggle: I can implement this feature, but it would be turned off by default. That said, if the feature gets enabled, the jumplinks would all be created to redirect with status code 302/307 (actuallly not 100% sure which one is better). That said, is isn't necessary to do so, but not doing so would mean going against the intention of the different HTTP codes. As for previews: these can be somewhat difficult, giving consideration to parameters - I think I may have brought this up before here. It would be easy to preview jumplinks that don't have parameters, but those that do have them would need user input in order to test. This is all on my to-do list for the new module, which will be compatible with both PW 2.8 and 3.0.1 point
-
@Robin S Have a look in the PageTraversal class (/wire/core/PageTraversal.php), and the _next() method. It's all in there. The gist of it is that it works roughly the same as before, with one big difference: rather than loading all the sibling pages (Page objects), it loads all the IDs instead (integers), in order. It doesn't always have to load them all either, just enough to determine relative positions. Once its found the needed ID(s), it converts them to Page object(s). It also involved upgrades to the PageFinder class so that it could support startAfterID and stopBeforeID options. If you look at the end of the PageTraversal class, you'll see an earlier implementation that I worked with for a couple of days before coming across a couple of situations I just could not get it to work in (and became clear it never could), so ultimately had to abandon it. However, since it relies on how sibling pages are sorted (rather than relative positions), it doesn't have to load near as many, making it potentially faster (and more memory efficient) if there are thousands or millions of siblings. Though in my own testing, it was always slower until the scale got really large. Not to mention, it's a whole lot more complex, and can't cover all situations. But I'm leaving it commented out in there for a little while (for reference) since so much work went into it before finding a much simpler solution.1 point
-
1 point
-
I think actually the problem is in the details. The module's regex doesn't seem to account for href=' only for href=" So this should be: if($l->adr_email) $out .= "<a href=\"mailto:$l->adr_email\" class='link_mail'>$l->adr_email</a> <br>";1 point
-
Hi guys I feel certain that when I export field and template data using the built-in tools in the PW admin there must be a way to use this JSON in my own modules as part of the install routine to set up these fields and templates, but I can't figure it out. Any ideas?1 point
-
@EyeDentify I get what you mean, but this is a short of shortcoming when there is no huge capital behind an open source project. The constant evolution of the system is a must, so there are little resources left for the rest. But we might want to try out crowdfunding, to raise some money on the vey first ProcessWire "book" (it should be online, so that it can be updated easily by volunteers later on). such as: http://crowdfunding.com So anyone interested can spend the time on such a book, without sacrificing too much free time/resources, and the result can be what it really should be. This book should be about introduction to ProcessWire as a whole, front-end development, admin customizations and of course, module development. I would be happy to support such a book. Anybody else?1 point
-
Thank you Benjamin. It seems I often pick up very useful information from your posts. I wanted to say thank you also for this link you posted recently. http://adamwathan.me/refactoring-to-collections/ It's prompted me to put some time aside to do some self-study on functional programming done with PHP Here's just a few additional links I found should anyone else be interested - There seems to be a good amount of information out there on the subject. https://blog.liip.ch/archive/tag/functional-programming https://www.sitepoint.com/functional-programming-and-php/ Thanks again.1 point
-
Hey PW, I am only a starting developer and I am still in school and my experience with processwire is quite small but recently I've created my own module for Processwire and I kind of had to ask and copy a lot from other sources, now I want to create a small walk through tutorial for people with the same lack of knowledge as me And as a guide for myselfs in the future 1) Setting up the file. Okay, so we start of by making a new document in the Module root folder and call it Harmster.module for this example, we dont need to add the .php extension. Now every module in Processwire needs to extends the classes and methods from Processwire itselfs so we start off by typing class Harmster extends Process{ } You can also extend WireData, I don't really understand the difference but both work for me A module contains 2 standart classes, init() and getModuleInfo() init() This is kind of, or the same as a __construct() method, this always executes and is executed almost at creation. getModuleInfo() This is a method that is used to show the information in the Processwire CMS. We both need to add these to our fresh class like following: class Harmster extends WireData { public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 100, 'summary' => 'Harmster module' 'singular' => true, ); } public function init() { $this->setFuel("harmster", $this); } This is where I, as a starting developer, get really excited about this little code in the init() method $this->setFuel("harmster", $this); Basically creates your class in every template you are going to use and it is callable by $harmster Woah! awesome right! Now this is where I got stuck on, I the user to configure some options in the module :\ hmm... Well I just went asking on the forums and the super nice community of PW came to help me, Wanze in this case (no emoticon because its not allowed) (Check it for yourselfs, http://processwire.c...lds-for-module/) And basically you need to implement some methods from an another object, you should replace this, class Harmster extends WireData implements Module with class Harmster extends Process implements Module, ConfigurableModule But when you add that and try to use your module you'll see you get an error, we need to add one more method to the class called getModuleConfigInputfields add static public function getModuleConfigInputfields(array $data) { } 2) Adding a configurable and usable textbox But now you want to add some input fields, now this is pretty hmm complicated For a simple textbox you put this inside the method you just made: $modules = Wire::getFuel('modules'); $fields = new InputfieldWrapper(); $field = $modules->get("InputfieldText"); $field->attr('name+id', ''some_text_field_saved_name''); $field->attr('value', $data['some_text_field_saved_name']); $field->label = "Hamsters rule!"; $field->description = 'Enter a nice sentance here if you like hamsters'; $fields->append($field); Now you've created a input field and you can use it with $this->get(''some_text_field_saved_name''); in all your methods in this class (no emoticon because its not allowed) If you're lazy Now what you've created is a configurable module, heres a I am lazy and i want to pastey (no emoticon because its not allowed) class Harmster extends Process implements Module, ConfigurableModule { public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 001, 'summary' => '', 'href' => '', 'singular' => true, 'autoload' => true, ); } public function init() { $this->fuel->set("harmster", $this); } static public function getModuleConfigInputfields(array $data) { } } Now if you want to add a overview page, much like the setup, pages, acces and module tab in Processwire CMS default you can easily do this by adding 2 new methods in your class, install and uninstall 3) Creating your install and uninstall So you want to get a nice overview for your module now eh? Well we can do that because Processwire is awesome like that I did this for my module Now, we need to add 2 methods to our class, ___install and ___uninstall (yes, 3 underscores) So add this to your class: public function ___install() { } public function ___uninstall() { } I think that these are kind of self explaing, the one method gets executed when the user installs the module and the other one gets executed when the user deinstalls the module. Now we want to add a page to PW CMS, but how (no emoticon because its not allowed) Thats actually really easy, $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'MailChimp'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } This is how you install a page, notice that we name the page to self::PAGE_NAME therefor you want to add const PAGE_NAME = 'harmster-module'; with the name of your module BUT BUT now everyone can look in to this module D:< i dont want that! Ofcourse you dont want that. Clients are famous for breaking everything where they put their hands on, so we need to create permissions! Now the way you make permissions is just genius and so easy, you just add this to your ___install method, $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } And you create a permission constant just like PAGE_NAME like this const PERMISSION_NAME = 'hr-view'; And of course you can create more permissions, just genius! Now what our install method should look like is this: public function ___install() { $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'Harmster'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } } This will set a module page up for you And we create an uninstall method, this basicly reverts your installed permissions and pages. public function ___uninstall() { $permission = $this->permissions->get(self::PERMISSION_NAME); if ($permission->id) { $permission->delete(); } $page = $this->pages->get('template=admin, name='.self::PAGE_NAME); if ($page->id) { $page->delete(); } } Now you are might be wondering, how do i get to display content in my page :S Well, I kinda stole this from other modules and it does work, but I am open for suggestions. the method ___execute gets executed when you click on your page in the PWCMS. What i wrote in there is public function ___execute() { return $this->_renderInterface(); } and in renderInterface() i put the next code: private function _renderInterface() { $this->setFuel('processHeadline', 'MailChimp synchronize tool'); $form = $this->modules->get('InputfieldForm'); $form->attr('id','ga_form'); $wrapper_audience = new InputfieldWrapper(); $field = $this->modules->get("InputfieldMarkup"); $field->label = $this->_("Gebruikers"); $field->columnWidth = 100; $members = $this->list_members($this->get_apikey()); $html = "<table class='AdminDataTable AdminDataList AdminDataTableSortable'>"; foreach($members['data'] as $member) { $html .= "<tr><td>" . $member['email'] . "</td><td>" . $member['timestamp'] . "</td></tr>"; } $html .= "</table>"; $field->attr('value',$html); $wrapper_audience->append($field); $form->append($wrapper_audience); return $form->render(); } Bascily you create a form and you render the form and that displays it for you, just play around with it for a bit and you'll get into it, as i am still getting into it. I am lazy, here a copy, pastey (no emoticon because its not allowed) <?php class Harmster extends Process implements Module, ConfigurableModule { const PAGE_NAME = 'harmster-module'; const PERMISSION_NAME = 'hr-view'; public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 001, 'summary' => '', 'href' => '', 'singular' => true, 'autoload' => true, ); } public function init() { $this->fuel->set("harmster", $this); } static public function getModuleConfigInputfields(array $data) { } public function ___install() { $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'Harmster'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } } public function ___uninstall() { $permission = $this->permissions->get(self::PERMISSION_NAME); if ($permission->id) { $permission->delete(); } $page = $this->pages->get('template=admin, name='.self::PAGE_NAME); if ($page->id) { $page->delete(); } } public function ___execute() { return $this->_renderInterface(); } private function _renderInterface() { $this->setFuel('processHeadline', 'MailChimp synchronize tool'); $form = $this->modules->get('InputfieldForm'); $form->attr('id','ga_form'); $wrapper_audience = new InputfieldWrapper(); $field = $this->modules->get("InputfieldMarkup"); $field->label = $this->_("Gebruikers"); $field->columnWidth = 100; $members = $this->list_members($this->get_apikey()); $html = "<table class='AdminDataTable AdminDataList AdminDataTableSortable'>"; foreach($members['data'] as $member) { $html .= "<tr><td>" . $member['email'] . "</td><td>" . $member['timestamp'] . "</td></tr>"; } $html .= "</table>"; $field->attr('value',$html); $wrapper_audience->append($field); $form->append($wrapper_audience); return $form->render(); } } I'll update this tutorial in the near future as i am still working my way up (no emoticon because its not allowed) Aww, i get an error when i save it, thats not nice. Thanks for reading (no emoticon because its not allowed)EDIT Updating this tutorial very soon, its horrible and incorrect1 point
-
There is start? $posts = $pages->find('template=news, sort=-created, start=80, limit=40');1 point
-
As you wait for other responses, have a look at the following examples from AdminSaveActions module. It looks really straightforward. Thanks for asking this question...I'll be needing this soon . Seems, you set the defaults in one function, then build the form/fields in another function using the defaults previously set...or something along those lines AdminSaveActions module static public function getDefaultConfig() {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L51 public function __construct() {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L105 public static function getModuleConfigInputfields(array $data) {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L390 MaintenanceMode module static public function getDefaultData() {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L25 public function __construct() {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L38 static public function getModuleConfigInputfields(array $data) {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L52 ProcessTrashman - Last one, static public function getDefaultData() {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L42 public function __construct() {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L54 static public function getModuleConfigInputfields(array $data) {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L255 MarkupRSS module - Sorry, the very last one (this one has more detailed defaults and some notes) protected static $defaultConfigData = array() https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L32 public function __construct() {} https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L67 static public function getModuleConfigInputfields(array $data) {} https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L219 Tutorial on forum - Create your first Module with configuration settings and a overview page: http://processwire.com/talk/topic/2318-create-your-first-module-with-configuration-settings-and-a-overview-page/ However, this Tut does not set defaults, which I think I have read somewhere is good practice to do? OK, sorry, am overdoing it but this will help me later too ;-) Edit: corrected wrong links + added a tutorial from the forums Edit 2: Something has been eating my links! Anyway, added methods/properties names...1 point