Leaderboard
Popular Content
Showing content with the highest reputation on 03/21/2020 in all areas
-
@Robin S The purpose I was focused on for the method is to see if the system has any page that matches the given criteria. An example of the use case appears in the Template class updates here. It verbally makes sense in code for what it's intended for. Usually I'd use a get or count for that, I didn't need any of the extras that $pages->get() or $pages->count() provide, so thought we could eliminate some overhead. Plus I can think several other other cases where the same was true, so the need has resurfaced enough times that it seemed like good method for PW to have. The method returns the ID just because it already has that info either way, and it seemed potentially more useful (and 0|1+ communicate the same thing as false|true). I had also seen where you'd mentioned a getID recently, and since this method already has the page ID, I thought this also seemed like a good opportunity to accommodate that need too. So far I haven't come across a good use case for getID() in my own projects, outside of checking for existence of something (which 'has' seems like a better term for). But it certainly makes sense alongside the existing findIDs() method, though that method is more about accommodating a scale that find() can't. But it sounds like you've had use cases for it which means others likely have too, and that's plenty good reason for me. I'll go ahead and add getID() it as an alias of has(). Depending on what need you are looking to solve, I imagine this will help people to find what they are looking for more easily.6 points
-
At Blue Tomato we use Logstash/Kibana to monitore nearly every application. Now we use it also for our ProcessWire Logs. For this reason we created this module to send the logs to the Logstash HTTP-Input Plugin: https://github.com/blue-tomato/ProcessLogstash3 points
-
I think @LAPS wants some place that does NOT load on every request. But all of your mentioned options do load on every request ? How large is that list of E-Mails? ? If that is really too much for every request you can put it In some file that you only include() when you need it In a non-autoload module, that you request when needed (eg $modules->get('myemails')->getAll()) In a WireCache object that is stored in the Database In a dedicated page + field (eg $pages->get(1234)->emailslist)3 points
-
@ryan, great timing on the $pages->has() method - I requested essentially this just the other day: https://github.com/processwire/processwire-requests/issues/358 But the method name has() seems not so intuitive - if you didn't know better you would think this returns a true/false value. I think $pages->getID() would be more intuitive - maybe that could be added as an alias?3 points
-
Thanks! I use findIDs() when I'm using the PW API in conjunction with SQL queries where I only need the page IDs in the query. Sometimes I only need a single page ID and so having a getID() makes that simpler and corresponds to the find() and get() methods.2 points
-
I'm not sure if I understand your message correctly... Was that a "Thank you for sharing! We have been using it for years and it works great. If someone doesn't know it yet, give it a try!" ?2 points
-
@jonatan - looks like you used http://modules.processwire.com/modules/fieldtype-runtime-markup/ rather than https://github.com/Toutouwai/FieldtypeRuntimeOnly but they both do much the same thing. Anyway, glad you got it working and thanks for chiming on that Github request - that visibility stuff definitely needs an overall.2 points
-
v0.3.0 released. Adds support for PageListSelect and PageListSelectMultiple inputfield types. Also adds support for PageAutocomplete inputfield type but only when used via a HannaCodeDialog::buildForm hook. From the module readme: @maddmac, I think you must be referring to PageListSelect which is used in InputfieldSelectorSelectID rather than that module as a whole. In v0.3.0 you can now use PageListSelect with HannaCodeDialog, either by setting a "attributename__type=pagelistselect" attribute in the tag settings or by using a HannaCodeDialog::buildForm hook.2 points
-
This latest version of the core on the dev branch focuses on comments field updates, significant refactoring/improvements to ProcessWire’s core Template class and PagesLoader class (which is used by the $pages API variable), and we introduce a useful new $pages API method— https://processwire.com/blog/posts/pw-3.0.153/1 point
-
Stumbled over this one today and I'm really impressed! ? https://www.browsersync.io/ It is free! 3 commands setup (really that easy!) Live reloading Proxy to local network (great for testing site on mobile!) @adrian just a FYI as you implemented the viewports panel in tracy and might be interested in this one ?1 point
-
Exactly what I thought! I also find it counter intuitive that it does not return a boolean value! Your linked example looks good as-is, but it somehow does not feel right to have a ->has() return something else than yes/no. $pages->getID() is great to have and absolutely clear imho ? Ok, I've done some research and I see that we have several HAS... methods returning integers, for example: $page->hasChildren() $page->hasLinks $page->hasReferences Still not sure if it wouldn't be better to have those additionally for clearness: $page->numChildrenVisible() $page->numLinks $page->numReferences Of course that's nothing extremely important, but PW is known for it's awesome API, so it might be good to keep it as clean as possible. What do others think about those wordings?1 point
-
@gowthamg Do you just need to simply show the images from a user? Because in that case you only need the Instagram Basic Display product (https://developers.facebook.com/docs/instagram-basic-display-api/) (no need to submit anything to fb and no need to provide a website adress). Did you follow these steps? : https://github.com/nbcommunication/InstagramBasicDisplayApi Facebook for Developers: Add new fb app Add instagram as a product for your app Go to your app > Products > Instagram > Basic Display and scroll down to "User Token Generator" Add Instagram Tester Approve the tester inviter on the instagram profile Click generate token Processwire Instagram Basic Display API: Go to your module, click 'Add an Instagram user account Fill in the username and the generated token And then you should be able to use the api? Hope it may help, Best, Jonatan1 point
-
You really only discovered this today? We're using it since years (with Gulp, Babel, Webpack etc.). Welcome to the 21st century ?1 point
-
The naming of "has" sounds a bit unintuitive to me as well, since it involves getting a true/false, so it can lead to confusion when reading the code where the returned id is used. Maybe something like this? (somewhat similarly to the C# TryGetValue()) $pages->tryGetId(selector);1 point
-
UPDATE 2020-03-21 SnipWire 0.8.5 (beta) released! This update improves SnipWires webhooks interface and provides some other fixes and additions: Catch module settings access for non super users Fixes [#2] Dashboard not accessible for non SuperUsers Added documentation (php comments) to Webhooks class and hookable event handler methods All Webhooks event handler methods now have a return value (Snipcart payload) Hookable event handler methods: All hookable event handler methods will return an array containing payload Snipcart sent to your endpoint. In addition the following class properties will be set: $this->payload (The payload Snipcart sent to your endpoint) $this->responseStatus (The response status your endpoint sent to Snipcart) $this->responseBody (The response body your endpoint sent to Snipcart) (Use the appropriate getter methods to receive these values!) How to use the hookable event handler methods (sample): $webhooks->addHookAfter('handleOrderCompleted', function($event) { $payload = $event->return; //... your code here ... }); PLEASE NOTE: those hooks will currently only work when placed in init.php or init() or ready() module methods!1 point
-
1 point
-
@adrian Thank you so much!!!!! ?☀️??? And thank you for such an amazing response time! - Done! - Worked like a charm!!!! Strongly back on the I-love-processwire-and-think-it-is-so-amazing-train! ??? ✅ Solution: Installed RuntimeMarkup Fieldtype module, made a new field with that type: DETAILS > : Edited runtime php file: site/templates/instagramaccountid.php: <?php namespace ProcessWire; $instagram = $modules->get("InstagramBasicDisplayApi"); $data = array('username'=>''); $account = $instagram->getUserAccount($data["username"]); $username = isset($account["username"]) ? $account["username"] : ""; $at_instausername = "@" . $username; echo$at_instausername; ?> Result: One piece of beautifully dynamically called data shown in as sweet plain text in the defined field in the template: Could be really cool though if this kind of custom field would maybe become integrated in the core? As well as an "locked / unlocked" option for all fields? Thanks again! All the best, Jonatan1 point
-
The thing is, it's a risk that's carried by the site developer rather than the module developer. If an autoload module adds scripts and styles to $config->scripts and $config->styles it's your site that's at risk of breaking, not the module. Personally I'd never want to take that risk. The simple solution is to create your own custom FilenameArray in $config that is reserved for front-end usage. This old post from @Soma explains how:1 point
-
Hi @jonatan and welcome to the forums. The "Open when populated + Closed when blank + Locked (not editable)" is the closest to what you are looking for. You might actually want to add your support to this request: https://github.com/processwire/processwire-requests/issues/346 Back to your original question, I haven't used Mystique, so not sure what its limitations might be on this front, but I wonder if you can make use of https://github.com/Toutouwai/FieldtypeRuntimeOnly to add the instagram data in a runtime field.1 point
-
1 point
-
@Macrura Thanks for reporting. I fixed the issue. The JS is required only for the module settings UI. It is now only loaded there.1 point
-
It's getting even more confusing - now it works even in /site/ready.php ? <?php namespace ProcessWire; class RockHook extends WireData implements Module { public static function getModuleInfo() { return [ 'title' => 'RockHook', 'version' => '0.0.1', 'summary' => 'RockHook', 'autoload' => true, 'singular' => true, 'icon' => 'bolt', 'requires' => [], 'installs' => [], ]; } public function init() { bd('init()'); bd(1); bd(2); bd(3); bd('add handleWebhook'); $this->addHookAfter("ProcessPageView::execute", $this, "handleWebhook"); bd('add hello-hook in init()'); $this->addHookAfter('hello', function(HookEvent $event) { bd('hello-hook fired in init()'); }); } public function ready() { bd('ready()'); bd('add hello-hook in ready()'); $this->addHookAfter('hello', function(HookEvent $event) { bd('hello-hook fired in ready()'); }); } public function handleWebhook($event) { bd('handlewebhook fired'); bd('trigger $this->hello()'); $this->hello("trigger hello() in execute() hook"); } public function ___hello($where) { bd('hello!', $where); } }1 point
-
@ryan released a new version (1.0.8) of this module a few days ago. Thank you! It works perfectly fine as previous versions did - even with the most recent DEV version of ProcessWire. There are also some new features included. Grab your copy now from the modules directory or via the upgrade module. Have fun and stay safe!1 point
-
1 point
-
Goldkinder Psychotherapie Website of the child and youth psychotherapist Heike Maßen from Mönchengladbach, Germany. A one-pager that gives an insight into her work and her practice rooms, as well as information about many relevant aspects. It's a simple responsive one-pager with a nice design from Uta Hugenbruch. The front end is build without any framework.1 point
-
Hi guys, I was very excited for this module, but my life took a huge direction change and I no longer have the time to invest in module development. I am gonna leave the files here. You guys can take it and run. Maybe there might be something useful here. Maybe not. I still think it's a good idea to do drag and drop modal building in PW. So hopefully one day something like that can come to light. I love this community and I love ProcessWire. Live long and prosper. - Joshua Designme 2.zip1 point
-
I ran into a specific multilanguage problem. When setting the default language C parameter of LanguageSupport to nl_NL.UTF-8 (or nl_BE.UTF-8), then the Color module hsl return value has a comma as decimal separator, which is not a valid CSS value (or a valid hsl value for that matter). Example with dutch locale: hsl(195, 96,2%, 59%); Should always be: hsl(195, 96.2%, 59%); no matter the chosen locale. (note: the comma is the expected/normal decimal separator in dutch, so it's not a LanguageSupport mistake)1 point
-
@Macrura Shortcut URLs I have pushed a release that treats strings as URLs so that any of the following options should work: [ 'shortcuts' => [ // Page $this->pages->get(1132), // Page ID 1020, // Overwrite page title 'New things' => 1020, // Set custom URL 'Backups' => "{$config->urls->admin}setup/db-backups/backup/", ], ] Profile page icon Check out the PageIcon module which lets you set custom icons for every page. Hooks in admin.php That's strange. Do you have any other hooks in admin.php that work? I have tons of hooks there and never had a problem. $config->styles True, I don't use the styles array myself so I haven't run into this. Will research a fix.1 point
-
@jonassalen, open the ProcessSetupPageName.module file in your code editor and try replacing this section at the top of the createFromFormat() method... if ($languageID == null && $this->languageSupport == true) $languageID = $this->wire('languages')->getDefault()->id; $langID = $this->wire('languages')->get($languageID)->isDefault()? null : $languageID; if ($this->languageSupport) { $userLang = $this->wire('user')->language; $this->wire('user')->language = $this->wire('languages')->get($languageID); } ...with... $langID = null; if ($this->languageSupport) { if ($languageID == null) $languageID = $this->wire('languages')->getDefault()->id; $langID = $this->wire('languages')->get($languageID)->isDefault()? null : $languageID; $userLang = $this->wire('user')->language; $this->wire('user')->language = $this->wire('languages')->get($languageID); }1 point
-
In some projects I use a mix of the $config->scripts and $config->styles FilenameArray to add scripts in templates. And one similar to the one Ryan, where I can create js and css files with the name of the template and they'll get loaded if existing. In a recent project I use a custom $config->siteScripts = new FilenameArray(); $config->siteStyles = new FilenameArray(); I set in a autoload module. Then I add the script in a template: $config->siteScripts->add($config->urls->templates . "js/yx.js"); This also allows for modules I create, for example widgets (that are not autoload), that need scripts/styles to add them with simply adding the method above in the init(). So as soon as I load the module in the front-end they'll get added to the array. To output, I use the same method as found in default.php from the admin template. <?php foreach($config->siteScripts->unique() as $file) echo "\n\t<script src='$file'></script>"; ?> You could also just use the $config->scripts used in the backend, but if you use form (InputfieldForm) API in the front-end, loading inputfields modules will also load scripts and styles from those in the filename array. This may not desired, that's why I use a custom filename array. For anything basic and global, I add scripts and styles hardcoded in the main template.1 point
-
I live on the countryside too, but I had to travel to another town to restock toilet paper on Friday because every single one of our eight supermarkets and drug stores was out of stock. I finally got a pack (one out of the last three) in a neighbor town. People are hoarding like crazy. I saw a few customers with trolleys heaped with paper towels and pasta. Stupid. But if you look at the run for toilet paper, you know what's in their minds... But yes, most people around here are both realistic and calm, thankfully. At work, we have a revolving home office schedule now in most departments to make sure that we can have staff on site in case those present at the office have to quarantine. Business is slowing down because negotiation meetings can't happen in person. But all that (as always in changing circumstances) means more work for our department for now to get as many colleagues as possible set up to work from home, i.e. additional VPN lines, laptops, remote desktops, e-learning, conferencing software etc. All things which we were already rolling out to everyone, but what was planned over the course of a year now has to happen within days and on top of ongoing major projects. So the weekends are going to get even shorter, and instead of implementing planned features in software, it's now more about tying things together to get everybody's remote work experience to lift off flawlessly. For me personally, things got turned on the head because I was about to start the last four weeks of work before my half year sabbatical. After years of planning, I was about to thru-hike the Pacific Crest Trail from Mexico to Canada. I had my visa approved, gear bought, flight booked, the first stays before the trail arranged, my post re-routed and thousands of other little things taken care of. It's simply not feasible now. 5/6 of the trail go through what are now deemed high risk states California and Washington, and people there are going to have their own problems without me adding to it. Even if I found a way to hike there, I couldn't do so with a good conscience and leave family and friends here in such uncertain times. I thankfully can postpone my sabbatical to next year, but there's always an uncertainty about such massive undertakings. But such things suddenly became far less important. It's about keeping people safe and being there for those who do or might need me right now. Here in Germany, we're hitting exponential growth in numbers (from 157 new infections on Wednesday, to 271 on Thursday, then 802 on Friday and about 1800 yesterday). There will be no way around more restrictions similar to those in the countries around us.0 points