-
Posts
2,007 -
Joined
-
Last visited
-
Days Won
21
Everything posted by dragan
-
+ = shaky mySQL server / setup. There you have it. Maybe ask hosting support or switch to another DB if you can.
-
I would prefer cookies instead of sessions for such user-choices. Sessions expire when you close your browser, but cookies will still be remembered after x days (= the lifespan you define). You can set cookies with JS alone, so you don't even need a server / PHP for that.
- 3 replies
-
- 9
-
- $session
- client to server
-
(and 2 more)
Tagged with:
-
I don't want to derail this thread, but just want to say thanks so much for mentioning this. Coincidence or not? Just today someone on a client project mentioned SonarCube (which is basically the same, but installed locally, and also from the same company), and now I took a look at SonarLint, which can be added to IDEs as plugins. I will definitely try out their IntelliJ plugin. Judging from the SonarCloud results for WireFrame, it really sounds like a great tool. Sort of like ESLint, but on steroids :-) The estimated "time to fix" and references to rule (definitions) are a nice touch.
-
Hide uneditable Pages in Admin Tree/ProcessPageList
dragan replied to Orkun's topic in General Support
Can't you just add a CSS class to uneditable pages, and use display: none on these? Or maybe check with JS for absence of li.PageListActionEdit and then add a hiding class in the parent div. As for unaddable pages, check for absence of li.PageListActionNew. -
Yep, I have used something similar where you only want to list a few countries, and if you select "other", a text-input appears. Or an entire fieldset, actually (different address for invoice or some such scenario).
-
@Rudy Did you consider using innoDB tables? Apparently they're better suited for heavy read-write operations (row-level vs. table-level locking). There are a few discussions in the forums with pros and cons of that approach.
-
Selector only returning one of two matching records
dragan replied to Kiwi Chris's topic in General Support
using trim() is considered good practice whenever you deal with user input or import/export stuff, so yes: definitely make it a habit. -
Best Practice to determine if admin from init method?
dragan replied to Noel Boss's topic in API & Templates
Doesn't this work? if ($this->page->template == 'admin') { echo "in admin"; } else { echo "not in admin"; } It surely works in ready.php. (Maybe you'd have to alter the syntax a bit... wire instead of this) Just tried this inside one of my modules, and it works as expected: public function init() { parent::init(); if ($this->page->template == 'admin') { $this->wire->message("in admin"); } else { $this->wire->message("not in admin"); } } -
refer to the BS documentation: https://getbootstrap.com/docs/4.3/components/collapse/#accordion-example Strictly speaking, this question should be filed under Dev Talk, rather than PW general support, since this question has nothing to do with ProcessWire, but pure frontend code. Hints: Even without using Bootstrap, an accordion is a very simple frontend component. Basically a click event where you toggle the active class of each li. You don't even need jQuery for that. Just make sure you're using ARIA-attributes correctly. You are not allowed to use an id more than once per document (li id=ppacord). Why do you even use it? There's no matching CSS definition anyway. HTML semantics and accessibility: Your headings are mixed up, i.e. after your h1 follows an h3, and then you jump to h2 again. Make sure the document structure is correct and you don't skip heading levels. This is confusing to screen reader users.
-
Selector only returning one of two matching records
dragan replied to Kiwi Chris's topic in General Support
I've created two identical pages, with only the page-name being different. An ordinary query like $res = $pages->find("template=basic-page, title|summary|body|sidebar%=muster"); d($res); correctly returned two matches. The entire DB is innoDB as well. So that surely can't be the culprit. -
is this in the frontend or backend? Or both?
-
Care to elaborate about such projects? i.e. some insights into the pros/cons of PW, or just general infos (what worked well, what didn't; what general dev route you were taking instead, bottlenecks or overhead etc).
-
Are you really sure it's the same setup? Are the relevant pages published and un-hidden?
-
[SOLVED] Pagination rendered but does not work
dragan replied to Alpine418's topic in Getting Started
Perhaps not much help, but I find it strange that it adds query strings. The page numbers should actually be rendered like this: http://demo.processwire.com/cities/new-york-city/page2 Do you find any hints in any of these places? browser JS console Tracy Debugger PW error logs Perhaps also check the browser network panel, to see if the page(s) return HTTP 200 or a redirect. -
That's so trivial, that you hardly need a function for that. $filename = '/path/to/image.jpg'; echo pathinfo($filename)['filename']; Or am I missing something?
-
Testing Blisk browser, only 1 feature interests me, live reloading
dragan replied to OrganizedFellow's topic in Dev Talk
You could also give Brunch a try. I've never used it, but it looks quite good. Here are various "skeletons" (boilerplates / setups). -
Testing Blisk browser, only 1 feature interests me, live reloading
dragan replied to OrganizedFellow's topic in Dev Talk
Well, I'm not impressed. @OrganizedFellow Why was the reloading "always buggy"? Maybe you set it up wrong? I never encountered problems with Browsersync (with linting tools however, or when pulling from Git again, it's a different story - I have to restart Gulp several times a day - but never because of browser live reloading). -
Well, I had it for ages, but only today made a Github repo and thought I could just as well share it. And yes, it's similar because we apparently use the same core class ifsnop :-) It's especially useful if you have to work on a site where you can't quickly create a files-backup as ZIP, nor un-zip easily via control panel (which is standard in Plesk et al). Or if you can't run system commands, because the hosting company doesn't allow it. On some sites, I have it running with a hook and/or PW lazycron. And before any major changes (dev/prod), I just trigger it manually.
-
No, panels are the ones that slide in from left, and modals are like lightboxes.
-
I'm using this: https://github.com/dragan1700/site-backup One script creates a ZIP of the entire site, the other creates a DB-dump. They can be also used with Cron, if you just put in the shebang (may vary in your server setup). Since normally I'm not working with huge databases, I didn't do an option to zip the .sql as well, but I might add that later if the need arises.
-
How to intercept InputfieldButton click event via JS?
dragan replied to bernhard's topic in General Support
I still don't get what you want to achieve in the end, but try this $(document).ready(function() { $(".InputfieldButtonLink").removeAttr("href"); $(".InputfieldButtonLink").on("click", function (e) { e.preventDefault(); console.log("so now what?"); return false; }); }); For some reason, this will do a console.log() twice, because there's also a click handler defined in wire/modules/LanguageSupport/LanguageTabs.js i.e. if you want to make sure that your custom action only fires once, you'd have to somehow de-activate that click handler too. -
Do you mean access them from an images-field on that page? In that case you'd change the image path to site/assets/files/page-id/ instead. But you'd still have to add the images to the field programmatically so that PW "sees" the new pics (via hook or Cron).
-
I wonder how all these years I never heard of John Frusciante's solo records... until a recent trip to Croatia, where the best cook in the village played some of his stuff... one of the most laid-back places I've ever been to at the Adriatic coast... And then there's this gem I discovered just 2 days ago:
-
[solved] Weekend Challenge: RockTabulator needs JS Experts :)
dragan replied to bernhard's topic in General Support
Great news! At least one ray of sunshine on this rainy miserable day ?