Jump to content

Robin S

Members
  • Posts

    4,928
  • Joined

  • Days Won

    321

Everything posted by Robin S

  1. 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.
  2. 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.
  3. 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.
  4. It looks fantastic, thanks! Could the shortcut keys for Run and Clear work here like they do in Console?
  5. 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
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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; }
  11. 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"]]
  12. 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.
  13. 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();
  14. GitHub issue opened here: https://github.com/processwire/processwire-issues/issues/399
  15. No, it doesn't search as a phrase but it does require all of the words to be present in the field, and does not match partial words. So if $q = "red dog" it will match "I have a dog and she loves red frisbees" but it won't match "I have three red dogs". When using the %= operator with multiple words, you will need to explode on spaces and foreach: $q = preg_replace("/\s+/", ' ', trim($q)); // trim and replace multiple spaces with single space $q_words = explode(' ', $q); $selector = "template=product, limit=10"; foreach($q_words as $q_word) { $selector .= ", title|subtitle|summary|body|product_isbn|authors.authors_name%=$q_word"; }
  16. @JoshoB, the problem is in the first line: $q = str_replace(' ', '|', $q); You are replacing the space character with the selector "or" operator, meaning wherever you use $q you will match fields with any of the words. So you want to remove that line. By the way, your way of matching the author title in the repeater is unnecessarily verbose. You can replace... authors=[authors_name=[title%=$q]] ...with... authors.authors_name%=$q ...because in a selector PW will try to match a string to a Page Reference's title by default. This selector should do what you want: $selector = "template=product, limit=10, title|subtitle|summary|body|product_isbn|authors.authors_name~=$q)";
  17. Cool stuff! The profiles you mention: are they a different format from the profiles produced by ProcessExportProfile? Just wondering because you said... ...but site profiles from ProcessExportProfile can include modules, so wasn't sure.
  18. @Ivan Gretsky, if you have Imagick installed you could use this function I wrote a while back for easy ImageMagick effects: It does quite a nice blur. But now that supporting IE is less of an issue you could also try a CSS filter.
  19. When debugging something like this (for a possible bug report) it's best to do it on a new PW installation on your localhost - you don't want to be messing with your actual project installation. It only takes a few minutes to do a fresh install for testing purposes.
  20. Still works for me... You're testing this with no other non-default modules installed apart from FieldsetPage?
  21. No problems here uploading images inside a FieldsetPage, whether the FieldsetPage is inside a FieldsetTab or not.
  22. @webhoes, I haven't used the Multisite module, but the readme you should have defined separate 404 pages for each domain. So this kind of setup is probably not compatible with Process404Search out-of-the-box. But based on this section of the readme... ...you should be able to get the correct links by modifying the search.php adrian refers to above: foreach($viewableMatches as $m) { $url = "{$input->scheme}://{$m->rootParent->name}/{$m->url}"; $content .= "<p><a href='$url'>$m->title</a></p>"; } Not tested. Also note that your page tree... ...is what the Multisite readme says not to do:
  23. I'm adapting a printed manual to an online document, and need to recreate tables like this:
×
×
  • Create New...