Leaderboard
Popular Content
Showing content with the highest reputation on 12/27/2017 in all areas
-
Hi Guys It would be awesome when all the resource about processwire (tutorials, docs, cheatsheet, recipes, videos, api, faq etc...) would be unified on one documentation website called "docs.processwire.com". The new site would gather infos & data from these resources: https://processwire-recipes.com/ http://processwire.tv/ https://www.pwtuts.com/ https://processwire.com/docs/ http://cheatsheet.processwire.com/ and would unified it on the final site https://docs.processwire.com. I think It is far more better to have one endpoint for all the processwire resources & wisdom then mutliple sites. This way it is far more easier to get into the processwire world and choosing processwire as the next main cms for further projects. The Documentation Site could perhaps look like this (it is just a mockup, so don't expect to much from me ):4 points
-
4 points
-
We are getting off-topic here, but... If @mindplay.dk is not actively maintaining the module then I think it would be good to update it. It would be cool to have as an option in Tracy, or the module could be forked. I found that the module isn't working in PW3 where a namespace is declared at the top of template files. I had to modify the module code to add the namespace to stubs.php because the FileCompiler does not compile this file. Also, I'm probably overlooking something but I can't see why the module needs to rebuild the stubs file after every Session::redirect and every ProcessPageView::finished. I think that comment is due to a misunderstanding of what the module is for. The module only adds code completion to $page for field names in the current template - it isn't intended to provide code completion for all API variables (for that you have to add a DocBlock in every template file with tags for each API variable).4 points
-
I couldn't agree more Maybe that is why I already proposed: https://processwire.com/talk/topic/17348-is-pw-becoming-more-popular/?do=findComment&comment=150914 "...I propose to make 2018 the year of the documentation, so to speak. What if we could stop hunting for new features for a while and concentrate on the following in 2018..."3 points
-
Thanks Robin, Please check your PM - a have a major new version in the works (probably released tomorrow) which already fixes this along with Rick's issues. I have sent you a preview to test.3 points
-
Yes. Yes, it is. And the longer any organization is put off the mightier that task becomes.2 points
-
Do you have Tracy Debugger installed? That might provide some additional info; Usually when I'm doing a V2 -> V3 upgrade, i follow this procedure: 1) If I don't have the site already cloned locally, make a duplicate site on local machine to test the upgrade - make sure you have TracyDebugger installed, force development mode - put site into debug = true 2) check/repair permissions on files, and also check the chmod settings inside config.php (I've had upgrades seem to fail because of bad permissions).. 3) remove all modules that are known to not work on V3, for example legacy CropImage; - also remove all modules that are not necessary for the site to run - check which ones are in the modules folder, but are not installed and remove those. 4) Run the upgrades on the local version, and find issues, repair...; - view logs if you get errors - repair permissions if you get server errors but nothing in logs - Update .htaccess, add any mods that were made to the 2x version into the 3x version (such as www/non-www, force https, custom redirects, gzip etc). So far even on a really complex site, i've maybe found 4-5 things that needed to be fixed, and then i went to the live site, fixed those things before the upgrade, then ran the upgrade on live and it worked fine. Make a complete backup of the live site, as well as the database, using the database backup module, prior to running the upgrade Troubleshooting: - If you run into modules that seem to be broken, you sometimes have to trick the filecompiler to recompile the module, you can open the module file, create a new line somewhere, save, undo, save... (this happened on a few sites) - refresh the modules - sometimes you have to refresh modules several times to clear out errors2 points
-
Thanks, I'll check all the issues and fixes when I finally get out of this less productive holiday season2 points
-
Finally working - thanks for the help. Steps to resolve. 1. Use normal FTP mode instead of FTPS or SFTP 2. In the host field I was using ftp://hostname.ddns.me instead of just hostname.ddns.me 3. Use passive mode as you suggest Thanks again. Really nice Module you have there. I normally do backups to a VPS because it has inbuilt drop-box backups. However it's getting to be an expensive entreprise so storing them on my own NAS like this will really help. Looking forward to DropBox integration too. I notice it's temporarily parked.2 points
-
It looks like the JS and CSS dependencies for InputfieldPageListSelectMultiple are not included in the page. Probably because ProcessPageLister::renderResults is called via AJAX after the page has already loaded, at which time it is too late to tell PW that the dependencies are needed in the <head>. You could try forcing the dependencies to be loaded in a hook to ProcessPageLister::execute... $wire->addHookAfter('ProcessPageLister::execute', function(HookEvent $event) { if($this->config->ajax) return; // not needed for AJAX-loads $inputfield = $this->modules->get("InputfieldPageListSelectMultiple"); $inputfield->renderReady(); // load JS/CSS dependencies });2 points
-
Thanks guys. Got it working. New to Cron but it was easy enough to figure out on a VPS ?1 point
-
PwCron is not required anymore, you can set your job calling directly site/modules/Duplicator/cron.php https://github.com/flydev-fr/Duplicator#system-cron1 point
-
Personally I wouldn't bother with PWCron - I would use a normal system cron (via crontab -e or similar). This is the simplest and most customizable approach.1 point
-
Unfortunately it depends on the load order of the modules. If Tracy is loaded before the module you are trying to debug, then yes it will work. I use it regularly for debugging when developing modules. Unfortunately, the order that modules are loaded seems to be pretty random (although I haven't looked into this properly). I have put in a request to Ryan to add a way for Tracy to be loaded earlier, but I haven't heard anything on that. I'll keep it mind to see if there is a solution I can come up with to get it loaded earlier though - it might be possible to include the required files manually in the root index.php or something like that, but it could get messy.1 point
-
@Peter Knight Thanks Peter. Changing bucket destination with a new empty it works well!1 point
-
Does this happen in the frontend or backend? Did you also replace the index.php and .htaccess file? Try deleting the site/assets/cache/ folder contents. If that doesn't help (and you can login to the backend), try clearing the modules cache. If that doesn't help either, disable all modules (other than core modules), and re-install one by one. Or add namespacing on the very first line of your .module files: <?php namespace ProcessWire;1 point
-
Thank you! Works like a charm. Didn't yet know about renderReady() - bookmarked1 point
-
1 point
-
@jeve please change the "Remove backup packages older than" setting to "Never" and try again then let me know @Peter Knight are you sure you are not mixing SFTP and FTPS ? SFTP is based on ssh protocol which is not supported.1 point
-
1 point
-
It's a principle of the page tree organisation in PW that all pages have to be children of one single root page - it's title is Home by default, but you may change it as you like. If you like to send your site visitors to a certain page in the tree, you can redirect to it. It just cannot have the title Home, so use Start or whatwver seems adequate. Another question is if this redirecting leads to a good user experience. The visitor normally would not expect to land on a subpage. I'd rethink the tree structure.1 point
-
1 point
-
@Vigilante, please use code blocks for your code examples. If you really need to do it this way then you could do... <?php foreach($parents as $parent): ?> <?php $children = $parent->children("id=$everything"); // PageArray dereferenced as string of pipe-separated IDs ?> <?php if(count($children)): ?> <section> <h2><?= $parent->title ?></h2> <ul> <?php foreach($children as $child): ?> <li><?= $child->title ?></li> <?php endforeach; ?> </ul> </section> <?php endif; ?> <?php endforeach; ?> ...but it's not very efficient. Instead, I suggest you don't need the $parents PageArray and should just work on sorting the $everything PageArray. For example: // Sort by parent in the selector for $everything $everything = $pages->find("template=basic-page, sort=parent"); // Initialise $parent_title $parent_title = ''; foreach($everything as $one) { // By default, this is not a new section $new_section = false; if($one->parent->title !== $parent_title) { // If the parent title of $one is different to the existing $parent_title // then this is a new section $new_section = true; // Set $parent_title $parent_title = $one->parent->title; } // If this is a new section and $one is not the first item in $everything // close ul and section from previous section if($new_section && $one !== $everything->first) echo "</ul></section>"; // If this is a new section, add the open section, heading and open ul if($new_section) echo "<section><h2>$parent_title</h2><ul>"; // Output the li echo "<li>$one->title</li>"; // If $one is the last item in $everything then close the ul and section if($one === $everything->last) echo "</ul></section>"; } If you need some custom sort of the parents then you could loop through $everything and add a custom sort property to each item, then sort $everything by the custom property. Not exactly the same, but this post shows the general idea:1 point
-
There are other ways, but check out the Request Info panel in Tracy when viewing the field settings in the admin. See that there is an "initValue" setting. This indicates that you can do: $fields->get("map_width")->initValue In the Tracy Console panel (again if you are viewing the field in the admin), you can do: This is because the Console makes available $field, $template, and $module when you're in the admin and viewing an individual field, template, or module.1 point
-
@Guy Verville Glad to know it works smoothly for your personal site. Let me know if any issues arise, and I’ll be happy to help.1 point
-
This is what I use when using the ProcessPageEdit::processInput hook. Put these as the first lines inside the function. // ProcessPageEdit's processInput function may go recursive, so we want to skip // the instances where it does that by checking the second argument named "level" $level = $event->arguments(1); if($level > 0) return;1 point
-
are you using the default .htaccess file - do you have anything enabled, like www vs non-www, or https? Also are you using cloudflare?1 point
-
Thank you very much for this nice addition! I will give it to my programmer (he had created his own solution inspired by your module and tightly integrated wit the existing code, but your config approach is more convenient and will certainly help a lot of people here). PS: I have installed in my modest and personal website and works like a charm. http://www.guyverville.com/sitemap.xml1 point
-
For anyone who is having the red x problem with images, I was able to solve these missing images by doing 2 things: 1) If you are on https, convert image references to absolute (i think this is because the library uses http when replacing image references ?) $rootPath = $pages->get(1)->httpUrl; $body = str_replace("/site/assets/", $rootPath . "site/assets/" , $page->body); 2) Manually create the temp folder ("WirePDF") inside site/assets/cache/ – this folder did not exist and therefore the core library was throwing image errors. Once these 2 things were completed, now the PDFs generate with the images correctly1 point
-
Since no one tried to revive the "oldish" UIKit theme -- i did it. Moderate contrast Non-aggressive color scheme Light colors, no dark backgrounds Very close to the original UIKit design Feel free to replace the /wire/modules/AdminTheme/AdminThemeUikit/uikit/dist/css/uikit.pw.min.css with the file i upload here. Hope it will be useful for community.uikit.pw.min.css uikit.pw.min.css1 point
-
I am calling d($result) from the console panel. I have a saved snippet that I refer to often. The result is appended to the admin page and doesn't display in any panel I have found. I would keep the ajax panel functioning as you have overridden. Maybe the manual clear option is best. The ajax panel does increase vertically. It doesn't appear to stop at the view port top, though. The same with the console panel. I have to clear the result on the console panel for it to resize back down where i can close it. But I am not concerned about that. One pilot error at a time. Edit: We can take this offline to PM if you wish. I hate clogging up this thread with my stuff.1 point
-
In this particular case, I am testing various parameters of a method in the console and viewing the output in the dumps panel (currently the ajax panel as in the first image). There can be many separate testing results listed in the ajax panel. So I thought there was a means to clear the previous result set before executing another test. Two things. 1) I have to reload the page, or navigate away, to clear the ajax dumps panel, correct? When I do that, the content of the ajax panel is copied to the recorder panel where I can then clear the result sets. No, I'm not trying to prevent the results in the ajax panel from moving to the recorder panel. I was just looking to clear previous result sets from the ajax panel. The ajax panel is a small panel and not resizeable, and I can have quite a few result sets listed. 2) the d() command displays the raw data appended to the current page, below the footer. It does not display the dump result in any panel that I can find yet. Hence my use of bd(). I could write the results to a log file, but then I have the same problem clearing old data. I'm not requesting a change to Tracy. I am not sure about the proper procedure, or if I am missing some configuration option. Either way, it is pilot error and not equipment malfunction. Thanks for your help!1 point
-
1 point
-
When I execute a portion of code in the terminal and output the result using BD() it is placed in the Dumps (Ajax) panel, which is fine. However, there is no Clear Dumps option. If I change pages (another admin menu option) and return, all results are now listed in the Dumps Recorder panel, which does have the Clear Dumps option. The Dumps (Ajax) panel is then empty. Is there a way to add the Clear Dumps option to the Dumps Ajax panel?1 point
-
Merry Christmas and Happy Holidays to everyone! This week and next week are shortened here due to reduced school and work schedules for the holidays (as I imagine they are in most places), so there won't be a new blog post and PW version for today. With the kids home from school all day, work shifts to building stuff with legos rather than code. But there are still several interesting PW updates in progress and I look forward to writing about them in next week's blog post. The new version (3.0.87) and related blog post will likely be a day early next week (on Thursday) rather than on Friday. Thanks for reading and I hope that you and your families have a great and relaxing holiday!1 point
-
That looks awesome. I'll have to give it a go. If it's working as expected in all/most IDEs I don't think I'll worry about building this into Tracy unless you guys can think of a reason why it would be a better fit there - it's nice to have less modules to install I guess, so maybe that's enough of a reason?1 point
-
I created a "Pull Request" at my own and extended the module config, so one is able to define a date range and reverse sorting. Thanks @Macrura1 point
-
For pages that you want to automatically direct to the first child, I would make them use a template that has this in it's code: <?php if($page->numChildren) $session->redirect($page->child()->url); If you add a new child page, and they aren't sorted by date added (descending) then the newly added page isn't likely to be the first child. If no default sort is selected, then it'll add it as the last child. So if you wanted to redirect to last page (rather than the first) then you'd want to do this: <?php if($page->numChildren) $session->redirect($page->child("sort=-sort")->url); By the way "sort" is just a name representing the order that pages have been dragged/dropped to. That's the default value if a page doesn't have another field selected as it's default sort field. The minus sign "-" in front of it represents descending sort. Without the minus sign, it would be ascending. Since you want to select the last page, that's why it's "-sort" rather than "sort". Or if you wanted to make it select the most recent page added by date: <?php if($page->numChildren) $session->redirect($page->child("sort=-created")->url); The above is also descending since most recent added would be the highest date.1 point
-
Hello, I am using the form API for forms, and I have some defaults that are saved via a cookie. So if someone has visited the site previously, if they return to complete a query form etc, the idea is that these are prepopulated in the form. I am using InputFields and using $fieldname->render() to create the form fields. Can I just set the value of an Input field (after first checking we are not in the middle of a POST)? What I don't get is when Inputfield get populated from POST - it seems to be populated as soon as it gets instanced, because if the form is completed, but has errors, the form field contents get remembered from the POST, even through I haven't done a processInput yet. I am guessing I can't just say $nameformfield->value ? $formfield->value : $_COOKIE['name'];1 point