-
Posts
11,204 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
Hi @Ivan Gretsky - I have implemented this - now both the modules settings and the Setup > AdminActions are split into "Site" and "Core" tabs. I haven't committed just yet. I will PM you the new version. Would appreciate it if you could test and let me know if it suits your needs and if you find any problems. Thanks!
-
OK, that doesn't really sound like a debug issue - I guess I am thrown off by the title of this thread. I think your best bet is probably to hook into InputfieldForm::processInput and then I think you'll want to check for $event->checkErrors() Sorry, not a very detailed / well checked answer, but I think that should get you going along the right path.
-
I really don't understand what you are trying to achieve with the publish button and missing fields, but I use Tracy for all my module development debugging Can you explain your needs a little more?
-
Have a differeent title on a field across multiple templates?
adrian replied to OpenBayou's topic in Getting Started
It's an old video, but shows you about template context field settings: https://processwire.com/videos/field-template-context/ -
The Console Panel now has a History stack and a separate Snippets stack! Hi everyone - this has been a long time coming. It was originally suggested by @bernhard back in early November. I want to thank @bernhard for the idea and feedback on draft versions, and @tpr who has contributed many ideas, style suggestions, and code to this functionality - sincere thanks to both of you! Snippets are automatically saved to the tracy config settings entry in the modules database table so that they are available on other browsers/computers have a dedicated save button - they are not saved automatically when running code save button only available when loaded snippet code is different from saved version so you know whether you have made changes has the ability to sort alphabetically or chronologically (date modified) no limit of number of snippets stored snippets can be deleted - a ✖ icon appears when you mouseover a snippet in the list History items are saved to local storage automatically saved when you "run" code comes with "Back" and "Forward" arrows for moving between history items currently stores maximum of 25 items - let me know if you think this needs adjusting Some other miscellaneous changes when running code, output is now appended to the results panel (like your browser dev console) you can used ALT/OPT+Enter keyboard shortcut to Clear and Run the "Clear" button now clears the results panel, but leaves the code intact Future ideas ability to easily export/import snippets to stack your ideas Please let me know if you come across any bugs or weirdness with anything - it's still pretty early stages!
-
https://blog.axosoft.com/2016/12/29/top-20-developer-tools-2016/ Might be some inspiration in there! I have been using Gitkracken for quite a while now - I am liking it quite a bit (although it's a little unstable at times). Postman looks pretty cool! PS Another longer list: https://stackshare.io/posts/top-developer-tools-2016
-
Ok, here's a screenshot showing the tooltip that indicates double-clicking the "Tracy" icon opens the module settings. Currently it opens the module settings in a different tab. I am not usually a fan of this, but in this case where we are using double-click and there is no way to user initiate a new tab, I think this is best for now. I'll commit along with the new console history/snippets stuff - hopefully shortly
-
They are already triggerable via the API: $options = array( 'field' => 99, 'sourcePage' => 1131, 'destinationPage' => 1132 ); $modules->get("ProcessAdminActions")->CopyFieldContentToOtherPage($options); I did think about separating into a core AdminActions.module and then have the ProcessAdminActions.module run on top of that, but went for the self-contained approach. Let me know if this doesn't suit your needs though and I can revisit separating them out.
-
@tpr - I happy to do that, but just wondering if you noticed the link to the settings from the first row of icons on the ProcessWire Info panel? Maybe you don't have that enabled by default?
-
Actually the link to Github from that post is out of date. This is the current version of the module for PW 3: https://github.com/horst-n/CroppableImage3 @horst - looks like there is something a little weird with the module directory: http://modules.processwire.com/modules/croppable-image3/ It is showing that the module hasn't been updated since September 2, 2016. Any ideas?
-
FieldtypeOptions - set selectable options through api
adrian replied to fbg13's topic in API & Templates
Have you tried like this: $options = "1=option1|Option 1\n2=option2|Option 2\n3=option3|Option 3"; BTW - I haven't tested this, just going on what is exported when exporting the field. -
You don't sound thrilled Do you have any other ideas / preferences? I could add support for pulling in a template stored in the file system, but I feel like that might be overkill for a simple email like this - I can't see it requiring very much structure/styling for a simple account registration email.
-
Hi @Timothy de Vos - I could simply support HTML in that email body field and have the email sent as HTML along with a plain text version (automatically generated from the HTML version). I think that would be the easiest approach. Would that suit your needs?
-
Thanks @Martijn Geerts - glad you're finding it useful - I appreciate the feedback! Hi @Ivan Gretsky - just to clarify - are you talking about simply separating the "core" actions in the module's "action" folder from those "site specific" ones in the /site/templates/AdminActions/ folder? I think tabs sounds like a good approach - I'll take a look at doing that. Also something else to consider is the tables filter feature of @tpr's awesome AOS module - that will make finding actions nicer once there are lots more, although to be honest sometimes I just like good old CTRL/CMD + F Just an FYI - if you don't want certain/any core actions available, you can remove the superuser role from those actions and they won't clog up your list of actions.
-
Hi @Harmen - how do you envision all the languages being formatted in the CSV - using a "|" or some other separator, or do you have some other approach in mind? Currently BCE only supports direct children of a page. I am not sure how to come up with a standardized approach for handling sub-pages/grandchildren in CSV format. Perhaps if you could explain (or provide an example) of how you'd like the CSV to look I could implement it, or you could provide a PR
-
My apologies - you are right I am actually in two minds about supporting this via the API - I wonder if perhaps it should be controlled by an additional module config setting so devs can decide if they want this or not. I feel like this is something you can do in the API yourself when you change the title? But maybe it would be easier if this module handled any required logic so you didn't have to think about?
-
Actually, it should work for saves via the API as well. At least it used too This save hook: https://github.com/adrianbj/PageRenameOptions/blob/12d18066b89a37fd9a7e05204599b09388bf6f82/PageRenameOptions.module#L117 should take care of it. Let me do a little investigating here.
-
Hi everyone, I have committed a new version that takes care of @Ivan Gretsky's issues with guest access for calling actions via the API. The new version also includes the ability to add actions to the Setup > Admin Actions submenu which could be really handy for quick access to key actions that you use regularly. At the moment you could add them all if you want, but perhaps in the future we'll have too many to make this usable, which is why I have made these configurable. See the new "In Menu" column:
-
You can read more about that here: https://processwire.com/api/selectors/#or-groups
-
In a rush, so no help on the selector, but here is the info on has_parent now supporting multiple values: https://processwire.com/blog/posts/processwire-core-and-profields-updates-2.5.22/#has_parent-selectors-now-support-multi-value
-
$child->Image->url;
-
[Solved] FormTemplateProcessor - Undefined variable: page
adrian replied to Fran's topic in API & Templates
Yes, that's true that you can't use $page inside a function, but the other thing here is that you already have wire('page') - there is no need to get the page from pages again, so this should be fine: $this->set('successMessage', '<h2 class="enviado-ok">' . wire('page')->mensaje_form_enviado .'</h2>'); -
Hi @Ivan Gretsky - ok, a new version has been committed that adds a new module config setting for determining whether database backups will be automatic, optional, or disabled. 1) Automatic - database backup will happen without user intervention. 2) Optional - adds a new checkbox at the bottom of every action's "options" form before the user clicks "Execute Action". 3) Disabled - this means no database backup will occur. If you do want to do a backup when calling an action via the API, simply add a new item to the options array: 'dbBackup' => true I am still working on figuring out the best approach for guest access. The biggest problem I see is that adding the "admin-actions" permission to the guest role means that any logged in user can now see the Setup > Admin Actions menu, even though they don't have permission to view or execute any of the actions. I have been playing around with adding a new helper module to handle the API calls, rather than calling the main ProcessAdminActions module directly, but there are a couple of inheritance issues I am not thrilled about, so looking into other options. Will hopefully have a good solution soon. Please let me know if the backup side of things handles your needs on that front.
-
Ah yes - I hadn't got that far yet - just noticed the weird conditional. The easiest option might be to just return the entire link/title as a string, rather than relying on the array key/value to create the link? Try this: function pedigreeParents($value) { if ($value->id) return '<a href="'.$value->url.'">'.$value->title.'</a>'; else return 'No Parent Defined'; } Note that I have changed the conditional. I would assume that your father and mother page fields are set for "single page", or at least they should be, so the approach for checking if there is an ID works well. You could even do something like this if you want separate "No Mother Defined" and "No Father Defined" entries where appropriate. function pedigreeParents($value, $parent) { if ($value->id) return '<a href="'.$value->$parent->url.'">'.$value->$parent->title.'</a>'; else return 'No '.$parent.' Defined'; } and call it like this: pedigreeParents($page->father, 'Father'); and: pedigreeParents($page->mother, 'Mother');
-
It's hard to tell what problem you are having with the table. Is it that in some cases "No Parent Defined" is being replaced with "Our Corgis"? I don't really understand this code: function pedigreeParentsLink($value) { if (count($value->title) > 0) return $value->url; else return $value->url; } Isn't this where you need to deal with no parent defined? Your conditional is returning the same result whether there is a title or not.