Jump to content

Robin S

Members
  • Posts

    5,039
  • Joined

  • Days Won

    340

Everything posted by Robin S

  1. @adrian, I'm seeing an error in the back-end AJAX bar after I save a page. Tracy v4.6.4
  2. I like
  3. I have just created a new page "Sponsors" under "Home": My question is, how does PW decide that it is going to place this new page between "Form Builder" and "Page Not Found"? Why not at the top or bottom of the existing pages? When I created "Monitoring" and "Groups" the situation was the same and I sorted them manually. This has been bugging me for a while, and I can't see what the rhyme or reason is. First thought was that "pages with system templates get sorted last", but that doesn't hold up because Form Builder uses a system template and Page Not Found does not. Edit: in case it's relevant, the "Tools", "Instructions" and "Form Builder" pages are pre-existing pages that are included in my custom site profile.
  4. Working perfectly, thanks.
  5. Wow, bumper update! Aside: I wonder which PW module has the highest version number? Tracy must be leading the field in terms of number of releases in any case. The Snippets panel is great - just what I was hoping for. Really handy having the keyboard shortcuts for run, and it's neat how the Run button gets focused after loading a snippet too. One thing though: would it possible to allow a namespace declaration inside snippets? I need that for IDE code completion but when I include it I get... Maybe Tracy could strip out any namespace declaration on the first line when it runs the snippet?
  6. Great post @Sephiroth! But this part... I'm not seeing how that code could be used to create a sitemap.
  7. @jannisl, @formulate, I can't reproduce the issue here (maybe it depends on what you have set in "HTML Options" on the Details tab of the CKEditor field settings), but if you are able to work out the steps for reproducing the problem could you please file a GitHub issue so it can be fixed in the core?
  8. Hi @adrian, Is it possible to include a File field in an action for this module? What I have in mind is uploading a CSV that is then parsed and used as data in the action. I saw that the Create Users action has a textarea field where you can paste data in CSV format so that is one alternative, but sometimes I think it would be easier to upload an existing CSV file. Ryan's ImportPagesCSV module makes use of a File field so I guess there is a way to use files temporarily in a Process module (I haven't looked into how). If Admin Actions doesn't already support this would you consider adding it? Also, I noticed a couple of issues while exploring the module. On install I get a PHP notice: And when I attempt to open the "Ftp Files To Page" action I get an error:
  9. That line that you weren't sure about is preventing the adding or removing of columns from the Users lister. I think you should be able to remove the else{} part because if there are no columns specified in the AOS config then you don't need to do anything to the Lister columns. Also, it would be a little more efficient not to even hook ProcessPageLister::execute when both column AsmSelects are empty in the AOS config... if ( in_array($subModule, $enabledSubmodules) && (!isset($_SERVER['HTTP_REFERER']) || strpos($_SERVER['HTTP_REFERER'], '?bookmark=') === false) && // No need for hook if no tweaks in config (!empty(self::$configData['ListerTweaks_find']) || !empty(self::$configData['ListerTweaks_users'])) ) { // ...
  10. You don't need to edit each template, and I don't think the permissions system is that hard once you understand that permissions can be inherited. Suppose you want your editor role to be able to edit, add and create children for all templates. You just edit the Home template, grant all the permissions to the editor role, and allow those permissions to be inherited. Now this applies to all pages using all templates, unless for a particular template you choose to "manage view and edit access permissions for pages using this template" and deliberately override the inherited permissions. I don't think it's right that the guest role doesn't need to be displayed anywhere. Revoking view access for the guest role in the template settings is how a page may be restricted to authorised roles only.
  11. Sure, this is done in v0.0.2 If you know of a Javascript library that can generate those sorts of passwords while still satisfying password field settings I'd be happy to integrate it. But I think memorising passwords is only a short hop away from reusing passwords, which is asking for trouble.
  12. Any of those options would be fine with me - personally I don't mind if it's not configurable and is just /site/templates/snippets/, but I suppose some might already be using a "snippets" folder for something like partials in which case they might want a configurable option.
  13. It looks fantastic, thanks! Could the shortcut keys for Run and Clear work here like they do in Console?
  14. 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
  15. 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.
  16. 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.
  17. This would remain the same under my proposal - the only difference is the way the snippets are saved and retrieved. Instead of reading from and writing to the DB, Tracy would read from and write to a file. You would still be free to modify a snippet in the console. As you say, code changes made in the Console get saved to file when the save icon is clicked (just like they are now to the DB). You're right that changes made to a file would require some kind of reload process in Console (ajax-powered, ideally). Depending on how snippets are loaded, this might only affect the currently visible snippet - if each snippet is a separate file I could imagine that on opening the Console window Tracy would initially just grab the filenames to build the snippet list, and only load a snippet's code from file to Console when a snippet is selected in the list. So changing a snippet that is not currently visible would not result in any sync issue. And for the currently visible snippet, I can't see sync being a big issue - users will tend to prefer either the Console or their code editor and will probably stick to using one or the other rather than both simultaneously (or if they do use both, they will become mindful of the implications of doing that ). Things like this wouldn't be necessary IMO.
  18. 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.
  19. For one reason or another, output formatting must be off when the PTE inputfield is rendered. To work around this, try... // media_pagereference.php <?php namespace ProcessWire; $refPage = $page->getFormatted('pageReference'); // value will vary depending on "Page field value type" setting if ($refPage->id) { $img = $refPage->image; echo $img->url; } ...or more reliably (since it will work regardless of the "Page field value type" setting)... // media_pagereference.php <?php namespace ProcessWire; $refPage = $page->getUnformatted('pageReference'); // always a PageArray if ($refPage->count) { $img = $refPage->first->image; echo $img->url; }
  20. You can't enter a Hanna tag via the "Insert link" modal because the href gets entity encoded. But you can use a Hanna tag for generating the whole link: // Hanna tag "year_link", with attributes "url" and "link_text" $year = $pages->get('/settings/')->year; $href = $url . $year; $text = $link_text ?: $href; echo "<a href='$href'>$text</a>"; Usage: Please fill out this [[year_link url="http://www.somewhere.com/form1/" link_text="form"]]
  21. First, I really like this admin theme! So what follows isn't meant to be a full picture of my reaction to it because overall I love it - just a few things that could use tweaking IMHO. Fonts Currently users will see completely different fonts depending on what OS they are using. The font-family rule is: font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif It's become popular lately to use system fonts like this (was it GitHub that started it?) but the problem is that the fonts in this stack are not very similar. It's one thing to fall back to Arial if Helvetica isn't available because they are so similar that the average audience won't be able to tell the difference. But San Francisco, Segoe UI, Roboto and Helvetica Neue are completely different typeface designs. So for instance there will be no consistency with x-height or position of type within the line-height box across platforms, so what looks pixel-perfect on MacOS might look sloppy on Windows or some other OS. If the desire is to move away from the bog-standard Helvetica/Arial then wouldn't it be better to bundle an open-source webfont kit with PW so there is reasonable consistency across platforms? From the blog post screenshot: From the demo site, Windows 8.1: Search box Like the current default admin theme search box styling, I think this is way too subtle: I have 20/20 vision and I can only barely make out the bounds of the search box - imagine what it's like for users with less-than-perfect vision. The search feature is hugely useful for quickly finding a page to edit in a deeply nested tree structure, so we want users to know that it exists. With the current admin default theme, most of my clients had never noticed the search box (until I boosted the contrast in some custom admin CSS). Tab metaphor For a tab metaphor to make sense there has to be some visual connection between the active tab and the content within that tab. Otherwise it isn't clear what content on the screen is controlled by the tab. On this screen... ...not knowing better, I would expect the tabs to control only the Title, Date and Headline fields. Body looks like it is outside of the tabbed content and so the expectation is that it remains on screen when switching to a different tab. Of course you learn how it works once you use it, but every time a thing works differently to how a user expects it to work there is a little bit of mental friction - a bit more effort required to understand it and a bit less satisfaction. I understand that there is a setting for controlling the border style of different fields (although it is disabled in the demo so I couldn't easily try it) - that's great. But I think the default style should be one that lends itself to the tabbed interfaces that are used throughout the PW admin (i.e. a visible border that connects to adjacent fields that are within the same tab). Breadcrumb separator Getting a little nit-picky here, but I think a guillemet › is a better breadcrumb separator than a slash /. The breadcrumb is supposed to indicate a hierarchy of pages. With the slash there is less sense that Posts is within Blog. It looks like a group of items that are all on the same level. Container width My preference is for some max-width to be set for pw-container (1600px maybe?). On my 2560px-wide monitor the interface becomes too wide for comfortable use. But that's an easy override for me to apply if there's no agreement on that.
  22. Not what was asked, but if you ever have a need to get all the field values and properties of the page in an array you can do this: $data = (array) $page->getIterator();
  23. GitHub issue opened here: https://github.com/processwire/processwire-issues/issues/399
×
×
  • Create New...