Leaderboard
Popular Content
Showing content with the highest reputation on 02/24/2018 in all areas
-
I have launched my martial arts website at https://merpatiputih.com.au/ As a martial arts instructor, my problem was how to track student attendance, payment, course modules, and exercise /health progress report etc. and from my part, I need to publish the class event, schedules, location, and exercise modules for that event. For public viewers, I just simply use blog profile module and UIkit. It's very easy and quick to set-up. The purpose of this site is for a logged-in member where from their mobile they can check-in to the available class a day before, and update their health record after the class. For user front-end, I'm using <region> and delay output. I found this method is really efficient to manage the HTML output, clean and simple. Less headache with templates structure. Below are the functions and modules of this web apps: For Course sessions I'm using page reference, Profields Repeater Matrix and Schedule Pages Module. Profields Table to generate the student records and reports. Calendar for recurring class sessions through the year based on student ranks, selected by user Roles. I only need a simple calendar function (a quick search from the Internet) that able to receive a month and year input. Then, by using region, events field, Profields Repeater Matrix and URL segment it was reduced my time to code complicated function for the event schedule. The only thing here that I have to manage in date calculation is the time format, in Australia we use d-m-y. The tricky thing to get Next month (month + 1), I have to modify it to the first week to get a proper next month. To avoid inquiry about forgot password or username, student logs in via Facebook Login module. Here is the screenshot of student report:12 points
-
Checkbox Reversed Modifies InputfieldCheckbox so that it shows the reverse of its true value. The checkbox will be unchecked when the field value is 1 and checked when the field value is not 1. Background The core FieldtypeCheckbox does not have a setting that allows a checkbox to be checked by default. One reason for this is that only a checked field saves a value to the database. An unchecked field does not save "0" to the database, but rather does not save any value for the field at all. Therefore there is no way to distinguish between a new field that has not yet been saved (and therefore could potentially get a default checked state) and a field that has deliberately been saved as unchecked. Because of this you sometimes have to use a checkbox in the opposite way than you would like. Suppose your client has requested a checkbox labelled "Bootylicious" that will be checked by default. This isn't possible with FieldtypeCheckbox so instead you have to convince them that a checkbox labelled "Not bootylicious" that is unchecked by default is just as good. This alternative will achieve the same thing, but it's not ideal. A solution This module doesn't change the limitations of the core checkbox field, but it provides a workaround that allows you to show the checkbox with the desired default state and label. So in the example above you would still name the field "not_bootylicious" (otherwise it could get confusing in your template files) but you can label the field "Bootylicious" and the checkbox will appear checked when its true value is actually unchecked, and vice versa. This allows new pages to show the checkbox checked by default. Clear as mud? Usage Install the Checkbox Reversed module. For any Checkbox field where you want the inputfield to show the reverse of its true value, activate the "Reverse the checked state of this inputfield?" option in the field settings. https://github.com/Toutouwai/CheckboxReversed http://modules.processwire.com/modules/checkbox-reversed/8 points
-
I was expecting some juicy gossip about Brad Pitt & Jennifer Aniston under those headlines .... 320 stars6 points
-
Just a short update this week and we work on the finishing touches for the next master release version of the ProcessWire core: https://processwire.com/blog/posts/processwire-3.0.93-core-updates/4 points
-
3 points
-
3 points
-
Did also my small contribution. Thanks @adrian for rightly reminding us to show our appreciation for Processwire where possible. Processwire really should be recognized much more in the world. Maybe it'd be a good idea to place a github link directly on the starting page additionally to the one on the download page...?3 points
-
Done, 318 Having almost finished my first ProcessWire project I can honestly say its been a pleasure. A site / service built out of the PW admin, custom modules etc (theres no frontend at all) to help manage a manufacturing setup. Has been a great fit and shows how flexible PW is. Even with learning about PW and not being the strongest PHP coder out there I've manage to get things done in a fraction of the time. Heres to PW, glass raised3 points
-
Was just wondering why people suddenly started starring my module repositories. Cheers, @adrian3 points
-
Here is a trial that works for asmSelect, but in an ugly way as autoload modules load Javascript before the asm inputfield. Hope this could help. Select2.module class Select2 extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Select2', 'version' => 0, 'autoload' => true, ); } public function init(){ $data = $this->data; $this->config->scripts->add('https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js'); $this->config->scripts->add($this->config->urls->Select2 . 'main.js'); $this->config->styles->add('https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css'); } } main.js $(function(){ var loop = setInterval(function(){ var $select = $(".asmSelect"); if($select.length > 0){ $(".asmSelect").select2({ closeOnSelect: false }); clearInterval(loop); } }, 200); }); PS: Using selectize.js is not working with the above code.2 points
-
This is brilliant! Definitely deserves its own thread in the modules sub-forum. I only tested it briefly so far but I'm amazed at how fast it is - I thought the decryption would cause a noticeable delay.2 points
-
You can set more advanced labels in a Page Reference field by using a hook. Not sure if there's a better way but here's how I do it. In your Page Reference field settings, choose "Custom format" for the "Label field" setting, and in the "Custom page label format" enter anything you want so long as it is unique to that field, e.g. pwrocks Then in /site/ready.php $wire->addHookAfter('Page::getMarkup', function(HookEvent $event) { $page = $event->object; // Each page that appears in the Page Reference field $key = $event->arguments(0); if($key !== 'pwrocks') return; // the label format specified for the Page Reference field // Now build whatever string you want to show using $page, $page->getForPage(), etc $string = 'Your string here'; $event->return = $string; });2 points
-
I rushed over the the PW repo, all geared up to star... oh, I already did that. Wish I could star it twice.2 points
-
Here's a short (or not so) proof-of-concept implementation that adds symmetric encryption to FieldtypeText and derived types. Supports multi language fields and uses either AES256 from phpseclib or sodium's sodium_crypto_secretbox if available on PHP >= 7.2. Key creation is done in the module's configuration settings. There's also a hookable loadKey method to retrieve the key from somewhere else (needs to return the base64 encoded key).2 points
-
Hi everyone, I know we'd all like to see ProcessWire grow in popularity (maybe not hugely, but just enough that more people know about it which can help to convince clients to go with it). It strikes me as strange that the ProcessWire Github repo still has less than 300 stars - I'd like to see us well over a thousand which should be an easy task for the forum members to achieve. I see so many other projects with lots of stars but for some reason it doesn't seem like it is something we tend to do around here, despite being a very active, friendly, and supportive environment. I also think that starring your favorite modules doesn't hurt either - I think that will also help to increase the visibility from PW and also help out module authors a little as well. If you can show your Github project has a decent number of stars it shows that you are building things that people want which can help you land a job and helps you to convince the client that you and ProcessWire are a good mix. Anyway, if you have a minute to do some starring of PW and your favorite modules, hopefully it will benefit us all a little. Thanks!1 point
-
Video or Social Post Embed Based on the TextformatterVideoEmbed module developed by Ryan Cramer, we have added the possibility to embed publications of the main social networks Facebook, Twitter and Instagram. ProcessWire Textformatter module that enables translation of YouTube, Vimeo, Instagram, Facebook, Twitter or Issuu URLs to full embed codes, resulting in a viewable video or social post in textarea fields you apply it to. How to install Download or Clone from Github: https://github.com/lexsanchez/VideoOrSocialPostEmbed Copy the VideoOrSocialPostEmbed.module file to your /site/modules/ directory (or place it in /site/modules/VideoOrSocialPostEmbed/). Click check for new modules in ProcessWire Admin Modules screen. Click install for the module labeled: "Video or Social Post Embed". Now you will be on the module config screen. Please make note of the config options and set as you see fit. How to use Edit your body field in Setup > Fields (or whatever field(s) you will be placing videos in). On the details tab, find the Text Formatters field and select "Video or Social Post Embed". Save. Edit a page using the field you edited and paste in YouTube, Vimeo, Facebook, Twitter, Instagram and/or Issuu URLs each on their own paragraph. Example How it might look in your editor (like TinyMCE): How it works This module uses YouTube, Vimeo, Instagram, Facebook, Twitter and Issuu oEmbed services to generate the embed codes populated in your content. After these services are queried the first time, the embed code is cached so that it doesn't need to be pulled again. Configuration You may want to update the max width and max height settings on the module's configuration screen. You should make these consistent with what is supported by your site design. If you change these max width / max height settings you may also want to check the box to clear cache, so that YouTube/Vimeo/Facebook/Twitter/Instagram/Issuu oembed services will generate new embed codes for you. Using with Markdown, Textile or other LML This text formatter is looking for a YouTube, Vimeo, Instagram, Facebook, Twitter or Issuu video URL surrounded by paragraph tags. As a result, if you are using Markdown or Textile (or something else like it) you want that text formatter to run before this one. That ensures that the expected paragraph tags will be present when VideoOrSocialPostEmbed runs. You can control the order that text formatters are run in by drag/drop sorting in the field editor. Copyright 2018 by Ryan Cramer / Updated by Lex Sanchez1 point
-
Not a question, but just something I discovered that I wanted to share on the forum since I haven't seen it discussed anywhere. If you are familiar with the "autojoin" option on individual ProcessWire fields, enabling this feature means that every time a page with that field on it is loaded into memory, the field will be included with it immediately. (Normally just the page's name and meta data is included, and getting a specific field from the page requires a separate trip to the database. This is to conserve memory) Normally this is fine and it keeps things simple, but occasionally you may be loading a lot of data in a consistent fashion (for, example, to populate a table) and know exactly which fields you need. With the autojoin option on fields, you would have to enable autojoin for all pages at all times, which you probably don't want. With the following code, you can do a $pages->find() and specify exactly which fields you want to autojoin with it: $pages->find("template=whatever", ['loadOptions' => ['joinFields' => ['filed1','field2','field3']]] ); I tested out in debug mode on one of my projects, and it seemed to significantly reduce the number of SQL queries required for an html data table I was building. Hope that helps someone!1 point
-
I recently started to build Vue SPAs with ProcessWire as the backend, connected with a REST API. Thanks to code and the help of @LostKobrakai (How to use FastRoute with ProcessWire) and @clsource (REST-Helper) I got it up and running pretty quickly and now have put all of it in a site profile for others to use. It includes the REST API with routing for different endpoints, JWT Auth and a simple Vue SPA which shows the process of logging in a user (nevertheless, you don't have to use the Vue part, the API will work on it's own). Check it out here: https://github.com/thomasaull/RestApiProfile I'm pretty sure, it's not the perfect or most sophisticsted solution, but it gets the job done for me… Feedback or Improvements are very welcome Update: This site profile is a module now: https://github.com/thomasaull/RestApi1 point
-
It stays encrypted. Same when you set an encrypted field back to unencrypted. I'm still pondering how to tackle that properly (if at all), since decrypting every occurrence of a field in one go is likely to run into timeouts when the count gets high.1 point
-
1 point
-
Hello guys. Even though I had quite a few projects released now under ProcessWire and never had the issue aforementioned, it seems like the learning curve never ends. I ran into the same issue as described above and was having a hard time figuring it out so I can confirm that having enabled the CKEditor for textarea field is requiring to have the textformatters removed in order to avoid seeing the HTML tags converted to text. Admirations to you again @szabesz !1 point
-
Not sure I understand exactly what you're asking, but InputfieldSelect (and other related inputfields such as AsmSelect) has the addOption() method. So if you wanted your selectable options to be derived from all the pages using the basic-page template you could do this: $basic_pages = $this->pages->find("template=basic-page"); foreach($basic_pages as $basic_page) { // Page ID is value, page title is label $field->addOption($basic_page->id, $basic_page->title); }1 point
-
On the topic of searchability of encrypted fields, as long as the number of encrypted pages you want to search across is not too huge you can load the pages to a PageArray and then search the PageArray. Using the auto-join tip mentioned recently here by @thetuningspoon... $decrypted = $pages->find("template=some_template", ['loadOptions' => ['joinFields' => ['encrypted_field_name']]]); $items = $decrypted->find("encrypted_field_name%=foo");1 point
-
Thank you so much, Bernhard, for the very useful help. That is exactly what is needed.1 point
-
Further to this, it turns out that http://modules.processwire.com/modules/indexer/ can (and does) index PDFs, and although it was created in 2013 and only claims compatibility up to PW 2.4, it still works. (tested on PW 3.0.84) <edit class='bit-more-info'> Not only does it still work, but it works brilliantly. No errors, no warnings, and this is with PHP 7.1! All on default settings, just check 'Use built-in PHP class?'. </edit>1 point
-
Done. Star #303. Also from now on, I pledge to star whatever module I download.1 point
-
If these models/artists need to be able to edit their information then they must be created as PW users so they can log in. You can use an "Approved" checkbox field in the user template, or alternatively create an "Approved" role that may be added to the user, to determine which users are approved. The Login Register module could help with this project. See the blog post that introduced it. You'll probably want to customise Login Register (with hooks or whatever) for things like: 1. Show different fields in the register form depending on if Model or Artist is selected. 2. Maybe apply different role to new user depending on if Model or Artist is selected. 3. Show different fields in profile edit form depending on if Model or Artist is selected. If you get stuck on any of these things I'm sure you'll find help here in the forums. I haven't used Login Register myself. If information from the user profile is shown publicly on the front-end you could explore the possibility of using a different parent for users. Or you could use a single page for all profiles, pulling in the data for the relevant user via a Url Segment. I'd probably go for the latter myself. If all the users are stored under the Admin > Access > Users (as they are by default) then your client will be approving/activating Models and Artists via the Users lister. You can add a filter to the lister to make it easy to find unapproved users. Or maybe use Lister Pro to create a custom users lister showing unapproved users.1 point
-
Disclaimer: Complete noob in security here. So, at the risk of sounding silly, would it make sense to keep the key in a different server? I mean, if the site's server is compromised, the key would be visible in the code. So, I'm thinking the key could be stored in a different server that's "completely airtight", and the only thing it does is listen to a key request from the main site's server, checks the IP and lends it the key. So any site scripts that needed to handle an encrypted field would have to make that request first. Does this make sense? Or would a breach where someone can access the DB + PHP files be so far gone that they'd also easily make the server request and expose the key?1 point
-
Code Blocks Textformatter is a tiny Textformatter module I cooked up to add support for code blocks to text/textarea/RTE fields on some of the sites I work with. Unlike a full-blown Markdown Textformatter – which is something that we already have in the core – this module simply adds support for fenced and inline code blocks. The syntax is based on the GitHub code block documentation, so please refer to that for additional instructions. The README at GitHub also includes some basic examples. As with any Textformatter, in order to enable this one, install it and enable it via field settings. Note that there's no syntax highlighting built in (at least for the time being), so use a tool of your choice for that – personally I prefer Prism.js. Since this module doesn't use a Markdown tool behind the scenes, but rather some home baked regular expressions, there's always the possibility that I've missed something – but please let me know if you use this module and run into any issues. On the other hand this module should be relatively fast and unobtrusive, as there are no unnecessary bits of code to run GitHub repository: https://github.com/teppokoivula/TextformatterCodeBlocks Modules directory: http://modules.processwire.com/modules/textformatter-code-blocks/1 point
-
If you have any of the "Markup/HTML..." Content Types selected, then this is the normal behavior. Tags are converted to HTML Entities, so the <p> tags generated by CKeditor are also converted and show up as text. You need to remove the Text Formatter in this case.1 point