Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/08/2017 in all areas

  1. Password Generator Adds a password generator to InputfieldPassword. Usage Install the Password Generator module. Now any InputfieldPassword has a password generation feature. The settings for the generator are taken automatically from the settings* of the password field. *Settings not supported by the generator: Complexify: but generated passwords should still satisfy complexify settings in the recommended range. Banned words: but the generated passwords are random strings so actual words are unlikely to occur. https://modules.processwire.com/modules/password-generator/ https://github.com/Toutouwai/PasswordGenerator
    12 points
  2. If anyone's interested, I've forked Ryan's ProcessWireUpgrade module and added the ability for it to detect if github has a tagged release for the latest version of each listed module (except for the PW core repos which will require special handling). If a tagged release entry is found, it then adds an extra link to the table. This is strictly an alpha "proof-of-concept" experiment, but if you are interested my fork of the repo is here - just replace the current version of the module code with my fork and you should be OK. Providing module authors start tagging their releases on github, it will allow you to navigate to the release notes for review before you hit the upgrade link. As you can see, Mike Rockett has already started tagging his releases - and hence his module gets the extra "Release Notes" link. Worthwhile idea?
    6 points
  3. Hi @Robin S - here's a screencap of my first version of SnippetRunner. It looks and works quite similarly to the Console panel, except that it loads snippets from files in a configurable folder and of course the code itself isn't shown. I kept the "Processing" and "Completed!" notifications, as well as the results pane in case the snippet returns any output. If case it's not obvious, clicking "Run" executes the latest version of the snippet from disk, so no need to reload anything here after saving changes in your code editor. Also, the code in your snippets has access to $page when viewing a page on the frontend, or editing a page on the backend. It also has access to $field, $template, & $module when appropriate: see #2 here: https://processwire.com/talk/topic/12208-tracy-debugger/?do=findComment&comment=152466 Please let me know if you have any suggestions before I put the final touches on it.
    3 points
  4. Hi @Robin S - thanks for your thoughts on this - I am certainly willing to think about file based storage of snippets, but a few thoughts/clarifications.... The console panel is actually locked to superusers only - I don't think it should be available to any other Tracy authorized users - it's just potentially too destructive. I think my AdminActions module is a much better tool for making snippets available to non-superusers - you can control who has access to what and you can provide actions where the snippets aren't editable. I can see why this is partly an advantage, but I actually really like the console panel - it has PHP code highlighting, completion and syntax checking. Admittedly it doesn't have PW code completion, but we could actually add that. The main reason I like it is that I type and then OPT + Enter and the code executes, which to me is much quicker than using my code editor, hitting save, reloading the site in my browser and then running the snippet from the console panel. I also worry about getting snippets out of sync - if you make changes in the Console panel and save your code editor should instantly reflect those changes to the file on disk (at least SublimeText does), but what about saving changes in your code editor - how does the Console panel get updated? What if you then save again in the Console panel - you'll overwrite the changes to the file that you made in your code editor. It looks like PHP's iNotify or FAM might work for updating the console panel, but they are not standard and sound resource intensive to me. Maybe I am overthinking this - what do you think about the issues I have raised? Definitely a nice possibility - I think we'd be storing snippet files in site/assets/cache/TracyDebugger, so as long as this directory is included in your versioning then I guess it would be ok. Agreed that isn't super easy at the moment. I use my ModuleSettingsImportExport module to copy my Tracy settings (and therefor all my snippets) to new site installs. Obviously file-based snippets would be easier though. I actually think in this case we'd want a separate file for each snippet, rather than having "some scheme for labelling and delimiting the snippets within the file", as you noted at the end of your post. Definitely a good point, although I haven't come across that set - I think most snippets tend to be pretty short, but definitely a possibility that would be nice to avoid. Looking forward to hearing your (and others) thoughts on this.
    3 points
  5. here are the settings for the image above: 1) Array of Data $image = ''; if(count($page->images)) $image = $page->images->first(); $thumb = ''; $dims = ''; if($image !='') { $thumb = $image->size(100,100)->url; $dims = $image->width . 'x' . $image->height; } $data = array( 'title' => $page->title, 'type' => $page->media_type->title, 'thumb' => $thumb, 'img_dims' => $dims, 'edit_src' => $page->editUrl ); return $data; 2) Render Item Markup '<div class="item" style="width:100%;">' + (item.thumb ? '<div class="image-wrapper" style="float:left;"><img src="' + escape(item.thumb) + '" alt=""></div>' : '') + '<div class="info-wrapper" style="float:left; padding:5px;">' + '<span style="font-size:14px;font-weight:bold">' + escape(item.title) + '</span><br>' + '<span>Type: ' + escape(item.type) + '</span><br>' + (item.img_dims ? '<span>Dims: ' + escape(item.img_dims) + 'px</span><br>' : '') + '<a class="pw-modal pw-modal-medium" href="' + escape(item.edit_src) + '">Edit <span class="ui-icon ui-icon-extlink"></span></a></div>' + '</div>' 3) Render Option markup '<div class="item" style="width:100%;">' + (item.thumb ? '<div class="image-wrapper" style="float:left;"><img src="' + escape(item.thumb) + '" alt=""></div>' : '') + '<div class="info-wrapper" style="float:left; padding:5px;">' + '<span style="font-size:14px;font-weight:bold">' + escape(item.title) + '</span><br>' + '<span>Type: ' + escape(item.type) + '</span><br></div>' + '</div>'
    2 points
  6. yup, doing it all the time.. one of the main use cases for this... lotta examples earlier in this thread of images being used, here is a slider section where you select the slides to be shown:
    2 points
  7. I don't think there's a way to call ukNav and have it include the page count without modifying the function itself. From what I see (I'm not familiar with the UIKit3 profile) the lines where the links are generated are either 135 or 153. So you could clone (probably, since ukNav is rather generic) or modify (with a third optional argument that indicates that page counts should be displayed?) the ukNav function, retrieve $item->children->count() inside the loop and insert that count into the link.
    2 points
  8. Thanks for the reminder about this. I think I have two different kinds of things I would potentially use snippets for instead of what I do currently (which is just temporarily bung some code into a template file). Occasional API tasks for use in actual projects. AdminActions is probably ideal for this so I should give that module some proper attention. Exploring/debugging issues, often ones that are raised by others here in the forums. The latter is where Tracy is probably the best solution, because it's so handy to have $page available in the snippet code and often the explorations are disposable after a short while once the issue is resolved. I for one would love that, if it's not too much work to add (hopefully much of it could come from what you've already developed for console). Thanks for listening to my ideas, and the suggestions.
    2 points
  9. Or perhaps a new panel in Tracy - a dedicated snippet runner (with no editing interface) that pulls & runs snippets from a defined folder? This could be pretty handy - what do you think? Or again, maybe actions for AdminActions. Remember that actions don't need options page - they can be as simple as: class UnpublishAboutPage extends ProcessAdminActions { protected function executeAction() { $p = $this->pages->get('/about/'); $p->addStatus(Page::statusUnpublished); $p->save(); return true; } }
    2 points
  10. I messed around with the Modules Manager recently and found that this module does not fetch a complete module list from http://modules.processwire.com/export-json/, only the first 400 entries are retrieved but there are +- 497 modules in the database. The script you are using is currently set to get maximal 100 modules. You can safely increase the limit value from 100 to 400. Any value set greater then 400 will default back to 10. In this case it is less likely a problem because someone has to have more then 100 modules installed, but you never know. $url = $this->config->moduleServiceURL . "?apikey=" . $this->config->moduleServiceKey . "&limit=100" . "&field=module_version,version,requires_versions,project_url" . "&class_name="; Documentation: http://modules.processwire.com/export-json/ (limit = 1 - 400) Hope this helps, I reported the problem to Ryan. [edit] After going over it again I found out that my previous conclusions are wrong, lol... you can actually read the complete module list in steps using pagination, something that is actually mentioned in the instructions but I didn't see (need more sleep/coffee). 2nd page: http://modules.processwire.com/export-json/page2/?apikey=<key>&limit=250&debug=1 This however is not done by this script or by Modules Manager and should be fixed to make them more reliable. I edited the top part of this post to reflect my new findings and to prevent confusion.
    2 points
  11. I was a little hesitant to reply at first because I am a newbie to Processwire, also coming from a Wordpress background. However, I thought on the other hand, perhaps my point of view (similar to your background @svsmailus) is exactly one of the points of view you might want to hear from, in addition to those from experienced users. I would classify myself as mostly a non-coder, however from customizing minor stuff on WordPress over the years, I've managed just fine starting out in Processwire, so if that's you then you would be fine too. Learning-wise, I picked up what I needed to know as I went. I am still learning as I go. It all comes down to what you want to do with your site. I don't have the know-how to create a fancy site with lots of user input or advanced features like that, but on the other hand I needed something beyond a standard blog, with a totally custom layout and customized data fields; all of which I couldn't achieve on my own in WordPress. People have been helpful on the ProcessWire forum and usually I can find what I need by searching, and upon asking a question I got some really great answers, one of them with code shown that I could (and did) use and which proved super-helpful for my custom needs. All that being said, it is a bit more of a learning curve in Processwire and yes you do need some basic PHP (although so far I haven't used much more than echo statements and if...then statements), and a few chunks of HTML and CSS. I've never used the blog module for PW so I can't comment about that. Instead I created my own theme files (I actually based them off the free responsive W3 CSS templates) and made a page template of basic-post which consists of a navbar, a header, the page content, and footer, so it's pretty simple. That could be a great place to start. To begin with I added in some custom fields like featured image, and a check box for if I wanted to display the image on the basic-post template (this allows me to toggle on/off the display of featured image at the top of the article, for example I like to toggle that off if the body of my article is already image-rich). I was able to add to my layout as needed and put my extra customizations and extra display fields in. Overall, from the beginner's point of view, as a beginner myself to ProcessWire, I wholeheartedly agree with what @Peter Knight said. The way he suggested is how I happened to do it myself and I can already see how powerful and un-bloated ProcessWire is (compared to Wordpress). It's also actually fun! I also agreed with what @louisstephens and what @adrian said (and many others too; those two just stood out) in that as a beginner you don't actually NEED a whole lot of PHP at all besides echo, if-then, and foreach.
    2 points
  12. It looks fantastic, thanks! Could the shortcut keys for Run and Clear work here like they do in Console?
    1 point
  13. correct, when you get the array of data to supply to each option, that is being used when the module iterates through the selectable pages and is then used to generate the json attribute that gets added to the select option itself, in the data-data attribute. Selectize.js natively reads that data-data attribute to get the object that it can then parse into the item and option markup that it renders... item always refers to the actual option
    1 point
  14. Hello @Macrura, I'm thinking of using Inputfield Selectize as a "visual page selector", picking pages from a page reference field, meaning I need something which works like an AsmSelect but at the same time it can display an imagefield's picture of the selectable pages along with the title. Is that possible?
    1 point
  15. Whatever changes you guys make to the styles please do not use big whitespaces or at least let me and others preferring small whitespaces pick it as an option to keep it "crammed". Some whitespace is always a must, however Tracy is not about stylish design but a handy tool which should provide the most information in the smallest screen area possible. I like the current styles a lot, btw.
    1 point
  16. I see, makes sense indeed. Pity it's so difficult to style things with Tracy... Hoping we can all work on it and maybe submit a PR to Nette. Integrating it will be messy, I'm sure... bluescreen.css bluescreen.stylus
    1 point
  17. Anyways, the stylesheet attached below is an improvement over the default. It uses system native fonts, a darker header, and full-width panels: bluescreen.css
    1 point
  18. Your styles override when a panel is loaded. Here's a vid: pw_tracy_style_glitch.mp4
    1 point
  19. I have it running fine on 3.0.62 check link here
    1 point
  20. Are you referring to this PR: https://github.com/nette/tracy/pull/241 ? If that approach ends up being part of the core, I think it will make things a lot harder for me to override and also to add in styles for things like the Console Panel which uses styles from ACEeditor. As it is, I already tweak one line in the Tracy core which I mention in that PR thread. What didn't I want to do? Yeah, but the lead dev David also says "To allow to create skins for Tracy is not a bad idea.": https://github.com/nette/tracy/issues/27#issuecomment-39398635 I agree that looks much nicer, although I am not as concerned with the look of the bluescreen as I am with the debugbar and panels because I don't need to look at it that often - unless I am having a bad day I like this idea, although I think we might have better/quicker success with asking for making it skinnable - he has already expressed interest, and it should be hard to provide a way to load an alternate CSS file for the bluescreen.
    1 point
  21. Something about the way in which Nette operates tells me that they wouldn't accept the PR, especially due to a comment in that issue I linked to about it being non-relevant. <rant>In that thread, it is said that "Tracy has quite polished appearance", and I beg to differ. Apparently, it's also not supposed to look colourful. Red is a colour. And for some people, like myself, red is just far too vivid. Wish they'd learn something from the likes of filp/whoops.</rant>
    1 point
  22. Awesome - will have a look-see now. I'm sure I can whip something up.
    1 point
  23. I'm totally happy with the console as it is now usually I'm a fan of having everything in my IDE, but I just don't use the console that way... I'm not really against changing it to a file-based system - just stating that it is not necessary for me.
    1 point
  24. Wow fast answer! Thanks! After submitting it redirects But I also want it to redirect after someone forgot a field. I used the same code after the last flashmessage but it works partly. It redirects back but saves the form input only when all is filled out (except for the recaptcha ofcourse). If one required field is forgotten everything is blank again after redirecting. Any ideas for that? Thanks
    1 point
  25. @Mike Rockett That looks even better - having it as a popup would be good.
    1 point
  26. Thanks Steve. Certainly a great idea and worth discussing. Having had a look, I'd suggest that the Github API be used instead. This way, the release notes link can use a modal window to display the changelog. In my case, the body tag from the JSON response could be inserted. Not sure if the APIs for Bitbucket and Gitlab are easily accessible like Github's, but it's worth a shot.
    1 point
  27. Have been using Tracy for a while now, and recently got to thinking: would it be possible to override the exception template with something more PW friendly? Not a fan of the design at all as the red is just too much, and the exception heading text is just too big... Thoughts?
    1 point
  28. More thoughts... If I'm a person that prefers to edit my snippets in my code editor rather than the console window, and I have made changes to the current snippet using my editor that are not yet reflected in Console (because I haven't clicked "reload" or whatever), then when I do "Run" I would want my newer file version to execute rather than the older snippet visible in Console. Maybe when "Run" is triggered, Tracy could see if the file is newer than the last Console edit and if so run the file version and reload the snippet. This is getting complicated, right? Where I'm coming from is, I'm not worried about the code in Console and I don't even need to see it because I think I would always work with my snippet in my IDE. I'm just dreaming of a handy interface to run my snippets via the frontend. So maybe I need to explore this as a separate module, because Console already has a lot of happy users who like to write/edit/see their snippet in Console and perhaps my idea would be more disruptive than useful to them.
    1 point
  29. Recently I am fixing this issue, again, and I find this post in google. There's another solution that I found in the ListerPro forum before. The created, modified, publish date format can be changed via language translation. The language support module has to be installed in this case. Go to Setting > Language > choose the language you use > Click Find Files to Translate button > click /wire\modules\Process\ProcessPageLister\ProcessPageLister.module and submit > translate "rel" field(should be listed on top) to wanted format like Y-m-d Reference: https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/modules/Process/ProcessPageLister/ProcessPageLister.module#L238
    1 point
  30. @Robin S sorry, your code didn't work for me, I had to change it that way: // media_pagereference.php <?php namespace ProcessWire; if ($page->pageReference) { $refPage = $page->pageReference; $img = $refPage->getUnformatted('image')->first(); echo $img->url; } Now it's possible to set the configuration of the 'image' field to return a single element instead of an array. A second way next to the workaround I described above and a good opportunity to learn more about output formatting...
    1 point
  31. Hi @adrian, To date I haven't used the Console panel much, because I prefer to write API snippets in my IDE (API code completion, version control, and having the code saved to disk just feels safer than trusting storage to a module). But I like the way the Console panel shows a handy list of snippets that can be executed by authorised users only (normally just superuser). I see that the Console snippets are stored in the database as part of the module config data. What do you think about using a file for the saved snippets instead, with some scheme for labelling and delimiting the snippets within the file? Some benefits could be: Use an IDE / code editor to write snippets. Version control and file backups become possible. Easily share snippets between projects by copying the file or portions of it. No problems with exceeding the length limit of the config TEXT field in the database. Edit: might be easiest to use one file per snippet, if there's no great performance penalty to that.
    1 point
  32. @Missariella I needed to do this the other day: Instead of: $session->redirect($pages->get($contactPageID)->url); I used: // above form <div id="form-top"></div> // redirect to anchor tag after submit $session->redirect($pages->get($contactPageID)->url . "#form-top"); Works great, and no need for iframe
    1 point
×
×
  • Create New...