Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/23/2018 in all areas

  1. Did I already say that I love PW? ? I had to write an offer today and I wanted to link to a portfolio website that I've built, but the link was too long for the PDF. Then I wanted to use one of the url shortening services, but it felt wrong to put a link like bit.ly/409weifsd on my offer. I then just enabled UrlSegments on my website's home.php template, added a repeater with fields "title" and "link" and put 5 lines of code to get my very own custom short-links: $shorturl = $sanitizer->text($input->urlSegment(1)); if($shorturl) { $link = @$page->shorturls->findOne("title=$shorturl")->link; if(!$link) throw new Wire404Exception(); $session->redirect($link); } If you want to try it out: https://www.baumrock.com/pw-demo Any suggestions for improvements are welcome ?
    10 points
  2. Here's a preview of the new API Explorer panel I hinted at earlier. You'll notice a lot of similarities with the Captain Hook Panel with everything ordered alphabetically, and with toggling to open/close the DocComment text and direct links to open the appropriate file to the first line of the method in your code editor which I hope will be a useful learning tool because often the methods for an object are inherited from a parent class and so are not necessarily in the file you might expect. This will make finding the source of these methods really quick and easy. The link in the first column of the table opens the API ref docs on the PW site or using Ryan's API Explorer module (if you have that installed). Also note that conditional parameters for the methods are italicized I'll probably commit the first version of this tomorrow, but I'd love to hear any initial feedback from these screenshots - other than comments on the awful icon ? (unless you have a suggestion for a better one).
    5 points
  3. Let's say you want to add an image using the PW API from an outside service that doesn't provide a clean filename like my-cool-image.jpg (such as from dummyimage.com, urlbox.io, etc). Doing it this way will add the image successfully, but the filename will be problematic and have an invalid extension (bad): $p = $pages->get(1); $p->your_single_image_field = "https://dummyimage.com/600x400/000/fff"; $p->save(); Instead, you need to rename the file right before save (good): $p = $pages->get(1); $p->your_single_image_field = "https://dummyimage.com/600x400/000/fff"; $p->your_single_image_field->first->rename("better.png"); // need 'first' here $p->save();
    4 points
  4. A little self promotion: I just added "date" and "time" subfields to my DatetimeAdvanced replacement for PW's core Datetime field. That lets you search like this: $today = date('y-m-d'); $result = $users->find("birth_date.date=$today"); Also works for in-memory (i.e. PageArray) searches.
    3 points
  5. Thanks for this Jonathan. Since this is a tutorial, maybe new users would like to know, is there a way to programmatically rename the file to something related to the image, rather than renaming it to 'better.png' every time ? ?. By the way, a $p->save('your_single_image_field'); is more efficient since it will only save the field where changes have occurred. Just thought to point this out, in case the page has lots of fields, repeaters, etc. ?
    3 points
  6. Dates are stored as timestamps and you have to search the whole day :) $start = strtotime(date('Y-m-d') . " 00:00:00"); $end = strtotime(date('Y-m-d') . " 23:59:59"); $result = $users->find("birth_date>=$start, birth_date<=$end");
    3 points
  7. @Ralf - I would recommend installing 3.0.116 for the moment. It looks like this is not the only bug introduced in 3.0.117 - the Profields Table field is also throwing warnings that need attention. Note that there is no 3.0.118 yet
    3 points
  8. You are getting into a looping issue because you are hooking into every page saved. I also think you have to hook into Pages which then has the need info in its arguments. wire()->addHookAfter('Pages::saved', function($event) { $page = $event->arguments(0); if($page->template == "user"){ $savedUser = $page; $userpage = wire('pages')->find("parent=Abos, name=".$savedUser->name); if ( count($userpage) == 0 ) { $page = new Page(); $page->template = 'Abos'; $page->parent = wire('pages')->get('/Abos'); $page->title = $savedUser->name; $page->save(); } } });
    2 points
  9. Thanks @ottogal - I'll have a play with something where the API text is bigger (as you have it), or go with something simpler. Not too important ? Anyone have any thoughts on having the description of the doc comment in its own column for quick reference? Of course you can still expand to get the full comment text. I think this is probably quite useful - anyone think otherwise?
    2 points
  10. @adrian thanks for the work on this! It's a super module that just got even better! Hope it's of use to others in its new multi-language support mode.
    2 points
  11. Just came across this thread - for those who were wondering, we switched from ServerPilot to RunCloud + Linode for many PW projects and find it to be a great setup. Their support is great too, they’re in the Far East but always respond very quickly, not that we’ve had many issues. Very favourable pricing too compared to ServerPilot and way more features.
    2 points
  12. Thanks to everyone who was helping me the other night. A little update on what I ended up doing with my helper module so far.... For the site settings, I ended up just making a configurable module with only one field containing a load of defaults stored as a simple JSON array. I thought this would be far easier for my specific purpose as it means that it's easily customisable with new data on a site-by-site basis without having to update the module interface or add new fields. I've hooked the $page object to access this data on the front end, so I can now do <?=$page->siteSettings['company_name'];?> etc in my templates which is cool. I've also set some dependencies in the config for the modules we regularly use. I have also used a hook to inject an overlay 'edit mode' icon that displays on the front end whenever an editor is logged into the site, as we've found some people don't realise when they're logged in and can use the front-end editing on their site. The little cog icon also links back to the PW dashboard. Really starting to get the hang of how the PW modules work now, so will be adding in lots more useful stuff we tend to use for every project in due course. ?
    1 point
  13. @adrian Yes, this module works flawless, and I had an error in my own hook, so there IS a way to hide the "page" navigation item already. Don't know, why it worked before, and now it did not. Also I don't know why I did not tried this module, because I was aware of it. However, I still think my pull-request is a valid option, for changing the navigation.
    1 point
  14. That would depend on the nature of what one needs. But perhaps if you wanted to name it the name of the page (assuming it's an existing page) you could do: $p->your_single_image_field->first->rename("{$p->name}.png"); // need 'first' here
    1 point
  15. @jmartsch - what about this module from @netcarver - http://modules.processwire.com/modules/admin-restrict-page-tree/
    1 point
  16. I created this Issue: https://github.com/processwire/processwire-issues/issues/734
    1 point
  17. I don't think this is correct. If you are talking about FieldtypeDatetime, dates are stored as datetime. This is not the same as a timestamp ?; there are some 'little' differences. Sorry if I am being pedantic!
    1 point
  18. @adrian Thank you for the latest additions and your continous great work on this essential module. I can't wait for the API explorer panel. This is great and would save me a lot of time going to ProcessWires API reference page and look for what I am searching. One thing that would be extremely useful would be a find-as-you-type-filter, to find what you are looking for quickly, similar to AdminOnSteroids filter function for AdminDataTables or modules.
    1 point
  19. Please read my comment about a proposal change for what is rendered in the navigation
    1 point
  20. Please read my comment about a proposal change for what is rendered in the navigation
    1 point
  21. It seems all solutions, including my own one from here don't work with AdminThemeUikit. So I proposed a change to the getPrimaryNavArray function which you can read on github and enables us to hide the "pages" menu item from the top navigation. Vote for it, if you like. EDIT: Actually, there is a working module from @netcarver - http://modules.processwire.com/modules/admin-restrict-page-tree/ My own function had an error and now I replaced it with the mentioned module. @bernhard Maybe this interesting for you also?!
    1 point
  22. Good find, I like it.
    1 point
  23. Hi everyone, @dab has kindly sponsored support for multi-language subjects and content which I have just added to v1.3.0 Here is my test email content which will hopefully show you how it works. Subject English Subject ==#es== Spanish Subject ==#fr== French Subject Body English body ==#es== Spanish body ==#fr== French body ==sidebar== Sidebar english ==sidebar==#es== Sidebar spanish ==sidebar==#fr== Sidebar french There is also a new "Auto Activate Languages" checkbox that you'll probably want to check in the module config settings. Please let me know if you have any problems with this new functionality. Cheers, Adrian
    1 point
  24. I use DBPowerAmp for ripping, there are a lot of advantages to using that, it handles cover art fetching very well, and the accurate rip is also very useful
    1 point
  25. Just throwing one more in there...just in case. Not open source but has served me well in the past, TagScanner: https://www.xdlab.ru/en/ Beyond tagging, renaming and moving based on custom rules makes this very powerful.
    1 point
  26. https://www.discogs.com/developers/index.html (untested)
    1 point
  27. I've used http://www.tuneupmedia.com/ a few years ago quite successfully. The interface is a bit wonky, but it get's the job done.
    1 point
  28. Thanks @kixe - I didn't have a need for repeaters when I wrote this module, but it's certainly a good idea to support them. I have gone ahead and updated the module based on your idea and it now works for repeaters as well. Thanks!
    1 point
  29. Nice, "pw-optional". Right now I'm finally back in ProcessWire re-building some websites and Markup Regions is a breeze to work with.
    1 point
  30. I'm still fairly new here having switched to using ProcessWire for pretty much every project (hence the frequent questions ? ) from Concrete5. Concrete5 has had Gutenberg-esque block-based front-end editing for nearly 10 years longer than Wordpress. Although a finished site using C5 can look great for a site editor/frontend-only user with various drag-drop layout tools, we were finding c5 development had become very convoluted and was starting to make simple website projects unnecessarily complicated. C5's core weighs in at a hefty filesize too. This is why we started researching for alternatives and landed happily at ProcessWire. I already find WP development unnecessarily convoluted, especially compared to the simplicity of ProcessWire. And with Gutenberg, I can only foresee the same sort of headaches ahead for the WP community that we were finding with C5 - namely conflicts between blocks and the core and frontend UI and your design style and functionality being dictated to by the CMS in order to work in the Gutenberg features. Discovering ProcessWire has been a revelation for us - the clean API and design agnostic approach are making everything from simple website projects to complex web apps a breeze, with the added bonus of super simple frontend editing that not only wows client's used to site builder platforms but requires basically zero onboarding too. I would urge anyone thinking of building out Gutenberg inspired modules for ProcessWire to consider the above comments to ensure that what makes ProcessWire special is retained.
    1 point
  31. @DxJR Sorry, I haven't had a chance to look at it yet. If you are able to help debug it please, that would help get us there.
    1 point
  32. Also just got this working, all generated automatically from the currently PW install, so it's always up-to-date. Do you guys think you'd make use of this?
    1 point
  33. What do you guys think of me adding things like this:
    1 point
  34. I think we should be careful with those snippets. One might find a snippet helpful, another one might find it annoying. If we bloat tracy with snippets it might be counterproductive. I'll see when I find time to dig into that!
    1 point
  35. Great additions as always! Thanks for the tutorial on building panels, I'll try that when I have an idea for something ? IMHO the best would be to have one shared file in the core and one file specific to each user, because habits are different so I think not all snippets will be helpful to everybody. On the other side it would be great (not to say necessary) to be able to define those snippets somewhere shared across multiple installs of tracy, so that we always have all our snippets available. I think the best option would be to define a web-url (eg github snippet url to a raw file) and pull this file into the pw cache regularly. Everybody could then just push a new snippet to his git account (or on his webserver) and all tracy installations referencing this file would always be up to date with this file. If you are happy with that idea I can try to implement that feature and do a PR
    1 point
  36. OK, just released a major new version: 4.12.0 1) New Title/View link in Dump tabs, so ID is edit link and title/name is view link 2) New PagePermissions section added to PW Info panel: 3) New PHP and custom PW autocomplete snippets added to the Console and File Editor panels. Here's one example, but there are others in the posts prior to this one showing general PHP snippets. Currently there are two custom PW snippets: pwforeach and pwfind - I'd love to hear what you guys want to see here. If you have new snippet ideas, please take a look at: https://github.com/adrianbj/TracyDebugger/blob/master/scripts/code-snippets.js and feel free to send PRs with new additions. 4) Ability to dynamically resize the font in the Console and File Editor panels with: Increase: CTRL + +/= Decrease: CTRL + -/_ Reset: CTRL + 0 5) Changes to the way the Console panel divs are structured and resized - please let me know if you see any issues with the results panel protruding beyond the bottom of the panel or any other issues. It's still not perfect, but it's breaking my brain ? 6) Some minor Tracy core updates and also general cleanup of many of the custom panels. Please let me know if you have any problems with this new version, or ideas for improvements!
    1 point
  37. That's indeed the case, for me. As both a Telecommunications Engineer and Web Developer, this module allows me to use emails (from submitted forms or sent directly from someone's mail account) to aid in generating webpages. Just a few of the many things that I use this module for: Blog Submissions Article For Review/Approval Submissions Form Builder Submissions Status Updates (to already created subject areas) The fact that you can submit to multiple email addresses allows for multiple uses of this module. If you can think outside-of-the-box, you would be surprised how useful this module can be. I'm glad that you extended the original module from @ryan. When you did, I saw instant usability for this module.
    1 point
  38. I use this module on every website I have built for myself personally and also clients
    1 point
  39. This is still an issue.
    1 point
  40. 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 correctly
    1 point
  41. if Padloper doesn't meet your needs, I would go the Shopify Button route.
    1 point
×
×
  • Create New...