Jump to content
adrian

Tracy Debugger

Recommended Posts

Im sorry if my question was already answered somewhere, but there is 25 pages to read and i can`t find it. 

Here is my config of Tracy:

screencapture-biotestlab-dev-admin-module-edit-1473236927321.png

screencapture-biotestlab-dev-admin-module-edit-1473237316826.png

I work on localhost. Debug mode is set to false, I am logged out from admin panel, but Tracy is still showing on frontend.

I can`t figurate out is it normal behavior for Tracy, because earlier, if Im not mistaken, with the same options it was not showing? 

Im using latest Tracy version and PW 3.0.30.

 

 

Share this post


Link to post
Share on other sites

@Zeka How about unchecking "Frontend" in "Debug Bar and Panels > Show Debug Bar"?

Edited by szabesz
spelling
  • Like 1

Share this post


Link to post
Share on other sites

@szabesz Yes, of course, if I uncheck to show in frontend it will be not shown, but i was thinking that if debug is set to false and Im not logged in as superuser it should be not shown. 

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, Juergen said:

Tracy makes problems during updates of modules if it is in strict mode (show warnings as errors), because there are several warnings of the PW core files. I use it in strict mode and I always have to disable Tracy Debugger if I want to update a module. Otherwise the module will not be updated if I skip the warning. So it would be a nice addition if you add an enable/disable link for Tracy Debugger at the bottom like AdminOnSteroids module (see image below). This makes the workflow much easier.

Ok, I'll see what I can do. Obviously a disable link like AOS has would only be available when you're in the admin, but if the only problem you are having is module updating, then that is probably ok. I had actually been thinking about a "Disable Once" button available from the debug bar that would prevent Tracy from being loaded on the next page load, but I don't think this would handle your situation anyway because module updating involves a few page loads. One thing though - if you are getting warnings from PW core files - have you reported these as issues on Github? 

 

8 hours ago, szabesz said:

As opposed to AOS, we can enable Tracy for both frontend and admin, so the disable feature would be nice to have on its main panel too, which I have already missed a few times.

Sorry, what is the "main panel" you are referring to? Do you mean the debug bar, or the panel selector panel? Do you have any specific ideas for how best to provide a disable feature?

 

6 hours ago, Zeka said:

@szabesz Yes, of course, if I uncheck to show in frontend it will be not shown, but i was thinking that if debug is set to false and Im not logged in as superuser it should be not shown. 

You have noticed something that I have been considering changing. It was meant as a feature, but I wonder if it's more of a confusion. Basically the logic is that if you are in DETECT mode and Tracy also determines that you are on a localhost, then it will display the debug bar regardless of whether you are logged in or not. If you switch to DEVELOPMENT or PRODUCTION mode, it will behave the same as a live server. I was trying to make it easy to have the debug bar available to test things when not logged in, but now that Tracy has the User Switcher panel, we don't really need this, because we can use the User Switcher to change to a non-superuser (or even logout) and still have access to the debug bar for the length of the user switcher session. Do you (or anyone else) have any thoughts on the best scenario here?

Share this post


Link to post
Share on other sites
22 minutes ago, adrian said:

"Disable Once" button available from the debug

This one and a permanent disable feature is what I'm voting for. 

23 minutes ago, adrian said:

what is the "main panel" you are referring to?

 I mean the "System Info", since this is the one that cannot be turned off. "Disable Once" and "Disable Permanently" would do, I suppose.

  • Like 1

Share this post


Link to post
Share on other sites

Ok, the latest version has a new disable/enable option.

I added the Disable button  to the bottom of the Panel Selector because I think most of you have that enabled all the time. Please let me know if that won't work for some of you and I can rethink @szabesz's suggestion for adding it to the System Info panel. I would have done that straight away, but that is a Tracy core panel, so I would have to add with JS. The main problem is that panels are lazy rendered, so the DOM for panels is not available until the first time they are loaded. Still do-able, but requires a little more effort.

Screen Shot 2016-09-07 at 1.03.14 PM.png

The Enabler button is simply a red bug icon (like the one I am using for Tracy in the site modules list). It appears at the bottom right of the page when you have disabled Tracy. It only appears on frontend and backend if the debug bar is enabled for those locations.

Note that this disabler doesn't actually uncheck the "Enable Tracy Debugger" checkbox in the settings - it's just disabled with a cookie. I am happy to revisit this approach, but my reasoning was that I'd rather the settings checkbox had a little more power, so that if it's unchecked there, the enable icon won't actually appear at the bottom right of your site.

Anyway, hope this helpful and don't be shy if you think I have messed it up by doing it this way :) 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

I decided to add a dedicated "Tracy Toggler" panel. Well it's actually just a button :) - you can see it second from the end:

Screen Shot 2016-09-07 at 3.21.27 PM.png

and when it's disabled, this is all you see at the bottom right of your site:

Screen Shot 2016-09-07 at 3.23.04 PM.png

I left the "Disable Tracy" button in the Panel Selector because I figured some users may prefer that approach - it's your choice.

  • Like 3

Share this post


Link to post
Share on other sites

Thanks again Adrian! One issue with the Panel selector: we have "too many panels" :P On one hand this is awesome, on the other hand we are running out of space:

Spoiler

toooo-tall-tracy-panel-selector.png

And this is with a set of css rules that do not override the small line height + small font size. I also used "css frameworks" which blew it up and it took a lot more space than this. Since you added "Disable Tracy" to the bottom, we've lost valuable space.

It's ok if you do not want to hack the System Info panel, I "had the feeling" it might not be supported to add anything to it, so that is out of the question. However, this panel should be laid out in a horizontal manner as much us possible, so that to make room for the other panels you are going to add in the near future :D:D :P

Jokes aside, you might want to logically group panels in the list (you know I'm talking about @tpr's AOS-settings-like groupping) so that they can be found more easily. And this is true for the admin's setting, where a similar groupping can help too (we've already touched this topic).

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for your thoughts as usual. I keep for forgetting about your screen real estate limitations. My laptop is 1680 x 1050 and my last one was actually 1920 x 1080 (from 2003) so I forget that people have smaller resolution to work with.

4 minutes ago, szabesz said:

I also used "css frameworks" which blew it up and it took a lot more space than this. Since you added "Disable Tracy" to the bottom, we've lost valuable space.

I thought I took care of this recently - are you still seeing this problem? There are lots of things that I need to override but it takes time to come across them all. Please let me know whenever you find a CSS attribute that I have missed.

10 minutes ago, szabesz said:

Jokes aside, you might want to logically group panels in the list (you know I'm talking about @tpr's AOS-settings-like groupping) so that they can be found more easily. And this is true for the admin's setting, where a similar groupping can help too (we've already touched this topic).

What would the logical groupings be? I just made them in alphabetical order which I thought would be simplest. I agree that the admin settings could be improved. I'll admit I don't have @tpr's flare for that though :) 

  • Like 1

Share this post


Link to post
Share on other sites

Well at first using CSS3 column-count could be handy for the panel list here. Eg. 2 columns, then the panel would be more than 2 times wider.

You could also use CSS "all: initial;" to reset all styling - of course then you will have to re-style everything.

1 minute ago, adrian said:

I'll admit I don't have @tpr's flare for that though :) 

Better saying you have more important things to do than beautify the admin :)

  • Like 2

Share this post


Link to post
Share on other sites

@tpr - columns for the panel selector does sound like a decent idea.

The Tracy core CSS is a bit of a pain - I already have to make one core hack because of the way they have things set up. I am actually using all: initial in one place already, but not everywhere. Maybe I'll revisit using it more.

3 minutes ago, tpr said:

Better saying you have more important things to do than beautify the admin :)

That's always been my thought too, but when I see what you have done with AOS I second guess that decision :)

  • Like 1

Share this post


Link to post
Share on other sites
16 minutes ago, adrian said:

What would the logical groupings be?

Good question... To tell the truth, I've lost track of the features the module has to offer and only use a small set of panels, so I'm not the one who could answer this easily, but they could be grouped by functionality if it is possible.

19 minutes ago, adrian said:

are you still seeing this problem?

No, I had this issue some time ago, but not recently. I will investigate and report should I see it again.

Share this post


Link to post
Share on other sites

Looks more usable to me. I see some room for improvements, eg.

  • move the Toggle All to the panels list as first item (plus make it bold to add some weight). I think no need to pull it to left as now.
  • Disable Tracy could go to the far right, in the same row as the 3 other buttons (Once, Sticky, Reset)
  • the top legend below the main title ("Temporarily enable/disable...) could go into one row, separated by eg. this: " • ", or float the second line to right

Plus when Tracy is disabled, its icon's position overlaps with the scrollbar (when AOS is active). Using "right: 10px" seems too small, around 20-24px this could be eliminated.

  • Like 2

Share this post


Link to post
Share on other sites
17 minutes ago, adrian said:

Is this better?

Definitely! Thank you. I think it also helped a lot in being able to more easily find the panel one needs to spot, the alphabetical order might be the one to keep, and probably there is no need for "arbitrary" grouping (at least I was not able to suggest groups, because of the diversity of the functions the panels represent).

  • Like 1

Share this post


Link to post
Share on other sites

Tweaked, although I still like the "Toggle All" out on its own. I have also cleaned up the time/size values at the bottom of all panels - very simple now with no superfluous text.

Screen Shot 2016-09-08 at 11.49.12 AM.png

 

  • Like 2

Share this post


Link to post
Share on other sites

@adrian quick question - is it possible have Tracy active only for only select users, or limit by IP?
The current behavior is that tracy is active for all logged in users, unless you specify the IP but the IP only prevents non superadmins, seems to be always active for all superadmins..

Share this post


Link to post
Share on other sites
On 7.9.2016 at 5:42 PM, adrian said:

Ok, I'll see what I can do. Obviously a disable link like AOS has would only be available when you're in the admin, but if the only problem you are having is module updating, then that is probably ok. I had actually been thinking about a "Disable Once" button available from the debug bar that would prevent Tracy from being loaded on the next page load, but I don't think this would handle your situation anyway because module updating involves a few page loads. One thing though - if you are getting warnings from PW core files - have you reported these as issues on Github?

Yes I have reported it on Github: https://github.com/ryancramerdesign/ProcessWire/issues/2031

Best regards

  • Like 2

Share this post


Link to post
Share on other sites
9 minutes ago, Juergen said:

Which one is the recommended repo to report issues currently? ryancramerdesign/ProcessWire or processwire/processwire ? Do we have a guideline to choose between the two? I do not remember seeing one.

Share this post


Link to post
Share on other sites
Quote

To get things started, I've pushed ProcessWire 3.0.33 RC1 to this new organization account in the new ProcessWire repository. This is our way of testing things out. You'll see the same version posted on the devns branch of our old repository, so it doesn't matter where you download it from. But once 3.x is our new official version, then this new repository is where you'll want to get it from.

so i _guess_ it does not really matter until that date. but i would choose the new one right from now...

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, Macrura said:

@adrian quick question - is it possible have Tracy active only for only select users, or limit by IP?
The current behavior is that tracy is active for all logged in users, unless you specify the IP but the IP only prevents non superadmins, seems to be always active for all superadmins..

A little confused here, although I think you might be seeing what @Zeka noted above: https://processwire.com/talk/topic/12208-tracy-debugger/?do=findComment&comment=127543

If you are in DETECT mode and on local host then the debug bar is active for everyone, even guest users. Is that what you are seeing? If it is, please see my response here: https://processwire.com/talk/topic/12208-tracy-debugger/?do=findComment&comment=127589

If not, then it might be something I need to investigate in which case it would be great to have some more details.

 

Share this post


Link to post
Share on other sites

Actually in response to Macrura's question I want to clarify some things - Tracy active vs the debug bar visible vs Production/Development are all different things.

Once installed, Tracy is always active. Even unchecking "Enabled" loads some files - these files handle your bd(), d(), fl(), l(), da() calls so that non Tracy users / guests won't get undefined function errors in case you have some of those calls in your live code.

In Production mode Tracy is fully loaded to handle all errors, but it doesn't display those errors or the debug bar - it logs the errors and can email you of an error (if you have the settings configured with your email address and "Allow Logging in Production Mode" checked.

In Development mode (either set or determined from Detect mode), errors and the debug bar are displayed (although the debug bar can be hidden from front/backend based on those checkboxes). 

It can be all a bit confusing which is why I am contemplating removing the Detect mode option and maybe even making the "Output Mode" panel one of the defaults when Tracy is installed. 

If anyone has any thoughts on improved behavior, I am all ears!

  • Like 1

Share this post


Link to post
Share on other sites

I do like (and use solely) the Detect Mode being on, so I'm against of removing it even tough I also see that it can lead to confusion. Tracy has so many options to choose from in a diversity of areas that it has become quite a challenge to familiarize ourselves with it anyway. However, I do not think getting rid of functionality is the way to go, although probably it is the easiest solution sometimes, so it is you who needs to decide in the long run.

15 minutes ago, adrian said:

Even unchecking "Enabled" loads some files

So we might be able to clear things up a bit by using different terms, not enable/disable.

What if we come up with some flowchart like setup-help, something like this:

Spoiler

h5d-sectioning-flowchart.png

I use yEd to draw things like that and would be happy to do its first version if you think it might help. (You could even build a "setup wizard" based on it, but that might be overkill and a lot of work.)

Or, we can just make a table like chart to summarize the various states and results of the settings, something like this "Value of variable" chart in this post:

https://www.virendrachandak.com/techtalk/php-isset-vs-empty-vs-is_null/

  • Like 1

Share this post


Link to post
Share on other sites

@szabesz - thank you for the offer of putting together a flow chart. It might prove useful, but I am honestly wondering whether the fact that we are even discussing the need for a flowchart means that I have failed - if something is complicated enough that we need a flowchart, I get the feeling it needs be to simplified.

20 minutes ago, szabesz said:

I do like (and use solely) the Detect Mode being on

Thanks for your thoughts on this - maybe I should at least remove the "show the debugbar to everyone when Detect determines localhost" behavior - that seems to be a confusion.

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, adrian said:

at least remove the "show the debugbar to everyone when Detect determines localhost" behavior - that seems to be a confusion.

Well, I know this idea will be against simplifying things, but what if this behavior can be turned on optionally, so it is not completely removed?

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By horst
      Wire Mail SMTP

      An extension to the (new) WireMail base class that uses SMTP-transport

      This module integrates EmailMessage, SMTP and SASL php-libraries from Manuel Lemos into ProcessWire. I use this continously evolved libraries for about 10 years now and there was never a reason or occasion not to do so. I use it nearly every day in my office for automated composing and sending personalized messages with attachments, requests for Disposition Notifications, etc. Also I have used it for sending personalized Bulkmails many times.

      The WireMailSmtp module extends the new email-related WireMail base class introduced in ProcessWire 2.4.1 (while this writing, the dev-branch only).
       
      Here are Ryans announcement.



      Current Version 0.4.1
      Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md
      get it from the Modules Directory Install and Configure

      Download the module into your site/modules/ directory and install it.

      In the config page you fill in settings for the SMTP server and optionaly the (default) sender, like email address, name and signature.
      You can test the smtp settings directly there. If it says "SUCCESS! SMTP settings appear to work correctly." you are ready to start using it in templates, modules or bootstrap scripts.


      Usage Examples
      The simplest way to use it:
      $numSent = wireMail($to, $from, $subject, $textBody); $numSent = wireMail($to, '', $subject, $textBody); // or with a default sender emailaddress on config page This will send a plain text message to each recipient.
       
      You may also use the object oriented style:
      $mail = wireMail(); // calling an empty wireMail() returns a wireMail object $mail->to($toEmail, $toName); $mail->from = $yourEmailaddress; // if you don't have set a default sender in config // or if you want to override that $mail->subject($subject); $mail->body($textBody); $numSent = $mail->send(); Or chained, like everywhere in ProcessWire:
      $mail = wireMail(); $numSent = $mail->to($toEmail)->subject($subject)->body($textBody)->send(); Additionaly to the basics there are more options available with WireMailSmtp. The main difference compared to the WireMail BaseClass is the sendSingle option. With it you can set only one To-Recipient but additional CC-Recipients.
      $mail = wireMail(); $mail->sendSingle(true)->to($toEmail, $toName)->cc(array('person1@example.com', 'person2@example.com', 'person3@example.com')); $numSent = $mail->subject($subject)->body($textBody)->send(); The same as function call with options array:
      $options = array( 'sendSingle' => true, 'cc' => array('person1@example.com', 'person2@example.com', 'person3@example.com') ); $numSent = wireMail($to, '', $subject, $textBody, $options); There are methods to your disposal to check if you have the right WireMail-Class and if the SMTP-settings are working:
      $mail = wireMail(); if($mail->className != 'WireMailSmtp') { // Uups, wrong WireMail-Class: do something to inform the user and quit echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; return; } if(!$mail->testConnection()) { // Connection not working: echo "<p>Couldn't connect to the SMTP server. Please check the {$mail->className} modules config settings!</p>"; return; } Following are a ...


      List of all options and features


      testConnection () - returns true on success, false on failures


      sendSingle ( true | false ) - default is false

      sendBulk ( true | false ) - default is false, Set this to true if you have lots of recipients (50+)


      to ($recipients) - one emailaddress or array with multiple emailaddresses

      cc ($recipients) - only available with mode sendSingle, one emailaddress or array with multiple emailaddresses

      bcc ($recipients) - one emailaddress or array with multiple emailaddresses

       
      from = 'person@example.com' - emailaddress, can be set in module config (called Sender Emailaddress) but it can be overwritten here

      fromName = 'Name Surname' - optional, can be set in module config (called Sender Name) but it can be overwritten here


      priority (3) - 1 = Highest | 2 = High | 3 = Normal | 4 = Low | 5 = Lowest

      dispositionNotification () or notification () - request a Disposition Notification


      subject ($subject) - subject of the message

      body ($textBody) - use this one alone to create and send plainText emailmessages

      bodyHTML ($htmlBody) - use this to create a Multipart Alternative Emailmessage (containing a HTML-Part and a Plaintext-Part as fallback)

      addSignature ( true | false ) - the default-behave is selectable in config screen, this can be overridden here
      (only available if a signature is defined in the config screen)

      attachment ($filename, $alternativeBasename = "") - add attachment file, optionally alternative basename


      send () - send the message(s) and return number of successful sent messages


      getResult () - returns a dump (array) with all recipients (to, cc, bcc) and settings you have selected with the message, the message subject and body, and lists of successfull addresses and failed addresses,


      logActivity ($logmessage) - you may log success if you want

      logError ($logmessage) - you may log warnings, too. - Errors are logged automaticaly
       
       
      useSentLog (true | false) - intended for usage with e.g. third party newsletter modules - tells the send() method to make usage of the sentLog-methods - the following three sentLog methods are hookable, e.g. if you don't want log into files you may provide your own storage, or add additional functionality here

      sentLogReset ()  - starts a new LogSession - Best usage would be interactively once when setting up a new Newsletter

      sentLogGet ()  - is called automaticly within the send() method - returns an array containing all previously used emailaddresses

      sentLogAdd ($emailaddress)  - is called automaticly within the send() method
       
      Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md
       
      LATEST UPDATE:
       
    • By ukyo
      Mystique Module for ProcessWire CMS/CMF
      Github repo : https://github.com/trk/Mystique
      Mystique module allow you to create dynamic fields and store dynamic fields data on database by using a config file.
      Requirements
      ProcessWire 3.0 or newer PHP 7.0 or newer FieldtypeMystique InputfieldMystique Installation
      Install the module from the modules directory:
      Via Composer:
      composer require trk/mystique Via git clone:
      cd your-processwire-project-folder/ cd site/modules/ git clone https://github.com/trk/Mystique.git Module in live reaction with your Mystique config file
      This mean if you remove a field from your config file, field will be removed from edit screen. As you see on youtube video.
      Using Mystique with your module or use different configs path, autoload need to be true for modules
      Default configs path is site/templates/configs/, and your config file name need to start with Mystique. and need to end with .php extension.
      // Add your custom path inside ready or init function, didn't tested outside Mystique::add('your-configs-path'); All config files need to return a php array like examples.
      Same as ProcessWire Inputfield Api, only difference is set and showIf usage
      <?php namespace ProcessWire; /** * Resource : testing-mystique */ return [ 'title' => __('Testing Mystique'), 'fields' => [ 'text_field' => [ 'label' => __('You can use short named types'), 'description' => __('In file showIf working like example'), 'notes' => __('Also you can use $input->set() method'), 'type' => 'text', 'showIf' => [ 'another_text' => "=''" ], 'set' => [ 'showCount' => InputfieldText::showCountChars, 'maxlength' => 255 ], 'attr' => [ 'attr-foo' => 'bar', 'attr-bar' => 'foo' ] ], 'another_text' => [ 'label' => __('Another text field (default type is text)') ] ] ]; Example:
      site/templates/configs/Mystique.seo-fields.php <?php namespace ProcessWire; /** * Resource : seo-fields */ return [ 'title' => __('Seo fields'), 'fields' => [ 'window_title' => [ 'label' => __('Window title'), 'type' => Mystique::TEXT, // or InputfieldText 'useLanguages' => true, 'attr' => [ 'placeholder' => __('Enter a window title') ] ], 'navigation_title' => [ 'label' => __('Navigation title'), 'type' => Mystique::TEXT, // or InputfieldText 'useLanguages' => true, 'showIf' => [ 'window_title' => "!=''" ], 'attr' => [ 'placeholder' => __('Enter a navigation title') ] ], 'description' => [ 'label' => __('Description for search engines'), 'type' => Mystique::TEXTAREA, 'useLanguages' => true ], 'page_tpye' => [ 'label' => __('Type'), 'type' => Mystique::SELECT, 'options' => [ 'basic' => __('Basic page'), 'gallery' => __('Gallery'), 'blog' => __('Blog') ] ], 'show_on_nav' => [ 'label' => __('Display this page on navigation'), 'type' => Mystique::CHECKBOX ] ] ]; Searching data on Mystique field is limited. Because, Mystique saving data to database in json format. When you make search for Mystique field, operator not important. Operator will be changed with %= operator.
      Search example
      $navigationPages = pages()->find('my_mystique_field.show_on_nav=1'); $navigationPages = pages()->find('my_mystique_field.page_tpye=gallery');
    • By Robin S
      File Info
      A textformatter module for ProcessWire. The module can add information to local Pagefile links in two ways:
      As extra markup before, within or after the link As data attributes on the link (handy if you want to use a Javascript tooltip library, for instance) Screenshots
      Module config

      Example of output

      Installation
      Install the File Info module.
      Add the textformatter to one or more CKEditor fields.
      Configuration
      Add markup action (and general)
      Select "Add markup to links" Select the Pagefile attributes that will be retrieved. The attribute "filesizeStrCustom" is similar to the core "filesizeStr" attribute but allows for setting a custom number of decimal places. If you select the "modified" or "created" attributes then you can define a date format for the value. Enter a class string to add to the links if needed. Define the markup that will be added to the links. Surround Pagefile attribute names in {brackets}. Attributes must be selected in the "Pagefile attributes" section in order to be available in the added markup. If you want include a space character at the start or end of the markup then you'll need >= PW 3.0.128. Select where the markup should be added: prepended or appended within the link, before the link, or after the link. Add data attributes action
      Select "Add data attributes to links" Select the Pagefile attributes that will be retrieved. These attributes will be added to the file links as data attributes. Attributes with camelcase names will be converted to data attribute names that are all lowercase, i.e. filesizeStrCustom becomes data-filesizestrcustom. Hook
      If you want to customise or add to the attributes that are retrieved from the Pagefile you can hook TextformatterFileInfo::getFileAttributes(). For example:
      $wire->addHookAfter('TextformatterFileInfo::getFileAttributes', function(HookEvent $event) { $pagefile = $event->arguments(0); $page = $event->arguments(1); $field = $event->arguments(2); $attributes = $event->return; // Add a new attribute $attributes['sizeNote'] = $pagefile->filesize > 10000000 ? 'This file is pretty big' : 'This file is not so big'; $event->return = $attributes; });  
      https://github.com/Toutouwai/TextformatterFileInfo
      https://modules.processwire.com/modules/textformatter-file-info/
    • By Robin S
      Access By Query String
      Grant/deny access to pages according to query string.
      Allows visitors to view protected pages by accessing the page via a special URL containing an "access" GET variable. This allows you to provide a link to selected individuals while keeping the page(s) non-viewable to the public and search engines. The recipients of the link do not need to log in so it's very convenient for them.
      The view protection does not provide a high level of security so should only be used for non-critical scenarios. The purpose of the module was to prevent new websites being publicly accessible before they are officially launched, hence the default message in the module config. But it could be used for selected pages on existing websites also.
      Once a visitor has successfully accessed a protected page via the GET variable then they can view any other page protected by the same access rule without needing the GET variable for that browsing session.
      Superusers are not affected by the module.
      Usage
      Install the Access By Query String module.
      Define access rules in the format [GET variable]??[selector], one per line.
      As an example the rule...
      rumpelstiltskin??template=skills, title~=gold ...means that any pages using the "skills" template with the word "gold" in the title will not be viewable unless it is accessed with ?access=rumpelstiltskin in the URL. So you could provide a view link like https://domain.com/skills/spin-straw-into-gold/?access=rumpelstiltskin to selected individuals.
      Or you could limit view access to the whole frontend with a rule like...
      4fU4ns7ZWXar??template!=admin You can choose what happens when a protected page is visited without the required GET variable:
      Replace the rendered markup Throw a 404 exception If replacing the rendered markup you can define a meta title and message to be shown. Or if you want to use more advanced markup you can hook AccessByQueryString::replacementMarkup().
      $wire->addHookAfter('AccessByQueryString::replacementMarkup', function(HookEvent $event) { // Some info in hook arguments if needed... // The page that the visitor is trying to access $page = $event->arguments(0); // An array of access keys that apply to the page $access_keys = $event->arguments(1); // The title $title = $event->arguments(2); // The message $message = $event->arguments(3); // Return some markup $event->return = 'Your markup'; }); Screenshot

       
      https://github.com/Toutouwai/AccessByQueryString
      https://modules.processwire.com/modules/access-by-query-string/
    • By David Karich
      ProcessWire InputfieldRepeaterMatrixDuplicate
      Thanks to the great ProModule "RepeaterMatrix" I have the possibility to create complex repeater items. With it I have created a quite powerful page builder. Many different content modules, with many more possible design options. The RepeaterMatrix module supports the cloning of items, but only within the same page. Now I often have the case that very design-intensive pages and items are created. If you want to use a content module on a different page (e.g. in the same design), you have to rebuild each item manually every time.
      This module extends the commercial ProModule "RepeaterMatrix" by the function to duplicate repeater items from one page to another page. The condition is that the target field is the same matrix field from which the item is duplicated. This module is currently understood as proof of concept. There are a few limitations that need to be considered. The intention of the module is that this functionality is integrated into the core of RepeaterMatrix and does not require an extra module.
      Check out the screencast
      What the module can do
      Duplicate a repeater item from one page to another No matter how complex the item is Full support for file and image fields Multilingual support Support of Min and Max settings Live synchronization of clipboard between multiple browser tabs. Copy an item and simply switch the browser tab to the target page and you will immediately see the past button Support of multiple RepeaterMatrix fields on one page Configurable which roles and fields are excluded Duplicated items are automatically pasted to the end of the target field and set to hidden status so that changes are not directly published Automatic clipboard update when other items are picked Automatically removes old clipboard data if it is not pasted within 6 hours Delete clipboard itself by clicking the selected item again Benefit: unbelievably fast workflow and content replication What the module can't do
      Before an item can be duplicated in its current version, the source page must be saved. This means that if you make changes to an item and copy this, the old saved state will be duplicated Dynamic loading is currently not possible. Means no AJAX. When pasting, the target page is saved completely No support for nested repeater items. Currently only first level items can be duplicated. Means a repeater field in a repeater field cannot be duplicated. Workaround: simply duplicate the parent item Dynamic reloading and adding of repeater items cannot be registered. Several interfaces and events from the core are missing. The initialization occurs only once after the page load event Changelog
      1.0.4
      Bug fix: Various bug fixes and improvements in live synchronization Bug fix: Items are no longer inserted when the normal save button is clicked. Only when the past button is explicitly clicked Feature: Support of multiple repeater fields in one page Feature: Support of repeater Min/Max settings Feature: Configurable roles and fields Enhancement: Improved clipboard management Enhancement: Documentation improvement Enhancement: Corrected few typos #1 1.0.3
      Feature: Live synchronization Enhancement: Load the module only in the backend Enhancement: Documentation improvement 1.0.2
      Bug fix: Various bug fixes and improvements in JS functions Enhancement: Documentation improvement Enhancement: Corrected few typos 1.0.1
      Bug fix: Various bug fixes and improvements in the duplication process 1.0.0
      Initial release Support this module
      If this module is useful for you, I am very thankful for your small donation: Donate 5,- Euro (via PayPal – or an amount of your choice. Thank you!)
      Download this module
      > Github: https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDuplicate
      > PW module directory: – soon –
×
×
  • Create New...