Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/30/2021 in all areas

  1. Adapting a post Ryan made in the Repeater Matrix support forum: In /site/templates/admin.php, before the line... require($config->paths->core . "admin.php"); ...add the following... if($page->process == 'ProcessPageEditImageSelect') { // The page ID that is open in Page Edit $edited_page_id = (int) $input->get->edit_page_id; // The page ID that contains the CKEditor field // This is where PW will look for images by default $cke_page_id = (int) $input->get->id; // If the edited page is not the same as the CKEditor page if($edited_page_id && $cke_page_id && $edited_page_id != $cke_page_id) { // Get the CKEditor page $cke_page = $pages->get($cke_page_id); // If the CKEditor page is a particular Repeater field page // Substitute the name of your Repeater template if($cke_page->template == 'repeater_your_repeater_template') { // Set the page ID where you want PW to look for images $input->get->id = $edited_page_id; } } }
    1 point
  2. Hi @Clarity - it should be a simple matter of using something like: 'showIf' = 'singleLanguageField=' in the array of settings for the AsmSelect field.
    1 point
  3. When using single quotes \n is not interpreted as newline character. Btw. GitHub issue was created.
    1 point
  4. You can already do that actually: https://processwire.com/modules/process-admin-actions/#populating-options-via-url-parameters Perhaps you could create a master action that uses a markup field to provide direct links to other actions with the get params in the URL?
    1 point
  5. Hey, @charger! I just faced the same problem recently. You can make it work like you expect by using single quotes like this: $out = __('It\'s time for you \nto get to the party.'); Though I would love to see it work with double quotes too)
    1 point
  6. Like I've got a resave action or some other action I need to run on a certain pages selected with, well, a selector field. The selector is the same, but each time I run it I need to re-enter it again and again. And I do run this for a couple of sets of options. That's where savable option sets or bookmarks would come handy.
    1 point
  7. @AndZyk, I don't think this is entirely accurate. Maybe things have changed since I last read the thread but below is the quote from @ryan with respect to his thoughts on a layout / page builder: https://processwire.com/talk/topic/25129-weekly-update-–-12-february-2021/ So, it is not a matter of lack of interest but more about 'lack of expertise', albeit with willingness to support it on the PHP (ProcessWire) side ?. By the way, I could have offered to take lead on this but until a certain module is released (getting very close now! ?), I don't have much time for anything else ?.
    1 point
  8. I don't think there is going to be an satisfying solution for this. Front-end editing is nifty for simple needs but there are many situations where it is a poor substitute for editing a page within the dedicated Page Edit environment in admin. I think dealing with empty fields might be one of those situations. The simplest thing would be just to train your editors to reload the page if they accidentally save an empty field. If you want to try other things, you'll have to approach it via Javascript because there isn't any hookable method in PageFrontEdit.module that will be useful here. You could give this a go: $('body').on('pw-reloaded', 'span[data-name="informations"] .pw-edit-copy', function() { if(!$(this).html().length) $(this).siblings('.pw-edit-orig').html('<p>No infos.</p>'); });
    1 point
  9. @SamC it's really as simple as that: https://processwire.com/blog/posts/new-ajax-driven-inputs-conditional-hooks-template-family-settings-and-more/#new-conditional-hooks Update 2022: $wire->addHookAfter('Pages::saved', function(HookEvent $event) { $page = $event->arguments('page'); bd('page saved'); bd($event, 'event'); bd($event->object, 'event->object'); bd($event->arguments(), 'event->arguments'); }); in the beginning it can be a little confusing when to use event->object, event->arguments and event->return but with the help of tracy you can quickly bring light into the dark: add the code above to the tracy console, set the radio on the right to load it on "ready" (same as placing the code in the site/ready.php file) and save any page: $event->arguments('page') is the same as using $event->arguments(0) that you will see very often and in the tracy dump you see that 0 is simply the key for the first argument in that hookevent. you can also collapse the "data" property of the hookevent and you would see the same: You can also use your IDE to quickly find what the HookEvent is returning/containing in which hook. Let's take the common saveReady hook as an example: We know that the hook is attached as Pages::saveReady (eg because we have read that somewhere) That means that the hook is part of the "Pages" class, which is located at "/wire/core/Pages.php" - that's easy to find out using CTRL+P in VSCode: Searching for "___saveReady" lets us find the corresponding method: Now we see, that we have ONE "arguments", being Page $page - this means $event->arguments(0) would return the page being ready for saving $event->object would be the class, here "Pages" $event->return is the return value of that method, here $data (line 1739) Edit: There's some additional explanations in this post: https://processwire.com/talk/topic/27248-pagestrashtemplatefoo-vs-pagestemplatefootrash/?do=findComment&comment=224659 #search afraid of hooks
    1 point
×
×
  • Create New...