Leaderboard
Popular Content
Showing content with the highest reputation on 02/23/2018 in all areas
-
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 Sanchez13 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!12 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/7 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).5 points
-
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>5 points
-
Usually I write modules just for me and my projects because they are more or less individual. Mail Debugger is the first module which might be interested for someone else as well. https://modules.processwire.com/modules/mail-debugger/ Basically it covers two use cases: 1) Log outgoing emails 2) In debug mode mails are send to a specified email address instead of the original recipient(s) I checked the compatibility for PW 3+ because unfortunately I don't have any other version for testing currently. Feel free to drop me a comment if the module works also for older PW versions.4 points
-
Done. Star #303. Also from now on, I pledge to star whatever module I download.4 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
-
3 points
-
3 points
-
3 points
-
Hi Sean: This is a basic example of how to create a module that has configurable fields. <?php class Example extends Process implements Module, ConfigurableModule { private static $pathDir; /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( // The module's title, typically a little more descriptive than the class name 'title' => 'Example Module', // version number 'version' => '0.0.1', // summary is brief description of what this module is 'summary' => 'This module descripton.', // author 'author' => 'Author Name', // singular=true: indicates that only one instance of the module is allowed. // This is usually what you want for modules that attach hooks. 'singular' => true, // autoload=true: indicates the module should be started with ProcessWire. // This is necessary for any modules that attach runtime hooks, otherwise those // hooks won't get attached unless some other code calls the module on it's own. // Note that autoload modules are almost always also 'singular' (seen above). 'autoload' => true, // If true, the module may not be uninstalled once installed. 'permanent' => false, 'page' => array( // optionally install/uninstall a page for this process automatically 'name' => 'example-module', // name of page to create 'parent' => '', // parent name (under admin) or omit or blank to assume admin root 'title' => 'Example Module', // title of page, or omit to use the title already specified above ), 'permission' => 'example-module', 'requires' => array('PHP>=5.4.1', 'ProcessWire>=2.7.0'), 'icon' => 'film', // module icon ); } public static function getModuleConfigInputfields(array $data) { // ------------------------------------------------------------------------ // Initialize InputField wrapper // ------------------------------------------------------------------------ $fields = new InputfieldWrapper(); // ------------------------------------------------------------------------ // Define text input field for the directory path. // ------------------------------------------------------------------------ $field = wire('modules')->get('InputfieldText'); $field->name = 'pathDirectory'; $field->label = __('Directory Videos'); $field->required = true; $field->columnWidth = 50; $field->value = (!empty($data['pathDirectory']) ? rtrim($data['pathDirectory'],"/")."/" : '/var/www/html/videos/'); $field->description = __('Description Field.'); $fields->add($field); // ------------------------------------------------------------------------ // Return of the fields. // ------------------------------------------------------------------------ return $fields; } public function ___install() { parent::___install(); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { // Variable from module settings self::$pathDir = $this->pathDirectory; } /** * Executed when root url for module is accessed * */ public function ___execute() { $preview = $this->modules->get("InputfieldMarkup"); $preview->value .= "<h2>echo " . $this->pathDirectory . "</h2>"; return $preview->render(); } }3 points
-
Not sure about anything beside what @kongondo linked, but PW does definitely cache things, both field values and pages. Pages are kept in memory as any calls to Pages::get and Pages::find are routed through PagesLoaderCache. Equally, field values are retrieved only once, as Page::getFieldValue (which is in turn invoked by other get... methods like getUnformatted) only calls Fieldtype::loadPageField if the raw field value isn't yet populated (and $page->fieldname and $page->get('fieldname') both delegate their work to getFieldValue).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...?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
-
Was just wondering why people suddenly started starring my module repositories. Cheers, @adrian2 points
-
2 points
-
2 points
-
Your wish is my command I have just extended the Mail Interceptor panel to support an optional "Test Email Address". If it's left empty, it works as before, just capturing all the email output in the panel. If you enter a test email, it will still capture the mails, but also send to that test address. I think this is a nice combo.2 points
-
2 points
-
2 points
-
done...in fact i put the star on many modules...but not on the main repo...2 points
-
You mean the "Add field" asmSelect? That's already a "pimped" html select box, but I just thought today morning that it would be nice if it had a search. I'm not sure applying another js won't cause issues but I'll see if I have time. I'm usually using this library for such things btw: https://github.com/jshjohnson/Choices2 points
-
I saw this follow-up question coming, ? I think that's also doable, will check that later. I reckon the same question is about to emerge for the rest of the PageField types, isn't it? ?2 points
-
No, DatetimeAdvanced just lets you search datetime fields using subfield syntax like "datefield.year=2018" in selectors, directly output those too, e.g. $page->datefield->year, and provides strftime() and date() formatting functions on fields. Input and stored values stay the same.2 points
-
2 points
-
2 points
-
I was also just looking for this. I'm using a checkbox where I want it checked for "make all images standard width" which is the default. Changing the text to "make all images non-standard width" would of course be the easy solution, but doesn't make sense to me - the default is they're standard-width, therefore that's the default state, so ON in my mind. Ticking a box to turn it OFF doesn't feel right even if I can wrangle the wording to make it make a little more sense. @ryan please can this be revisited as per the reasons posted since your last reply? Sometimes the wording can just make more sense to the customer using the system, which is who we're building the sites for at the end of the day2 points
-
2 points
-
I am currently developing a little application which is supposed to run on a raspberry. I decided to take advantage of PW's capabilities to deal with data not only in the sense of a common website but more as an application. I wrote a lot of modules for this and I wrote tests for some of the methods (using PHPUnit). This works fine so far for methods which are independent from database (e.g. calculating an upcoming date/time by a given schedule). Now I am thinking of extending this by writing tests also for methods which rely on data from the database (e.g. it need to be checked if something exists on that given date/time). This information is currently stored as page in PW. One of my thoughts: create necessary pages in PW for running the test and delete them afterwards. But somehow this just feels wrong. Any kind of input how you would tackle this would be great! Thanks a lot!1 point
-
You can sort them in a saveReady hook. In /site/ready.php: $pages->addHookAfter('saveReady', function(HookEvent $event) { $page = $event->arguments(0); // If the page has the relevant template... if($page->template == 'exhibition') { // Sort the Page Reference field by title $page->works_id->sort('title') ; } }); This of course prevents you from applying a manual sort to the field, and does affect the sort order of the field value when you get it in your template. But it sounds like you are specifying a different sort (chronological) there anyway so that won't be an issue.1 point
-
Would be cool to add support where possible. Not sure how you've handled the AsmSelect limit in the as-yet-unreleased AOS update, but maybe part of the JS could be broken off into a piece that is generic to all Page Reference inputfields. It would identify the underlying form element that contains the actual field value, and on change it would check if the limit is reached. If so it would add a class to inputfield container, and trigger some event for the container, e.g. 'limitReached'. If you go that way others can contribute pull requests for the remaining Page Reference inputfield types without reinventing the wheel for the limit check. I'd be happy to contribute here.1 point
-
thanks for your feedback. I added the link in the post above. Don't know what went wrong during the submission process... maybe just a newbie error Thanks @adrianfor fixing it!1 point
-
yep. I'm not even sure what that code is: PHP, JS? Cron jobs won't do anything with JS+CSS... or HTML, for that matter.1 point
-
I guess you might find my tutorial and blog post useful: https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/#handling-user-input-using-forms-amp-inputfields1 point
-
1 point
-
I have a use case, I wouldn't say it's necessarily "good" A client asked me to link one item in a list of siblings to another site. They didn't want to scrap the content, they wanted the title and intro to remain on the listing page, they just wanted to redirect instead of going through to the detail page. That meant I couldn't just put a redirect in the template, instead I added them a new field. An easy fix of course, I just couldn't figure out at first why jumplinks wasn't working for my purpose til I saw a post further up this page. Now, as I've just seen your roadmap, I will happily rescind my request anyway as I see you've got a long list of plans already!1 point
-
Hi @tpr, I would like to have a little feature request here. I guess most of us feel pain when choosing fields and templates in dropdown select if the list grows large. I think we could implement a search function to make us more efficient. I think AOS is the best place to implement this. After some brief search, select2.js could be a good candidate. It hides the original select tag instead of using some div with hidden input field, so it , most likely, does not affect the inputfield like asm select. With option closeOnSelect: false could prevent the open and close behavior every time when we choose an item from asm. Also, it looks easy to implement. I hope you could consider adding this. https://select2.org/getting-started/basic-usage1 point
-
It would - I did think about that but it takes a whole extra minute to set up1 point
-
1 point
-
@BitPoet re: DatetimeAdvanced module What exactly does it do? Is it some sort of datepicker input type that allows to select date-ranges? (which is not currently possible in core, afaik).1 point
-
A general coding question I've wondered about for a while but never got around to asking until now. Suppose I'm writing some code in a template file, and I get some value from the database... echo $page->parent->title; Now later on in my template I want to use this value again, so my template file is now... echo $page->parent->title; // More code here... echo $page->parent->title; Is PW going to go back to the database to get this value? Or is it automatically kept in memory so that only the first usage results in a trip to the database? In most circumstances where I do this I would tend to put the value in a variable and then reuse the variable... $parent_title = $page->parent->title; echo $parent_title; // More code here... echo $parent_title; ...but if I didn't and instead did it like the previous example, would there be any performance penalty? Is there any documentation or forum post that talks about how PW handles this sort of thing?1 point
-
Just in case you haven't crossed it, is a more recent version of the multisite module by @kixe https://github.com/kixe/Multisite1 point
-
jep, i guess you already read it, but just to be sure: https://processwire.com/docs/security/file-permissions/1 point
-
Hello, Do you at least see the changes in the backend/admin ("message that data is saved")? If you see the modifications in the backend, could it be a cache issue (browser, server, processwire...), and because of that you don't see the changes on the frontend of the website? Can you give more details (hosting...)? What are the technical differences between your local and live environments?1 point
-
Old topic below but might provide some insights1 point
-
Maybe you can use multi-instance functionality for permanent storing of test data in separate DB? https://processwire.com/blog/posts/multi-instance-pw3/1 point
-
This is been resolved by the tech team that look after the servers. The issue was one of incorrect file permissions on assets/files.1 point
-
If I understand right, you use: <a href="<?php echo $config->urls->root; ?>"> but you should use: <a href="<?php echo $pages->get('/')->url; ?>">1 point
-
Is $pages->get('/')->url not returning the correct url?1 point