Jump to content

Recommended Posts

30 minutes ago, adrian said:

The thing is that I am not sure that I would always want it to auto-clear.

Yes, that's the hard part :) My vote goes also for the checkbox, though currently I'm fine with the auto-auto-clear.

  • Like 1
Link to post
Share on other sites

@adrian I'm not saying I can keep up with the pace of the module's development, but trying to... I skipped a few versions, but now I'm checking out the latest (2.7.2 - in sync with PW master, eh? :) ) and have two issues with the Template Resources panel:

#1 issue: when file compiling is on, I get:

Spoiler

Error: TemplateResourcesPanel
exception 'ErrorException' with message 'file_get_contents(.../mydomain/views/home_view.php): failed to open stream: No such file or directory' in .../mydomain/site/assets/cache/FileCompiler/site/modules/TracyDebugger/TemplateResourcesPanel.inc:96
Stack trace:
#0 [internal function]: Tracy\Bar->Tracy\{closure}(2, 'file_get_conten...', '/Users/guru/Doc...', 96, Array)
#1 .../mydomain/site/assets/cache/FileCompiler/site/modules/TracyDebugger/TemplateResourcesPanel.inc(96): file_get_contents('/Users/guru/Doc...')
#2 .../mydomain/site/assets/cache/FileCompiler/site/modules/TracyDebugger/TemplateResourcesPanel.inc(184): TemplateResourcesPanel->get_defined_functions_in_file('/Users/guru/Doc...')
#3 .../mydomain/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-master/src/Tracy/Bar.php(127): TemplateResourcesPanel->getPanel()
#4 .../mydomain/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-master/src/Tracy/Bar.php(81): Tracy\Bar->renderPanels()
#5 .../mydomain/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-master/src/Tracy/Debugger.php(266): Tracy\Bar->render()
#6 [internal function]: Tracy\Debugger::shutdownHandler()
#7 {main}

#2 issue: I have the following list of Included Files:

Spoiler

/site/templates/_init.php
/site/templates/helpers/helpers.php
/site/templates/helpers/excerpt.php
/site/templates/helpers/background_cover.php
/site/templates/helpers/pagination_options.php
/site/templates/home.php
/site/templates/views/home_view.php
/site/templates/_init.php
/site/templates/helpers/helpers.php
/site/templates/helpers/excerpt.php
/site/templates/helpers/background_cover.php
/site/templates/helpers/pagination_options.php
/site/templates/home.php
/site/templates/views/home_view.php
/site/templates/_main.php
/site/templates/partials/navigation.php
/site/templates/_init.php
/site/templates/helpers/helpers.php
/site/templates/helpers/excerpt.php
/site/templates/helpers/background_cover.php
/site/templates/helpers/pagination_options.php
/site/templates/home.php
/site/templates/views/home_view.php
/site/templates/_main.php
/site/templates/partials/navigation.php
/site/templates/partials/header_bag/facebook_og.php
/site/templates/_init.php
/site/templates/helpers/helpers.php
/site/templates/helpers/excerpt.php
/site/templates/helpers/background_cover.php
/site/templates/helpers/pagination_options.php
/site/templates/home.php
/site/templates/views/home_view.php
/site/templates/_main.php
/site/templates/partials/navigation.php
/site/templates/partials/header_bag/facebook_og.php
/site/templates/partials/header_bag/twitter_card.php
/site/templates/_init.php
/site/templates/helpers/helpers.php
/site/templates/helpers/excerpt.php
/site/templates/helpers/background_cover.php
/site/templates/helpers/pagination_options.php
/site/templates/home.php
/site/templates/views/home_view.php
/site/templates/_main.php
/site/templates/partials/navigation.php
/site/templates/partials/header_bag/facebook_og.php
/site/templates/partials/header_bag/twitter_card.php
/site/templates/partials/header_bag/ld_json.php
/site/templates/_init.php
/site/templates/helpers/helpers.php
/site/templates/helpers/excerpt.php
/site/templates/helpers/background_cover.php
/site/templates/helpers/pagination_options.php
/site/templates/home.php
/site/templates/views/home_view.php
/site/templates/_main.php
/site/templates/partials/navigation.php
/site/templates/partials/header_bag/facebook_og.php
/site/templates/partials/header_bag/twitter_card.php
/site/templates/partials/header_bag/ld_json.php
/site/templates/views/default_view.php
/site/templates/partials/scripts.php
/site/templates/_init.php
/site/templates/helpers/helpers.php
/site/templates/helpers/excerpt.php
/site/templates/helpers/background_cover.php
/site/templates/helpers/pagination_options.php
/site/templates/home.php
/site/templates/views/home_view.php
/site/templates/_main.php
/site/templates/partials/navigation.php
/site/templates/partials/header_bag/facebook_og.php
/site/templates/partials/header_bag/twitter_card.php
/site/templates/partials/header_bag/ld_json.php
/site/templates/views/default_view.php
/site/templates/partials/scripts.php
/site/templates/_init.php
/site/templates/helpers/helpers.php
/site/templates/helpers/excerpt.php
/site/templates/helpers/background_cover.php
/site/templates/helpers/pagination_options.php
/site/templates/home.php
/site/templates/views/home_view.php
/site/templates/_main.php
/site/templates/partials/navigation.php
/site/templates/partials/header_bag/facebook_og.php
/site/templates/partials/header_bag/twitter_card.php
/site/templates/partials/header_bag/ld_json.php
/site/templates/views/default_view.php
/site/templates/partials/scripts.php

As you can see, files are listed more than once, a lot of them 8 times, but at least 3 times if I'm not mistaken. I use wireRenderFile() to render partials of the page but simple include_once is used too.

  • Like 1
Link to post
Share on other sites
22 hours ago, tpr said:

Auto-clearing of the Dumps Recorder could be achieved on client-side on each page load:


    $(window).on('unload', function () {
        if ($('a[rel="tracy-debug-panel-DumpsRecorderPanel"]').length && window.Tracy && Tracy.Debug.panels['tracy-debug-panel-DumpsRecorderPanel']) {
            var BRPanel = Tracy.Debug.panels['tracy-debug-panel-DumpsRecorderPanel'];
            // init only if it's not initialized
            if (!$('#tracyDumpEntries').length) {
                BRPanel.init();
            }
            if (window.clearDumps) {
                clearDumps();
            }
        }
    });

Note that I haven't tested this thoroughly but I guess it's safe to use. Maybe there's also a more efficient/nicer way to do this.

Edit: if you use 'beforeunload' event instead 'unload' then you can also see the panel clearing.

Edit2: fixed the code above: init only if required

Hey @tpr - just looking at this in more detail now. I hadn't thought of triggering this client-side, but I think it might make sense - is your thought that it's probably the easiest way to prevent a clear from being called during a PHP redirect or AJAX call? This way it has to be due to a page change or reload?

I think that makes sense, but a couple of problems I have noticed:

  1. It actually only works reliably for me using beforeunload - I think Chrome doesn't accept unload
  2. It uses jQuery, but I want to make Tracy vanilla js only because we can't be sure that jQuery is loaded on the frontend

Nice work of figuring out the need to init the panel if it wasn't ever opened, but I think I have a much easier solution all around which is as simple as:

window.onbeforeunload = function() {
      document.cookie = "tracyClearDumpItems=true;expires=0;path=/";
};

Setting that cookie is actually the key part of the clearDumps() function - with that set, the dumps are removed from the session variable. There is no need to call the entire clearDumps() function because we don't need to remove the dump content from the DOM of the panel instantly - we can rely on the PHP code to do it on the next page load.

Does that make sense to you?

Link to post
Share on other sites

Yes, my intention was to make the clear as simple as possible & you wrote that it's hard to do in backend if I remember right.

Your code seems nice, will try it when on PC.

  • Like 1
Link to post
Share on other sites

Ok, thanks to some testing and tweaks from @tpr, the Dumps Recorder now has a "Preserve Dumps" checkbox. When checked, dumps will be preserved until the session is closed. With it unchecked, they will be automatically cleared on page unload. This means it will store all consecutive ajax called dumps, and any dumps during php page redirects (which would be lost with the normal core Tracy dumps panel), but not burden the panel with lots of data unless you specify. The "Clear Dumps" button is there if you want to have a clear slate while testing ajax calls without needing to reload the page to clear.

Let me know if you find any problems or have suggestions for improvements and don't forget to like @tpr's original post suggesting this option.  

Screen Shot 2016-08-24 at 8.26.00 AM.png

  • Like 3
Link to post
Share on other sites

Curious what you guys think of making the Dumps Recorder panel enabled by default when installing Tracy?

I don't think there are any real disadvantages and it overcomes an issue where users may wonder why the core dumps panel doesn't show their bd() calls (multiple ajax requests, php redirects etc).

Any thoughts?

Actually on this topic, are there any strong feelings in general about the default list of panels?

Link to post
Share on other sites

Hi @adrian

The Template Resources panel has started to grow fast, so I thought just before it outgrows my notebook's screen, I present a couple of suggestions:

  1. Returns and Class columns can be merged. After all, the info "Object" is redundant.
  2. Long string like a body's HTML code takes up a lot of space in the Value Column. Can you introduce AJAX only loading of such values? Or it can be made collapsable just like arrays/objects. That way initially the column would be narrow when arrays and objects are not expanded. 
  3. It would be nice to have a "collapse/expand all toggle" for arrays/objects.
  4. What if columns can be turned on/off? At least the "Files/Lines" column. It could initially be in its closed state. This is what is used the least, I suppose.
  5. BTW, how about highlighting variables used in one template only and only once? It can help us spot variables no longer used or the developer might want to eliminate such variables by using expressions instead.
  6. How about jump links at the top to sections of the panel (to variables, constants, functions, included files)?
  7. The first two lines could be merged into one paragraph (These are all the... If you are looking...) to save some more space.
  8. "Panel generated in 183.67 ms Panel content size: 1.1 MB" could also be merged into one line and could be placed at the top, so no need to scroll down...

Hope you find these suggestions useful.

The following is just a screenshot to show what it currently looks like on my machine.

template resources screenshot 2016-08-24.png

Edited by szabesz
typo
  • Like 1
Link to post
Share on other sites

Thanks @szabesz for your input on this - definitely some good ideas.

A couple of quick comments/questions:

  • Could you PM me the html from that panel - I'd like to see why it is so large. I can already see that I am not getting the array of ML titles - it is still returning an object, but based on the size, I am guessing there are some other objects also in the Value column.
  • Rather than jumplinks to sections, would you be ok with collapsed sections, like the PW Info panel?
  • I like the idea of highlighting variables only used once - it was something I had also been thinking about. Looking at your $authors variable - is that actually one of those things that should be highlighted - is it really just defined there and never actually used, or is it used twice on that line, or there a problem with my detection of it only being used on that one line?
  • "It would be nice to have a "collapse/expand all toggle" for arrays/objects" - what arrays/objects don't have this already? I thought it should be all.
  • Not sure about making strings collapsible - this is a core Tracy feature I am using to make arrays/objects collapsible. You can set the length of the string in the config settings though (default is 150) - does that help?
  • Also not sure about turning columns on/off - does the width of the panel matter that much, or is it more the height that important?

Also curious what others think of the recent additions to this panel - is it getting to be too complicated? I haven't tested with complex pages with lots of template defined vars, so maybe it does need some refining - seeing your 1.1MB is not a good sign, but I think that can be dealt with so long as I convert all objects to arrays of the relevant properties/values rather than the full object.

  • Like 1
Link to post
Share on other sites

@adrian

  • "Could you PM me the html from that panel": I can, however, how about installing https://github.com/NinjasCL/pw-ghost by @clsource ? This is what I'm refactoring to my needs currently. My version is still very similar to his, so you can use it for testing.
  • "collapsed sections": fiddling with collapsing is slow, I think simple links are more efficient.
  • "$authors" is never used (it is in the original profile too, I have not yet removed it) I do not know if the detection fails or not sometimes, I have not yet spent too much time checking the results of it.
  • "collapse/expand all toggle": sorry for my confusing words. I was talking about one toggle button to collapse/expand all at once. Initially all of them are closed, right? I do not seem to remember... :)
  • "You can set the length of the string in the config settings though (default is 150) - does that help?": more or less. It is informative to see 150. I will experiment with it. I'm just trying to save space somehow :)
  • "...turning columns on/off - does the width of the panel matter that much...": the width. We have nearly reached the width of my Air's screen/viewport (1440px). By turning on/off I actually meant hide/unhide.
Link to post
Share on other sites
1 hour ago, adrian said:

users may wonder why the core dumps panel doesn't show their bd() calls (multiple ajax requests, php redirects etc).

If you enable it by default, you might want to remove the the core version altogether, so there will be no confusion at all. We have something more advanced, no need for the plain version, I suppose.

Link to post
Share on other sites
38 minutes ago, szabesz said:

config settings though (default is 150) - does that help?": more or less. It is informative to see 150. I will experiment with it. I'm just trying to save space somehow :)

I have changed it, and it does not make a difference. I mean I always get 150 characters, even if I set it to something else.

Another issue it the column content of the string. On this page it gets really wide (last colum can hardly be seen):

template resources screenshot 2016-08-24-B.png

And thanks to Apple's decision to hide scrollbars by default, I often do not even notice that a window's content can be scrolled. That is my own grief, however, I just wanted to mention that on a Mac it can be even more confusing when the table is cut off right before the last column.

Edited by szabesz
typo
  • Like 1
Link to post
Share on other sites
6 minutes ago, szabesz said:

I have changed it, and it does not make a difference. I mean I always get 150 characters, even if I set it to something else.

Thanks - looks like I forgot to pass the length and depth settings to the dump method. I'll sort that out in the next version. The depth should actually make a huge difference to the size of the panel.

7 minutes ago, szabesz said:

Another issue it the column content of the string. On this page it gets really wide (last colum can hardly be seen):

I'll see what I can do about that - looks like I need to force it to wrap.

 

8 minutes ago, szabesz said:

And thanks to Apple's decision to hide scrollbars by default

Tell me about it - sometimes they try to simplify to the point of losing functionality!

  • Like 1
Link to post
Share on other sites
7 minutes ago, adrian said:
16 minutes ago, szabesz said:

And thanks to Apple's decision to hide scrollbars by default

Tell me about it - sometimes they try to simplify to the point of losing functionality!

I have just turned this default behavior off. I do not know why I haven't done so earlier.

As for the other issues: thanks for striving for perfection. We are in the same boat :P

Edited by szabesz
"I do not know why I haven't done so earlier." Now I know! The UI looks quite ugly this way :(
  • Like 1
Link to post
Share on other sites
On 8/23/2016 at 1:52 AM, bernhard said:

hey adrian,

what do you think of a panel to switch off certain modules. like the panel selector but not for panels but modules. so you could switch off modules during development to make sure it is not related to that module...

no idea how hard that would be - just wanted to share the idea and hear your thoughts :)

This panel has been added to the latest version!

Just like the core module disable option, it is only available in PW's advanced mode and only for autoload modules.

Please don't use this on a live site - it's not a problem with this panel, but rather the core module disable flag. It can break your site quite easily with some modules. For example, disabling the ProcessWireUpgradeCheck module results in a fatal error and the only way to fix is to manually remove the disable flag in the database. I am not sure whether Ryan might be able to fix (https://github.com/ryancramerdesign/ProcessWire/issues/1990) this in the core, or in the ProcessWireUpgradeCheck module itself, but it's definitely a good indicator that you need to be careful and savvy to be able to fix things if they go wrong!

Still, hopefully you will find it useful - it is certainly a lot easier than going through all your modules in the admin and disabling them there.

Let me know how it works out for you.

Screen Shot 2016-08-25 at 3.40.15 PM.png

  • Like 3
Link to post
Share on other sites

The latest version has several tweaks, and one potentially valuable new config setting. The debug mode panel has the option to NOT show the debug tools when debug mode is off. This might be nice on a production site where you have forced superuser into development mode - you still like having the reminder to confirm that debug mode is actually off, but you don't want all the tools displayed - it is potentially a big performance improvement on some servers. 

Screen Shot 2016-08-25 at 10.09.23 PM.png

  • Like 1
Link to post
Share on other sites

I like the module disabler, thanks! In my module I implemented an enable/disable toggle, and I think it would be a nice thing if such feature would be in all modules (in pw core). This would allow toggling a module state easily, if the developer has implemented this feature. Currently one has to uninstall a module but doing so will remove module settings so if you reinstall later you have to configure again. WP has such feature and I often miss this from PW.

  • Like 2
Link to post
Share on other sites

Thanks Adrian for the new panel!

8 hours ago, adrian said:

It can break your site quite easily with some modules. For example, disabling the ProcessWireUpgradeCheck module

This one sounds "scary". At least, a real pita situation can emerge out of the blue, so I was wondering if we could be somehow warned about potential issues. At least a general note, but in case of known issues (such as this ProcessWireUpgradeCheck) it should be somehow marked, or even removed from the list if it is no use disabling it.

One more thing I've been thinking of it recently but this new panel has reminded me to mention it: There are so many panels already that it would be nice to have some sort of short description of them in the module's Settings. Maybe the simple (asm)select is not the one that fits the bill anymore, but something else that supports accompanying labels/tooltips. This addition would be especially great for newcomers.

Edited by szabesz
First, I posted a half-a-reply by mistake somehow, maybe by pressing ENTER + something else? Arghh, how much I hate such features....
  • Like 1
Link to post
Share on other sites
On 8/26/2016 at 0:07 AM, szabesz said:

This one sounds "scary". At least, a real pita situation can emerge out of the blue, so I was wondering if we could be somehow warned about potential issues. At least a general note, but in case of known issues (such as this ProcessWireUpgradeCheck) it should be somehow marked, or even removed from the list if it is no use disabling it.

Yeah, it can be a real PITA. I am not too worried at the moment as the functionality requires PW's advanced mode and I am hoping Ryan might have some solution to that issue I posted. This panel is not adding new functionality - it's really just making it easier to disable lots of modules at once / in the once place. If Ryan has no solution, then I might consider removing modules from the list that have know issues (like the ProcessWireUpgradeCheck one).

On 8/26/2016 at 0:07 AM, szabesz said:

One more thing I've been thinking of it recently but this new panel has reminded me to mention it: There are so many panels already that it would be nice to have some sort of short description of them in the module's Settings. Maybe the simple (asm)select is not the one that fits the bill anymore, but something else that supports accompanying labels/tooltips. This addition would be especially great for newcomers.

Agreed - I'll start thinking about this.

  • Like 2
Link to post
Share on other sites
3 hours ago, adrian said:

I am not too worried at the moment as the functionality required PW's advanced mode and I am hoping Ryan might have some solution to that issue I posted. This panel is not adding new functionality - it's really just making it easier to disable lots of modules at once / in the once place. If Ryan has no solution, then I might consider removing modules from the list that have know issues (like the ProcessWireUpgradeCheck one).

I have just looked up the forum to learn more about Advanced Mode, which is recommended to be turned off, so for folks like me this new panel is not really something I might ever use if one can easily run into unwanted situations (which might easily happen without a deeper understanding of ProcessWire, at least that is what I have gathered).

Something like @tpr suggested above could be a lot more helpful, being a safer alternative to this current approach. I mean, I can see that this panel can be useful too sometimes, but for folks like me (who is not a hard core ProcessWire developer), it seems to be out of reach, so to speak.

Thanks for the panel anyway! Even if it's not for me, I have at least learnt a few things about ProcessWire's Advanced Mode :)

Link to post
Share on other sites

Working on this module is starting to become a full time job!

 

2 hours ago, szabesz said:

Something like @tpr suggested above could be a lot more helpful, being a safer alternative to this current approach.

Unfortunately I don't think it's a simple as that for some modules - for example you can't simply disable a fieldtype without wreaking havoc. I still think this panel is useful - I am just hoping Ryan can sort out that issue which I think is related to just those modules using a separate config file (like ProcesswireUpgradeCheck).

 

On 8/24/2016 at 10:09 AM, szabesz said:

BTW, how about highlighting variables used in one template only and only once? It can help us spot variables no longer used or the developer might want to eliminate such variables by using expressions instead.

This has just been implemented in the latest version. This is Just a first attempt - any variable that is only used once is highlighted with the orange warning color.

Screen Shot 2016-08-26 at 10.40.19 AM.png

 

Other significant changes in the latest version.

  • Fixed a problem with the Validator plugin that was introduced 4 days ago by a new requirement (the user_agent needs to be supplied in the post request) from validator.nu (https://github.com/validator/validator/commit/a6afb4f34402bce421df5102de313ec76295a55f#diff-5f739a043bdc345584b06cb39a7679aaR259)
     
  • Make it easy to pass maxDepth and maxLength options to bd() calls. This can be very handy when you have a deep array or very long string that you need to see more of without changing the defaults of maxDepth:3 and MaxLength:150 which can cause problems with PW objects if you go too high.
    bd($myArr, 'My Array', array('maxDepth' => 7, 'maxLength' => 0));

    Note that setting to '0' means no limit.

 

I also I just wanted to note how useful the "Preserve Dumps" checkbox in the Dumps Recorder panel is - lots of times when doing module development in particular I found that bd() calls weren't showing up - I think it often has to do with the redirects or the call being made before the panel is ready or something. Now with this feature, even if it doesn't show initially, just reload the page and it will be there!

  • Like 3
Link to post
Share on other sites
31 minutes ago, adrian said:

Unfortunately I don't think it's a simple as that for some modules - for example you can't simply disable a fieldtype without wreaking havoc. I still think this panel is useful - I am just hoping Ryan can sort out that issue which I think is related to just those modules using a separate config file (like ProcesswireUpgradeCheck).

Ok, thanks, I get it. I'm with you :) This topic is bit too advanced for me anyway, I was just trying to figure out how to handle this...

34 minutes ago, adrian said:

I also I just wanted to note how useful the "Preserve Dumps" checkbox in the Dumps Recorder panel is

So a big praise to @tpr for the idea, and to you too, of course :D

  • Like 1
Link to post
Share on other sites
38 minutes ago, adrian said:

Working on this module is starting to become a full time job!

 

I was thinking of this too. It is incredible what you have achived so far. You might want to charge for the module in the future. How about a light and a pro version? But psst! It wasn't me who gave you the idea :P

  • Like 1
Link to post
Share on other sites
  • adrian pinned and locked this topic
  • adrian unpinned and pinned this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By FireWire
      Hello community!

      I want to share a new module I've been working on that I think could be a big boost for multi-language ProcessWire sites.

      Some background, I was looking for a way for our company website to be efficiently translated as working with human translators was pretty laborious and a lack of updating content created a divergence between languages. I, and several other devs here, have talked about translation integrations and have recognized the power that DeepL has. DeepL is an AI deep learning powered service that delivers translation quality beyond any automated service available. After access to the API was opened up to the US, I built Fluency, a DeepL translation integration for ProcessWire.
      Fluency brings automated translation to every multi-language field in the admin, and also provides a translation tool allowing the user to translate their text to any language without it being inside a template's field. With Fluency you can:
      Translate any plain textarea or text input Translate any CKEditor content (yes, with markup) Translate page names for fully localized URLs on every page Translate your in-template translation function wrapped strings Translate modules Fluency is free, and now so is DeepL
      Since this module was first built DeepL has introduced free Developer accounts that allow anyone to start using Fluency at zero cost and beginning with the version 0.3.0 release Fluency now supports free DeepL accounts. As of June 2021 DeepL supports translation to 26 languages and continues to offer more!
      Installation and usage is completely plug and play. Whether you're building a new multi-language site, need to update a site to multi-language, or simply want to stop manually translating a site and make any language a one-click deal, it could not be easier to do it. Fluency works by having you match the languages configured in ProcessWIre to DeepL's. You can have your site translating to any or all of the languages DeepL translates to in minutes (quite literally).
      Let's break out the screenshots...
      When the default language tab is shown, a message is displayed to let users know that translation is available. Clicking on each tab shows a link that says "Translate from English". Clicking it shows an animated overlay with the word "Translating..." cycling through each language and a light gradient shift. Have a CKEditor field? All good. Fluency will translated it and use DeepL's ability to translate text within HTML tags. CKEditor fields can be translated as easily and accurately as text/textarea fields.

      Repeaters and AJAX created fields also have translation enabled thanks to a JavaScript MutationObserver that searches for multi-language fields and adds translation as they're inserted into the DOM. If there's a multi-language field on the page, it will have translation added.

      Same goes for image description fields. Multi-language SEO friendly images are good to go.

      Creating a new page from one of your templates? Translate your title, and also translate your page name for native language URLs. (Not available for Russian, Chinese, or Japanese languages due to URL limitations). These can be changed in the "Settings" tab for any page as well so whether you're translating new pages or existing pages, you control the URLs everywhere.

      Language configuration pages are no different. Translate the names of your languages and search for both Site Translation Files (including all of your modules)

      Translate all of the static text in your templates as well. Notice that the placeholders are retained. DeepL is pretty good at recognizing and keeping non-translatable strings like that. If it is changed, it's easy to fix manually.

      Fluency adds a "Translate" item to the CMS header. When clicked this opens up a modal with a full translation tool that lets the user translate any language to any language. No need to leave the admin if you need to translate content from a secondary language back to the default ProcessWire language. There is also a button to get the current API usage statistics. DeepL account owners can set billing limitations via character count to control costs. This may help larger sites or sites being retrofitted keep an eye on their usage. Fluency can be used by users having roles given the fluency-translate permission.

      It couldn't be easier to add Fluency to your new or existing website. Simply add your API key and you're shown what languages are currently available for translation from/to as provided by DeepL. This list and all configuration options are taken live from the API so when DeepL releases new languages you can add them to your site without any work. No module updates, just an easy configuration. Just match the language you configured in ProcessWire to the DeepL language you want it to be associated with and you're done. Fluency also allows you to create a list of words/phrases that will not be translated which can prevent items such as brands and company names from being translated when they shouldn't

       
      Limitations:
      No "translate page" - Translating multiple fields can be done by clicking multiple translation links on multiple fields at once but engineering a "one click page translate" is not feasible from a user experience standpoint. The time it takes to translate one field can be a second or two, but cumulatively that may take much longer (CKEditor fields are slower than plain text fields). There may be a workaround in the future but it isn't currently on the roadmap. No "translate site" - Same thing goes for translating an entire website at once. It would be great, but it would be a very intense process and take a very (very) long time. There may be a workaround in the future but it isn't on the roadmap. No current support for Inline CKEditor fields - Handling for CKEditor on-demand hasn't been implemented yet, this is planned for a future release though and can be done. I just forgot about it because I've never really used that feature personally.. Alpha release - This module is in alpha. Releases should be stable and usable, but there may be edge case issues. Test the module thoroughly and please report any bugs via a Github issue on the repository or respond here. Please note that the browser plugin for Grammarly conflicts with Fluency (as it does with many web applications). To address this issue it is recommended that you disable Grammarly when using Fluency, or open the admin to edit pages in a private window where Grammarly may not be loaded. This is an issue that may not have a resolution as creating a workaround may not be possible. If you have insight as to how this may be solved please visit the Github page and file a bugfix ticket.
      Requirements:
      ProcessWire  3.0+ UIKit Admin Theme That's Fluency in a nutshell. A core effort in this module is to create it so that there is nothing DeepL related hard-coded in that would require updating it when DeepL offers new languages. I would like this to be a future-friendly module that doesn't require developer work to keep it up-to-date.
      The Module Is Free
      This is my first real module and I want to give it back to the community as thanks. This is the best CMS I've worked with (thank you Ryan & contributors) and a great community (thank you dear reader).
      DeepL Developer Accounts
      In addition to paid Pro Developer accounts, DeepL now offers no-cost free accounts. Now all ProcessWire developers and users can use Fluency at no cost.
      Learn more about free and paid accounts by visiting the DeepL website. Sign up for a Developer account, get an API key, and start using Fluency today.
      Download & Feedback
      Download the latest version here
      https://github.com/SkyLundy/Fluency-Translation/archive/main.zip
      Github repository:
      https://github.com/SkyLundy/Fluency-Translation
      File issues and feature requests here (your feedback and testing is greatly appreciated):
      https://github.com/SkyLundy/Fluency-Translation/issues
       
      Thank you! ¡Gracias! Ich danke Ihnen! Merci! Obrigado! Grazie! Dank u wel! Dziękuję! Спасибо! ありがとうございます! 谢谢你!

    • By monollonom
      (once again I was surprised to see a work of mine pop up in the newsletter, this time without even listing the module on PW modules website 😅. Thx @teppo !)
      Github: https://github.com/romaincazier/FieldtypeQRCode
      Modules directory: https://processwire.com/modules/fieldtype-qrcode/
      This is a simple module I made so a client could quickly grab a QR Code of the page's url in the admin.
      There's not much to it for now, but if need be you can output anything using a hook:
      $wire->addHookAfter("FieldtypeQRCode::getQRText", function($event) { $event->return = "Your custom text"; }) You can also output the QR code on your front-end by calling the field:
      echo $page->qr_code_field; The module uses the PHP library QR Code Generator by Kazuhiko Arase. When looking for a way to generate a QR Code in PW I came across @ryan's integration in his TFA module. I'm not very familiar with fieldtype/inputfield module development so I blindly followed @bernhard (great) tutorial and his BaseFieldtypeRuntime. At some point I'll take a deeper look to make a module on my own.
      Some ideas for improvements :
      add the ability to choose what to ouput : page's url / editUrl / file(s) / image(s) / ... allow to output multiple QR codes ?
    • By Chris Bennett
      https://github.com/chrisbennett-Bene/AdminThemeTweaker
      Inspired by @bernhard's excellent work on the new customisable LESS CSS getting rolled into the core soon, I thought I would offer up the module for beta testing, if it is of interest to anyone.

      It takes a different approach to admin styling, basically using the Cascade part of CSS to over-ride default UiKit values.
      Values are stored in ModuleConfig Module creates a separate AdminThemeTweaker Folder at root, so it can link to AdminThemeTweaker.php as CSS AdminThemeTweaker.php reads the module values, constructs the CSS variables then includes the CSS framework Can be switched on and off with a click. Uninstall removes everything, thanks to bernhard's wonderful remove dir & contents function.
      It won't touch your core. It won't care if stuff is upgraded. You won't need to compile anything and you don't need to touch CSS unless you want to.

      It won't do much at all apart from read some values from your module config, work out the right CSS variables to use (auto contrast based on selected backgrounds) and throw it on your screen.
      You can configure a lot of stuff, leave it as it comes (dark and curvy), change two main colors (background and content background) or delve deep to configure custom margins, height of mastheads, and all manner of silly stuff I never use.

      Have been developing it for somewhere around 2 years now. It has been (and will continue to be) constantly tweaked over that time, as I click on something and find something else to do.
      That said, it is pretty solid and has been in constant use as my sole Admin styling option for all of those 2 years.

      If nothing else, it would be great if it can provide any assistance to @bernhard or other contributor's who may be looking to solve some of the quirkier UiKit behavior.
      Has (in my opinion) more robust and predictable handling of hidden Inputfields, data-colwidths and showIf wrappers.
      I am very keen to help out with that stuff in any way I can, though LESS (and any css frameworks/tools basically) are not my go.
      I love CSS variables and banging-rocks-together, no-dependency CSS you can write with notepad.



       

    • By opalepatrick
      I see old posts saying that repeaters are not the way to go in Custom Process Modules. If that is the case, when using forms (as I am trying to do) how would one tackle things like repeat contact fields where there can be multiple requirements for contact details with different parameters? (Like point of contact, director, etc) or even telephone numbers that have different uses?
      Just for background I am creating a process module that allows me to create types of financial applications in the admin area (no need to publish any of this, pure admin) that require a lot of personal or company information.
      Maybe I am thinking about this incorrectly?
    • By HMCB
      I ran across a reference to IftRunner module. The post was 6 years ago. I cant find it in available modules. Has it been pulled?
×
×
  • Create New...