Leaderboard
Popular Content
Showing content with the highest reputation on 02/07/2016 in all areas
-
Hey Guys, here is another website we made at WPWA back in 2013, for the German luxury home accessorie brand "Twillow". The page is quite puristic and based on PW V2.3.0. We build in some cool features like the 360deg slider on the product pages. http://www.twillow.de/ Latest projects coming soon!7 points
-
Wire Queue Wire Queue is a module that allows easy creation and usage of Queues in ProcessWire. It is based upon a basic parent module (WireQueue) that should have one or multiple StorageHandler modules installed too. This beta release contains a simple plain text storage module, WireQueueTextfile, and a simple Sqlite3-DB storage module, WireQueueSqlite3. The base module creates the needed: FIELDS (wire_queue_type, wire_queue_state, wire_queue_storage_options) TEMPLATES (wire-queue-container, wire-queue-storage, wire-queue-tools) PAGES (wire-queues = container for all Queuepages, wire-queue-storages = container for StoragetypePages) ROLE (wire-queue-admin) Each storage module creates one page under wire-queue-storages. New Queues can be created in the backend by adding a new page under "Wire Queues". After creation one have to select a Storage type from availables list and publish the page. After that, there are some buttons available to start / pause / and close the queue. Putting and getting data to and from the queue is done via API calls. First you have to get the page that holds the queue object. // get and validate the queue handle if($queue = $pages->get(SELECTOR_TO_DESIRED_PAGE)->wireQueue()) { // wrap your data into an array and pass it into the queue $success = $queue->addItem($data); ... } // get and validate the queue handle if($queue = $pages->get(SELECTOR_TO_DESIRED_PAGE)->wireQueue()) { $data = $queue->getItem(); ... } Thats basically all what you want from a queue. Following are a few conveniences: $queue->getPage()->title gives you the title of the queue, ($queue->getPage() returns the page object) $queue->className() shows the StorageType of the queue $queue->getState() and $queue->getStateStr() returns the current state of a queue: 1 = new / empty 2 = enabled / running 3 = paused 4 = closed / archived $queue->itemCount() gives the total number of all pending items in the queue Here is code that gives an overview of all Queues in the system: $container = $pages->get('template=wire-queue-container'); $bodyContent = "<h1>$container->title</h1>"; $bodyContent .= "<p>There are currently {$container->numChildren} Queues defined:</p>"; $bodyContent .= "<ul>"; foreach($container->children() as $p) { if(! ($queue = $p->wireQueue())) continue; $bodyContent .= "<li>{$queue->getPage()->title}<ul>"; if(!$queue->ready2use()) { $bodyContent .= "<li>{$queue->className}</li>"; $bodyContent .= "<li>This Storagetype is not ready to use! The System seems not to provide all requirements.</li>"; $bodyContent .= "</ul></li>"; continue; } $bodyContent .= "<li>{$queue->className}</li>"; $bodyContent .= "<li>{$queue->getStateStr()} ({$queue->getState()})</li>"; $bodyContent .= "<li>Currently are {$queue->itemCount()} items pending!</li>"; $bodyContent .= "</ul></li>"; } $bodyContent .= "</ul>"; Following is a screenshot of the backend The module is available in the modules directory: http://modules.processwire.com/modules/wire-queue/ Or you get it from Github: https://github.com/horst-n/WireQueue. . . . The Sqlite3 storage handler not only let you push and pull data items to and from it, it also can keep track of the current state of a record. If you use multiple / different workers for pulling and processing the data, you can store an ID for them too. This is how the DB Table looks like: The Wire Queue Sqlite3 storage handler provides the methods addItem($arrayData) // same as WireQueueTextfile getItem($worker = null) // same as WireQueueTextfile, (but the textfile storage cannot support $worker!) updateItemState($id, $state, $worker = null) // this you can use for further processing, if you want . addItem($arrayData) $arrayData is a, maybe associative, array containing all your data for one record. The method stores it under the next free id under data in the Sqlite-DB-file and sets the state to 0. The field worker is empty for new added records. Following is a basic working example for pushing data records into a queue: // you have created a queue in PW, the ID of the page is 1420 for example // here is some skeleton code for an importer that uses this queue // get and validate the queue handle if(! ($queue = $pages->get('id=1420')->wireQueue())) exit(); // we could not get the Queuepage // now start to scan / read data for your imports, wrap each record into an array and put it into the queue foreach($pages->find(YOURSELECTOR) as $p) { $data = array($p->field1, $p->field2); $queue->addItem($data); } . . getItem($worker = null) $worker is an integer that you can define to suite your needs. If you don't use or don't want identify multiple workers, just ommit it. The method pulls one pending record from the queue, changes the state from 0 to 1, and returns an associative array with the keys id and data. array('id' => integer, 'data' => array) You will need the id if you further want to use the queue to keep track of processing steps. You must pull your stored $data from $array['data'] and use the id for further storing the state. . updateItemState($id, $state, $worker = null) $id identifys the record a worker has processed, for $state you can define and use every integer you like, but not 0 or 1. If you also want to store altered data, and not only different states, you can use updateItem($id, $state, $worker = null, $data = null) instead of updateItemState(). . Here is a working example with a bit pseudo code how workers can get a pending record to process it further and store back the result of the process: // you have created a queue in PW, the ID of the page is 1420 for example // here is some skeleton code for an importer that uses this queue // get and validate the queue handle if(! ($queue = $pages->get('id=1420')->wireQueue())) exit(); // we could not get the Queuepage // we do not use different workers here in that example, so we do not pass an worker id here $tmp = $queue->getItem(); // get a record from the queue $record_id = $tmp['id']; // store the record id $data = $tmp['data']; // get the data array // process the $data ... // and get the result of the process, in this example true or false $result = processMyRecord($data); // as new records have a state = 0, fetched records have a state = 1, // you may define a state of 2 for successful processed records, and higher ones for failed records $state = true === $result ? 2 : 3; $queue->updateItemState($record_id, $state); . . getItem4FurtherProcessing($state, $worker = null) The $state you pass to the method is the state you want get the record for. If there is one pending, its state will be set +1 and the id and data is passed back to you in an associative array: array('id' => integer, 'data' => array). --------- Here is a pseudo code example how (multiple) worker scripts may batch process queue records with the sqlite storage handler // on the server in this example, everyscript will timeout / die after 180 seconds // we start a timer $time = Debug::timer(); // we use different instances of workers that pull and process records from the queue, // so additionally to the processings states, we also want to store the worker ids $worker = 2000; // now start to process items by pulling one after the other from the queue while(150 > Debug::timer($time)) { $tmp = $queue->getItem($worker); // get a record from the queue if(!$tmp) continue; // maybe currently are no pending records available $record_id = $tmp['id']; // store the record id $data = $tmp['data']; // get the data array $result = processMyRecord($data); // process the data and get back the result $state = true === $result ? 2 : 3; // define an integer for the new state, according to the result of processing the data $queue->updateItemState($record_id, $state, $worker); } // we are close to the timeout for the script, so finish it with calling it itself to get a fresh run $session->redirect('./');6 points
-
4 points
-
Successfully tested ALIF with PW 3.0 and set the version to 1.0.0 stable now.4 points
-
Hey guys, here is a page we made back in 2013 for the SEO department car rental SIXT. Since then we updated the page every year with a new version. It is based on PW V. 2.4.0. This was one my first projects with Processwire. http://www.seo-wiesn.de/ Have fun!4 points
-
Hi tom. bad news are here: (files&images are not supported) https://processwire.com/talk/topic/9841-field-dependency-on-image-field/#entry94527 but the good news are there: (go a little indirection) https://processwire.com/talk/topic/9841-field-dependency-on-image-field/#entry94530 hope this helps regads mr-fan3 points
-
Welcome to the forums, 3Dots! It seems like you got everything right. In PW you almost always deal with the API which creates pages, not with the database directly. This is the best post ever about the form api: https://processwire.com/talk/topic/2089-create-simple-forms-using-api/... ...Ahh, no need to write any further - horst got it all! Edit: But I'll add a link worth exploring: http://store.di.net/collections/software/products/processwire-form-builder. It is an easy form creation module from ryan himself. With it you can create pages from form submissions in no time.3 points
-
Hi and welcome 3dots. You are on the right track, but not fully. Some hints may be: To build a form for the front end, you also can use the PW API: https://processwire.com/talk/topic/2089-create-simple-forms-using-api/ How to create a page is in the DOCs or in the forums many times, I believe: https://processwire.com/talk/topic/352-creating-pages-via-api/ Follow SOmas tut with the simple forms creation and do not forgett to use the validation and sanitizer. Have a look at the Docs and at the cheatsheet, too And have fun If you have any further questions after reading and testing, come back and ask.3 points
-
Successfully tested PIA with PW 3.0 and set the version to 1.0.0 stable now.3 points
-
3 points
-
2 points
-
https://processwire.com/blog/posts/front-end-editing-now-in-processwire-3.0-alpha-4/ "All of the front-end editing features are provided by a module included with the ProcessWire 3.0 core called PageFrontEdit. Once this module is installed, you can use any of the above options. The module is not installed by default." So it is not turning Drupal.2 points
-
Hi Marc, I ran into this issue with non super users, user template and pagetables a while ago as well. Other can't seem to reproduce. We got a work-around, but that's more of a hack than a serious solution.2 points
-
Just read the blog post - wonderful! I have said it before and it stands repeating - one of the great things about PW (and there are many) is that updates and new features make so much sense. This field template/page template pairs is sooo powerful. Of course we could already do all this with includes and such, but one great strength of this being built in to PW is future maintainability. Someone (either someone else or me) looking at a template of mine in a couple of years would need to figure out how all these template partials are organised. Now, there's a standard way and it's documented here.2 points
-
2 points
-
JqueryFileUpload This module is a ProcessWire implementation of the awesome Blueimp jQuery File Upload plugin. Server-side, the module provides a custom uploads' handler enabling you to perform various tasks with ease. The module is an interface of the feature-rich Ajax File Uploads widget provided by the jQuery File Upload plugin. The module is completely customisable and can be used both in the front- and backend (e.g. in a third-party module). Please read the README carefully and completely before using the module Release Status: Stable. Module Download: http://modules.processwire.com/modules/jquery-file-upload/ Issues tracker Project page: GitHub Security The module has been written with security in mind and makes no assumptions about any client-side validation. Instead, the module provides robust server-side validation of uploaded files. Server-side, no Ajax requests are honoured unless specifically set via configurable options server-side. This means that client-side requests to upload, delete and list files are not executed unless allowed server-side. By default, files are uploaded to a non-web-accessible (system) folder and files previously uploaded on the server are not sent back for display unless that setting is enabled. However, developers are still strongly advised to implement any other feasible measures to guard against malicious uploads, especially if allowing frontend uploading. For instance, developers can use native ProcessWire checks to limit access to the widget (e.g. only allowing uploads by registered/logged-in users). Demo A short video demo can be found here (and below )(CSS is WIP! ). In the backend, you can see it in action within the (upcoming) module Media Manager Features Fast Ajax uploads. Client and server-side validation. Client-side image resizing (highly configurable options). Beautiful touch-responsive image gallery preview. Audio and video previews pre-upload. Chunked and resumable file uploads (currently client-side only; server-side handling planned). Drag and drop support. Copy and paste support (Google Chrome only). Progress bars. Cross-domain uploads. Single or multiple uploads. Delete uploaded files. Documentation On GitHub. Have a look at the long list of available options. License Released under the MIT license @Credits: Sebastian Tschan @Thanks: Pete and BernhardB for the idea. Please test and provide feedback. Thanks!1 point
-
Where do i get? From here: https://github.com/IDT-media/Pages2JSON (thanks to LostKobrakai for "bug" report) What does this do? Simply adds method toJSON() to Page and PageArray elements, is capable to converting image and file arrays to URL containers, travels recursively all objects before outputs actual JSON. How to use? Simply install this module, configure data you want it to export in JSON result (similar to Ryan's ServicePages, thanks btw used some of ur code here). in templates or anywhere you need JSON output, call: $page->toJSON(); or $pages->toJSON(); Live example with template: search.php /***************************************************************** Do search *****************************************************************/ $term = $sanitizer->text($input->term); $results = array(); if($term) { $input->whitelist('term', $term); $term = $sanitizer->selectorValue($term); $limit = (int)$input->limit; $limit = $limit ? $limit : 50; $limit = $sanitizer->selectorValue($limit); $selector = "title|categories|content*=$term, limit=$limit, template=default|product"; // Prevent admin pages. if($user->isLoggedin()) $selector .= ", has_parent!=2"; // Find pages that match the selector $results = $pages->find($selector); } /***************************************************************** Output *****************************************************************/ header("Content-type: application/json"); echo $results->toJSON(); exit(); Customizing values: if(wire('config')->ajax) { wire()->addHookAfter('Pages2JSON::getValue', function($event) { $value = $event->arguments(0); if(!is_object($value)) return; $page = wire('page'); if($page->template == 'thumbs' && $value->className == 'Pageimage') $event->return = $value->size(28,28)->url; }); } Here i swap URL of all Pageimage objects in JSON response to match thumbs. Simple hu?1 point
-
Hi all, I thought I'd take this opportunity to announce a module I've been working on for a private project. Although it's not yet complete, I thought I'd take the time out to see if anyone would be interested in it. I only have the module locally on a test site, so if there is any interest, I can upload it somewhere suitable and maybe others can add to it, provide feedback etc. What is HermodBB? Hermod (messenger of the Norse gods) BB (Bulletin Board) is a module that installs a selection of templates and fields that you'd expect for a frontend forum. It also provides some methods to easily save topics and comments. All topics and comments (replies) are simply pages, and are organised like can be seen in the following image. Each forum has checkbox permissions for viewing, posting, pinning etc (see image below). These permissions can then be verified with some simple code (see below). // Use the helper method to pull a list of forum pages $forums = $hbb->forumsRender(); foreach ($forums as $forum) { // Only show the forums to those that are allowed to view them $rolesForumView = $forum->hbb_forum_view; if ($rolesForumView->has('id=' . $user->roles)) { // User has view access for the forum } } HermodBB also makes it easy to add comments to other pages, i.e articles, blogs etc. Comments are added as sub-pages, just like they are for topics. What HermodBB doesn't do HermodBB does not dictate any markup or sanitization. Any sanitization method can be used, and each topic and comment can easily be rendered as required. I'm currently using UIkit and CKEditor, but this can easily be changed to Bootstrap/Foundation etc. It keeps everything simple so that Processwire can do all the heavy lifting. Note: I am aware that there is the excellent comments module by Ryan, and also the Discussions module by Apeisa, but I needed something a little different for my current project, so I decided to have a bash myself. I am by no means on the same level of coding as the majority of members on here, so please be gentle I'd also like to thank Ryan personally for such an excellent framework. Any questions etc, please feel free to ask.1 point
-
This week we have another new ProcessWire 3.x version for you that includes several updates and optimizations. We’ve also greatly expanded upon the field rendering with template files, with lots of info covered in this post. https://processwire.com/blog/posts/processwire-3.0.7-expands-field-rendering-page-path-history-and-more/1 point
-
------------------------------------------------------------------------------ This is officially released now with some fixes and a second storage handler based on SQLite3. ------------------------------------------------------------------------------ WireQueue WireQueue is a module that allows easy creation and usage of Queues in ProcessWire. It is based upon a basic (parent) module that can or should have one or multiple StorageHandler modules. This alpha pre release contains a basic plain text storage module, WireQueueTextfile. The base module creates the needed: FIELDS (wire_queue_type, wire_queue_state, wire_queue_storage_options) TEMPLATES (wire-queue-container, wire-queue-storage, wire-queue-tools) PAGES (wire-queues = container for all Queuepages, wire-queue-storages = container for StoragetypePages) ROLE (wire-queue-admin) Each storage module creates one page under wire-queue-storages. New Queues can be created in the backend by adding a new page under "Wire Queues". After creation one have to select a Storage type from availables list and publish the page. After that, there are some buttons available to start / pause / and close the queue. Putting and getting data to and from the queue is done via API calls. First you have to get the page that holds the queue object. // get and validate the queue handle if($queue = $pages->get(SELECTOR_TO_DESIRED_PAGE)->WireQueue()) { // wrap your data into an array and pass it into the queue $success = $queue->addItem($data); ... } // get and validate the queue handle if($queue = $pages->get(SELECTOR_TO_DESIRED_PAGE)->WireQueue()) { $data = $queue->getItem(); ... } Thats basically all what you want from a queue. Following are a few conveniences: $queue->getPage()->title gives you the title of the queue, ($queue->getPage() returns the page object) $queue->className() shows the StorageType of the queue $queue->getState() and $queue->getStateStr() returns the current state of a queue: 1 = new / empty 2 = enabled / running 3 = paused 4 = closed / archived $queue->itemCount() gives the total number of all pending items in the queue Here is code that gives an overview of all Queues in the system: $container = $pages->get('template=wire-queue-container'); $bodyContent = "<h1>$container->title</h1>"; $bodyContent .= "<p>There are currently {$container->numChildren} Queues defined:</p>"; $bodyContent .= "<ul>"; foreach($container->children() as $p) { if(! ($queue = $p->wireQueue())) continue; $bodyContent .= "<li>{$queue->getPage()->title}<ul>"; if(!$queue->ready2use()) { $bodyContent .= "<li>{$queue->className}</li>"; $bodyContent .= "<li>This Storagetype is not ready to use! The System seems not to provide all requirements.</li>"; $bodyContent .= "</ul></li>"; continue; } $bodyContent .= "<li>{$queue->className}</li>"; $bodyContent .= "<li>{$queue->getStateStr()} ({$queue->getState()})</li>"; $bodyContent .= "<li>Currently are {$queue->itemCount()} items pending!</li>"; $bodyContent .= "</ul></li>"; } $bodyContent .= "</ul>"; Following are a screenshots of the backend The module is on Github: https://github.com/horst-n/WireQueue Would be nice if someone has time and can test it a bit and report back.1 point
-
Sadly, I wasn't able to do all the mock-ups this weekend as I was away. However I've managed to make a start on the edit page. @LostKobrakai - Thank you for your feedback, I let the sidebar in for this exact reason. I also have some ideas on how to fill out that space when only the Page link is available (due to permissions - editorial role). My idea is to have maybe the recently edited appear as like widgets in the sidebar - or something along those lines. I really need to think about it. This will be just be a theme I'll be building mostly to gain experience on the system but also to use in my personal projects. I will be releasing it for others to download. Anyway, here is the edit page (http://i.imgur.com/kp96yng.jpg):1 point
-
1 point
-
1 point
-
Same question here, Following the thread, I downloaded a lot of things and cast them off again. Now I have both Atom and phpstorm (30 day trial) on my machine. Coming from notepad+++ plus filezilla and dreaming to be more efficient, where do I go from here? Earlier tonight I was hoping someone would open a thread with a simple guide as to how to streamline the development of a site with PW on the one side and a php (say html5) template on the other. I'm coming from Joomla/Seblod situations with mainly Yootheme templates. Now I love PW because there's a clear line between content output and rendering but somehow I'm really searching to find an external -in between- tool to tie those two together when developing a site. For sure I'm only learning so .. is there something obvious I'm missing?1 point
-
What I need to switch to Atom for PW development is: Goto class/method definition: Function list in the sidebar. Did you manage to find plugins for those?1 point
-
I guess you are trying to build something like this. It is an example blog profile for PW built by ryan. Here is the source code for that page - a place to copy-and-paste from or get inspired with. If it does not help, feel free to write back. By the way, you don't need those extra fields just for sorting purpose as you will see in the code provided. One date field holds all the data needed to make that tree.1 point
-
This has got some small fixes and updates and is officially released now: https://processwire.com/talk/topic/12151-wire-queue-basic-implementation-of-simple-queues/1 point
-
OK, turns out the Front-End Page Editor module is injecting PW-backend specific stuff (all over the place) - in the HTML source too, not just when doing echo $page->body etc. For now (for 3.x tests) I'll use something like this, when I need JSON output: if($input->urlSegment1 === 'json') { header("Content-type: application/json"); $ar['title'] = $page->title; $ar['body'] = $page->body; $ar['summary'] = $page->summary; $ar['created'] = $page->created; $ar['modified'] = $page->modified; // new way how to render fields (optional) - with "baby" templates for each field $ar['matrix_test'] = $page->render('matrix_test'); $output = json_encode($ar); echo $output; exit(); }1 point
-
Thanks. Will appreciate your professional opinion especially regarding the client-side-image resizing1 point
-
It is an awesome video, so, also with music. Have had a nice looking. Thanks man! Will also try the module in the next time.1 point
-
Here's the vimeo version. Cannot get 1080p quality unless you are on the paid plans, but its viewable. I don't think am uploading to vimeo again...this was the first and last time. It takes forever and they restrict the quality, tsk.1 point
-
Subfield addressing is implement by the Page class itself, so you're out of luck if you pass in anything else. If your properties are all tied to $page, it should work. Though, in any case, getting $page->body already calls wirePopulateStringTags implicitly when it encounters a replacement tag, so your tags will already have been replaced/emptied when you pass it to your own call to wirePopulateStringTags. I'm not sure what problem you're trying to solve, but if it's about giving editors an easy means to include loosely related information in the HTML they enter, without needing to code themselves, it may be worth looking at the Hanna Code Textformatter, which lets you define your own tags and assign the PHP code that generates the replacement value.1 point
-
I'm on Linux so I prefer lightweight software. I don't use an IDE, I use Atom. I was using Sublime, but I'm preferring Atom at the moment.1 point
-
Just wanted to let you guys know that I have committed some changes over the last couple of days that brings complete live updating of child page details (name, template, hidden status, unpublished status, and removal of a row if deleted) in the edit mode table after making edits to a specific page in a modal popup. It might not seem like much, but it makes this mode much more functional and intuitive. Please let me know if you notice any problems.1 point
-
...ok just do it as with a regular Page $u = new User(); $u->template = "custom-user-template"; $u->parent = "custom-user-parent"; $u->save(); Sometimes you need to spoil your forum karma to get your head working as it should)1 point
-
Example for a use case with importing things. This is a raw draft with a bit pseudo code: // you have created a queue in PW, the ID of the page is 2000 for example // here is some skeleton code for an importer that uses this queue // get and validate the queue handle if(! ($queue = $pages->get('id=2000')->wireQueue())) exit(); // we could not get the Queue page // now start to scan / read data for your imports, wrap each record into an array and put it into the queue foreach($pages->find(YOURSELECTOR) as $p) { $data = array($p->field1, $p->field2); $queue->addItem($data); } // now start to process your items by pulling one after the other from the Queue while($timer < $maxtime) { $data = $queue->getItem(); // process the $data ... } $session->redirect('./');1 point
-
Hey, mr. horst! Looks like something I could make great usage of... But not sure that I understand the thing right. Could you please write a few words on what it is, what and how it is supposed to do. Maybe a use case... I understand It as a way to add multiple pages through the api without the risk of running out of execution time. Am I close?1 point
-
@GuruMeditation, Sure thing. At least I can listen to what you have in mind...1 point
-
I'd love a native solution too! Let me clarify: To me, the main issue is not the amount of installed fields . Like I said, we shouldn't let then number of fields be the overriding factor to guide our data storage needs. Rather, it is the questions I raised earlier. Fields are actually just Fieldtypes themselves . The idea behind using custom Fieldtypes was not necessarily about avoiding using pages. Fieldtypes are (usually [always?]) attached to pages . One of the ideas with custom Fieldtypes is to help better organise data, avoid duplication and redundancies. There are other advantages as well. Custom Fieldtypes can also be used in conjunction with core Fieldtypes, e.g. we could reuse the title Field, if you are using pages, say, for threads. Another example, consider the FieldtypeEvent that was linked to above. It stores three pieces of custom information on each row - notes; location and date all in one table. If we were to duplicate that using 'normal' fields, we would need at least three fields for each piece of information, a date field, and maybe two text fields. Those are three tables. Yes, that will also work, but at some scale, it is more efficient to query only one table than query several tables. Maybe even some custom Fieldtype could act as an 'external db table', but I don't know how feasible it is to have a Fieldtype that doesn't interact with a page. Anyway, I've gone overboard .... Looking forward to see the forum! Maybe then we'll have a clearer picture of what could be tweaked RE data storage, presentation, etc.1 point
-
Looking at your fields again, I see you are storing some simple stuff as comment ID in their own field (i.e. db table). I seriously think you should consider creating some custom Fieldtypes to store some data. For instance, the forums views could all be in one Fieldtype and the different view properties would all be stored in it as sub-fields, i.e. the database schema of a FieldtypeForumViews could look something like this: forum_id forum_cat_view forum_desc etc 1 xxx This is a cool forum 2 xxx This is members only forum Sorry if this seems to be taking you back. My thinking is that you'd rather get it right (or better) at the beginning than later. I don't know how comfortable you are with code and if you will be able to develop custom Fieldtypes and Inputfields that will come as part of the forum. However, Fieldtypes are very powerful, modular, will still allow you to use the PW API, are very scalable and will allow storing of lots of stuff that would otherwise probably end up as a page (nothing wrong with pages but sometimes a custom Fieldtype is better than using a field that ships with the core). TBH, if I was to do my Blog module all over again, this is the approach I would most likely follow. I for one would be willing to help you although my time is very limited. Sorry if I am raining on your parade, but thought this was an important matter to consider.1 point
-
I am not sure this is how I would consider it. Btw, a lot of fields is relative. There's a site here in the forums that had 800+ fields! Whilst I thought (then) that that was a lot of fields, some people looked at me like duh! Since then my perception has changed and is guided differently. So, rather than asking these from a cosmetic point of view (visual bloat?), I think we should be asking the following questions? What are the forums data needs? How best can we store that data to facilitate efficiency? (i.e. easy, fast and optimized queries) What format should we best store a data format in? Varchar, int, etc? If storing strings, are we better of storing some stuff as JSON? Should we store some stuff in one page or as different pages? Should we store some data in its own table or store it as part of a column (sub-field) in a row? How will the forum scale vis-a-vis our data model? EDIT: See next post - Are all/some of our data needs best served by developing custom Fieldtypes and Inputfields? We then base our data model around such questions. If that results in 20, 50 tables, so be it. Give me a scalable data model any time than a short list of fields in the backend, something that I won't be spending my time interacting with often Just my 2p1 point
-
Looks really great I would love to see the possibility to subscribe to a topic and get notified by email when an answer is posted1 point
-
Just to update those following this thread on the status of the module. I am still working on it, and I'm currently tidying things up I'll provide a few template examples when I release the module so that you can easily have a forum up and running within a limited time. My main priorities at present are the following: 1. A clean installation 2. A clean uninstallation 3. To plant the acorn, and for PW to grow the tree. I personally like to know what a module installs, so I'll provide that information at a later date for those that don't want to dig through the code. It's going to be as minimalist as possible, but it's also going to do everything a forum should do, and that's all thanks to PW and the excellent API. Below are some extra shots of my test installation. You can see the root of the forum, and then the forum view. I have added forum categories since the last time, so forums can now be grouped, i.e Member forums, guest forums etc. Those forum groups also have view permissions, so with some API magic, all the forums within that forum group can easily be hidden for specific roles without having to hide them individually. Again there is no markup provided for this module, so it's up to you how it renders. I am currently using UIKit for testing purposes. Anyway, here's the shots..... (red writing is not part of the screenshot) ------------------- Main (root forum view) ------------------- New User Forum (from the New Users forum group) ------------------- Questions, ideas etc still always welcome. And yes I will release the code shortly when I have ticked off all my to-do boxes. As you can see from the last screenshot, the forum topics are ordered by their last reply. I've made this easy to do via an extra date field, so they'll be no need to worry about comments or topic order for that. Again you can pull the comments, topics etc however you wish. I have made it paramount that I don't include any restrictions. All my recent test helper methods have now been removed from the module.1 point
-
1 point
-
Martijn created an issue and we have tracked it down towards to the editable() function. We might be off, but when we disable this check the PageTable works as suspected.1 point
-
Hey, love the plugin but this would really benefit from using the Selector inputfield as a selector instead of the textarea.1 point
-
What I do is use $config->js to populate the config array that I then output in the head for dynamic variables that want to share in a script. $config->js("myconfig", array("myajaxurl" => $pages->get(1991)->url); You can do this in templates or modules doesn't matter as long as it's before rendering page. Then this little to output as json. This is the same as PW uses in the admin to share config vars with js. <script type="text/javascript"> <?php // output javascript config json string to html // for use in javascripts from this point on $jsConfig = $config->js(); $jsConfig['debug'] = $config->debug; $jsConfig['urls'] = array( 'current_url' => $page->url, 'root' => $config->urls->root, ); ?> var config = <?php echo json_encode($jsConfig); ?>; </script> Then use in your script as var rootUrl = config.urls.root; for example1 point
-
Ipa, catch the Exception and print out the message, for example: try { // Login } catch (WireException $e) { // Print out message of exception echo $e->getMessage(); }1 point