-
Posts
7,473 -
Joined
-
Last visited
-
Days Won
144
Everything posted by kongondo
-
Best way to speed up queries pages find [SOLVED]
kongondo replied to Leftfield's topic in General Support
Depends on what 'lots of pages' amount to. Assuming you know the IDs beforehand, one way you could do it. <?php namespace ProcessWire; $ids = [1100,1101,1102,1103]; $selector = implode("|",$ids); $fields = ['id','title'];// depends on the fields you want; 'id' can also be left out in which case you get it as the key of each item $items = $pages->findRaw($selector,$fields);// Array // or if you need the pages // $items = $pages->find("id={$ids}");// PageArray Another way would be to cache the menu, if it is not dynamic.. Just a few thoughts. -
Hi @ryan, does this have an impact on init.php and ready.php? For instance, will init.php still not be aware of the current page? Can $pages->request()->getPage() inside a template file be a replacement for ready.php? Thanks for the awesome updates!
-
Or do this... Or one of these... (includes the extension @adrian mentioned above)...
-
Hmmm. You've just given me an idea right there ?.
-
@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 ?.
-
@JacobParks. I have moved your 'non-serious' thread to the appropriate forum for it. I must say that your first post seems like a primer for spam. I hope I am wrong, in which case, please accept my apologies. We do take spam very seriously.
- 1 reply
-
- 1
-
Wow. I didn't even know this module existed ?. I have just had a quick look so cannot comment much. You should be able to create your own version of the module which ProcessWire will subsequently detect and ask which one to load (I think this applies to Process Modules too - anyone?). Maybe a hook would work too, but am not sure. Looks like the links are created in JavaScript, so, you would need to consider that too. Maybe your solution could be all at the JavaScript level, although in that case you would need access to the value for your data-attributes. Sorry I am not of much help. Just a few starter thoughts ?.
-
Not an answer to your question, sorry. Just wondering what is this link edition? Thank.
-
Is there a particular reason why you need to use config->js() for this? In a template file, the following should work just fine: <?php namespace ProcessWire; $mydata = ['foo' => 'bar', 'bar' => 123]; $script = "<script>const mySettings = " . json_encode($mydata) . ';</script>'; echo $script; // OR: $content.= $script; if using delayed output with automatic inclusion of _main.php, for example. In the console...
-
Typically two choices if you want a custom 'view' in the admin. If custom view per page, i.e. as some sort of field / inputfield: have a look at the growing number of runtime markup fields in the module's directory A dedicated admin page view: You will need to create a custom module. More specifically, regarding data, and lots of it or spreadsheet-like data, have a look at @bernhard's modules and work in the forum. Looks like he has done extensive work in this respect. I am in a bit of a rush so cannot be more concrete. Hope this helps you get started.
-
Hi @CarlAllen, First, congratulations on your upcoming marriage. Wishing you every success in that and your move to the Netherlands. The board you have posted in is meant for job postings, i.e. people looking to hire posting about available jobs and their requirements. As such, I will have to move your post to a different forum for general talk. In addition, I would suggest you post your interest and/or resume in dedicated job portals as it seems your requirements are not necessarily specific to ProcessWire. In any case, I wish you the very best of luck for the future.
- 1 reply
-
- 1
-
Yes I noticed this as well, especially with respect to Python. I almost glossed over it thinking it was a Python-only tech ?.
-
Thanks for responding @ryan. No, the error was triggering later, on line 41, at the JSON.parse(). I just found it strange that removing the class .InputfieldPage made the error go away. No, I didn't try this. Next time. That's what I was thinking at first. However, if I added multiple fields, it would reload the first one OK then trip on the next one. Yeah, me too! ?.
-
Image field always outputs an array when using ajax
kongondo replied to neonwired's topic in General Support
Output formatting is off when in ajax mode... -
I have got this sorted, but I don't think it will help you @AndZyk. In my case, after adding fields to an inputfield (similar to a repeater), I was manually reloading a pagefield inputfield that uses InputfieldTextTags like this: $myInputfieldTextTagsSelectItem.trigger("reloaded") That was throwing up the JavaScript error I posted above. My remedy was to let ProcessWire Inputfields trigger the reload, like this: // @note: reload() is a method in Inputfields.js Inputfields.reload($myInputfieldTextTagsSelectItem) Error gone! ?
-
How to add drop down menu in the backend with icons
kongondo replied to DrQuincy's topic in General Support
I did, only like a a hundred times ?. Maybe I was refreshing the wrong site! I'll give this a go. Thanks for sharing! And the pointers as well. -
I have managed to find the code that is causing the issue. In InputfieldTextTags.js, at the end of the file, the css class '.InputfieldPage' was added, changing the code from this (GitHub 3.0.183 ) // InputfieldTextTags.js ProcessWire 3.0.183 jQuery(document).ready(function($) { InputfieldTextTags(); $(document).on('reloaded', '.InputfieldTextTags', function() { InputfieldTextTags($(this)); }); }); to this (GitHub 3.0.184 ) // InputfieldTextTags.js ProcessWire 3.0.184 jQuery(document).ready(function($) { InputfieldTextTags(); $(document).on('reloaded', '.InputfieldTextTags, .InputfieldPage', function() { // <= '.InputfieldPage' addition causing error(?) InputfieldTextTags($(this)); }); }); I have no solution at the moment ?.
-
Just confirming that for me, the issue is not present in 3.0.183. Will now try to narrow it down to changed files in 3.0184.
-
@AndZyk, @ryan I can confirm this (?). I have been having a similar issue since I upgraded to 3.0.184 when it was still in dev. Back then, I just assumed the issue was the code in my module. I have since confirmed that by downgrading to 3.0.181, the issue goes away. I'll dig further to find out when it was introduced and what is causing it. In my situation, I am trying to reload/init a fieldset that has been added to an inputfield via ajax. The fieldset contains a multi page field that used Text Tags as the inputfield type. Here's the screenshot of the error: The 'u' token comes from an 'undefined' string in what was supposed to be the JSON response. The use ajax options is not enabled under Text Tags for the page field. I am on WAMP. Thanks.
-
[SOLVED] XMLHttpRequest on the Main Thread is Deprecated
kongondo replied to kongondo's topic in Tracy Debugger
Just noting that I managed to resolve this (non-Tracy-related) problem. My script was getting sucked inside the pw panel markup due to loading order. All I had to do was to move my script markup before my pw panel markup. No more warnings, unnecessary ajax calls, etc ?. -
How to add drop down menu in the backend with icons
kongondo replied to DrQuincy's topic in General Support
Great! I did the same and it refused to work. No errors, nothing. Nothing in the nav is getting picked up and nothing in the markup. How did you go about this? Thanks. -
[SOLVED] XMLHttpRequest on the Main Thread is Deprecated
kongondo replied to kongondo's topic in Tracy Debugger
Hi @adrian, I've debugged this further and the issue has nothing to do with Tracy (was just caught in the middle!), sorry. The issue persists even with Tracy disabled. It is a jQuery issue. No idea how I'll get around this. I have to load Alpine.js inline since (AFAIK) $config->scripts() does not support 'defer' which Alpine needs. Thanks. -
[SOLVED] XMLHttpRequest on the Main Thread is Deprecated
kongondo replied to kongondo's topic in Tracy Debugger
Correction. This actually seems to be the issue, sorry. I am calling alpine.js in an inline script. All that code lives inside a pw-panel. When I use the code outside a pw-panel, I get no warnings. When used inside a pw-panel, I get the warning, unless I don't refer alpine.js. So, it seems alpine js and jQuery are clashing somehow. I'll try set up a test environment, but it might take a couple of days. Thanks for looking into the matter. -
[SOLVED] XMLHttpRequest on the Main Thread is Deprecated
kongondo replied to kongondo's topic in Tracy Debugger
In my case dev tools says the initiator is JqueryCore.js, so that could be it, although I have no <script> tags in that part of the code. JqueryCore is calling alpine.js in this case. Sorry, no joy. -
Hi @adrian, I am using a custom pw-panel and on page load, the first time I hover over its 'open' button, I get the following JavaScript warning in the console: [Deprecation] Synchronous ?id=1083&s=1&c=1&_tracy_bar=js&v=2.8.3&XDEBUG_SESSION_STOP=1:485 XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. I haven't investigated it much but it seems on hover, pw-panel loads the html inside the panel, which in this case has alpine.js attributes. Here's the debug screenshot from the console: Any ideas? Thanks.