-
Posts
11,129 -
Joined
-
Last visited
-
Days Won
366
Everything posted by adrian
-
What do you mean by "not as reliably"? Does it fail sometimes? I use this in so many places and I don't think I've ever had an issue so perhaps there is something else at play here.
-
<?php namespace ProcessWire; if($config->ajax) { bd('AJAX request detected'); echo "Replaced page content"; exit(); } ?> <script> function loadlist(segment='') { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("main").innerHTML = this.responseText; } }; xhttp.open("GET", "<?=$page->url?>"+segment, true); xhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xhttp.send(); } </script> <div id="content"> <div id="main">Basic page content</div> <p><button onclick="loadlist('')">Load List</button></p> </div> Note the replacement of the text in "main" and that Tracy detects the AJAX request.
-
Sorry, it needs to be after the open line. I just tested here and it works as expected when placed after.
-
Add this line before your xhttp.open line and it should work: xhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-
Lovely!
- 1 reply
-
- 2
-
-
- inputfield
- checkboxes
-
(and 2 more)
Tagged with:
-
Looking for easiest way to turn off autocomplete for admin login prompt
adrian replied to gRegor's topic in General Support
It might be ugly and not recommended, but I set the autocomplete value to a uniqid() value and it seems to work to actually prevent browsers autocompleting fields. -
Sorry about that @Nick Belane - should be fixed in the latest version.
-
@froot - please try the latest version.
-
Thanks for the report @olafgleba - it should be fixed in the latest version.
-
@ryan - I don't really know the best place to post this, but the modules section search is really not a great experience at the moment. If you search for something, the results are displayed, but the search box is no longer available so you can't search again without clearing the ?t=Modules&q=searchterm from the URL.
-
@flydev - thanks for this module. I am curious about your plans for it or if you know of any alternative PW module. I am looking to start using it, but definitely want the ability to register users as well (rather than just signing in existing users). I see you have the listed as something that is planned. I am curious if you came across any particular stumbling blocks getting that set up, or whether you just didn't find the time. I am tempted to tackle adding that functionality myself so wanted to garner any insights from you about potential issues. I am honesty surprised to see so little discussion about SSO on the forums - these days it seems like most sites that require frontend users to register offer this option.
-
Yep, take a look at this post: https://processwire.com/talk/topic/8387-page-protector/#findComment-81950
-
@virtualgadjo - thanks for reporting. I've fixed in the latest version. I also added the PW namespace as I will be doing with all my modules are new versions are released.
-
Thanks @Robin S for taking a look - much appreciated. It seems like a random issue here even with my simplest modules. I have played around with removing those FileCompiler files and DB entries and sometimes it helps and other times not. Sometimes I literally need to remove the namespace so I can uninstall, then add it back and then I can reinstall. I am just worried about breaking the admin for users upgrading my modules. I also wonder if sometimes it matters how the module is upgraded - replacing files directly vs updating via the PW Upgrades module - perhaps it triggers a modules refresh before the module gets to load and potentially break things 🤷
-
@horst - we can't add those labels ourselves.
-
@horst - there are lots of new theme issues being posted to Github
-
Has anyone figured out a reliable way to add a namespace to a module without resulting in a very stubborn error like: Class "WireData" not found Seems like the only reliable way is to uninstall and then install again, but this is kinda of impossible to do once you've already updated the files, so you need to know to uninstall beforehand. I have had requests to namespace my modules, but I don't want to break people's admin interfaces (and mine for that matter). Thanks!
-
Creating user accounts so people can create listings
adrian replied to Tyssen's topic in General Support
You'll need to do more than that to make it reliable - have a read through some of the issues - these two are key. One is simple to fix, but the other requires a fair bit of work. https://github.com/ryancramerdesign/LoginRegister/issues/2 https://github.com/ryancramerdesign/LoginRegister/issues/9 -
Creating user accounts so people can create listings
adrian replied to Tyssen's topic in General Support
@Tyssen - unfortunately, that module is pretty broken. Either buy LoginRegisterPro, or use LoginRegister as a base (fixing the key Issues yourself), or as inspiration for how to implement your own login form and logic. -
@vmo - even though PW uses pages and "repeater_" templates to house the content of repeater fields, I believe that the noLang setting of the page that contains the repeater field should handle this because you're not typically meant to adjust settings of those "repeater_" templates directly. I doubt @ryan will get to this thread so it might be worth posting a Github issue and see what he says there.
-
Hi @vmo - thanks for looking into this and coming up with a fix, but if I understand correctly, I feel like this is something that the PW core should handle because it's about fields within a template that has noLang = '1' not respecting that setting, whereas this module is all about specific pages/branches having this setting while others of the same template don't. Does that make sense?