-
Posts
11,254 -
Joined
-
Last visited
-
Days Won
374
Everything posted by adrian
-
Hi @MarkE Sorry I've been so long to respond - way too busy here at the moment. I don't have a fully working solution for you (I couldn't quite get there as quickly as I need to), but here are some starting points. The first one is hacky. The second is where you want to end up, but you'll probably want to do a $f->addClass('hidden') or something like that. I also didn't want to use a Markup inputfield but it seemed like there were issues with overriding the main "override" field. Also, using $p->override isn't actually working because it's preventing you from changing the value that is already in the system but if you set it to 0 or 1, you'll see that the approach has merit in that it will change the visibility of your other field. Sorry it's not fully working, but hopefully gets you there. Remember the key thing is that showIf conditions work via JS, so the values need to be available that way, not just via $page->override like you were trying. $this->addHookAfter('Page::render', function(HookEvent $event) { $p = $event->object; $event->return = str_replace("</body>", '<input type="hidden" id="Inputfield_override" name="override" value="'.$p->override.'"></body>', $event->return); }); $this->addHookAfter("ProcessPageEdit::buildForm", function(HookEvent $event) { $p = $event->object->getPage(); bd($p->override); $form = $event->return; $f = $this->modules->get("InputfieldMarkup"); $f->attr('id+name', 'override'); $f->attr('value', '<input type="hidden" id="Inputfield_override" name="override" value="'.$p->override.'">'); //$f->collapsed = Inputfield::collapsedHidden; $form->insertAfter($f, $form->title); $event->return = $form; });
-
module Fluency - The complete translation enhancement suite for ProcessWire
adrian replied to FireWire's topic in Modules/Plugins
Thanks for your thoughts @FireWire - I think I'll be having to switch to Lingvanex sooner than later, so there might be a PR coming you way. Let me know if you already have any thoughts on how you would like to implement different translation engines so that I hopefully do it in a way that you're happy with.- 318 replies
-
- 3
-
-
- translation
- language
-
(and 1 more)
Tagged with:
-
Sorry @Macrura - I ended up going a different way, so I already deleted the field. Super busy at the moment, but if I find some time, I'll try to reproduce. I don't think I did anything special though.
-
Thanks @Robin S - sounds great!
-
@Robin S - just discovered that if you have this attached to a field that is editable under a user's profile page, it breaks the field with a JS error because it can't load this component. No rush for a fix for my needs, but someone else might come across it.
-
Just resize via an API call within the <img> tag, eg: <img src="<?=$page->image->size(400, 0)->url?>" /> That will resize, store it (not visible in the admin) and display it on the frontend where called and will be available to all future calls without going through the actual resize each time.
-
module Fluency - The complete translation enhancement suite for ProcessWire
adrian replied to FireWire's topic in Modules/Plugins
@FireWire - sorry for the silence on your last post - I haven't had a chance to test this new version yet - hopefully soon. A question for you thought - have you looked at: https://lingvanex.com/translationapi/ - they are much cheaper than DeepL and support a LOT more languages. This post is also worth a read: https://lingvanex.com/history-lingvanex/ Anyway, I am need of Tagalog translation and am thinking about Lingvanex but would like to know if you investigated it and decided against it for some reason. Thanks for your input.- 318 replies
-
- translation
- language
-
(and 1 more)
Tagged with:
-
These might help: https://processwire.com/modules/password-force-change/ https://processwire.com/modules/email-new-user/
-
Page Hit Counter – Simple Page View Tracking
adrian replied to David Karich's topic in Modules/Plugins
Would you mind adding this to the Github requests repo? I'd do it, but I feel like I've added so many requests and issue lately that Ryan is starting to tune me out ?- 111 replies
-
- 1
-
-
- hitcounter
- tracking
- (and 4 more)
-
Page Hit Counter – Simple Page View Tracking
adrian replied to David Karich's topic in Modules/Plugins
Yeah, I understand the reasons - it's a shame PW doesn't have a dedicated endpoint that is automatically available on all installs so we don't have to deal with hacking into 404. I have wished for something like this many times - I wonder if maybe it should be a feature request?- 111 replies
-
- 1
-
-
- hitcounter
- tracking
- (and 4 more)
-
Page Hit Counter – Simple Page View Tracking
adrian replied to David Karich's topic in Modules/Plugins
Sure, that works, but I am talking about direct affiliate links - sites often have mysite.com/davidk without any preceding segment to define what it is. I kinda find this practice a bit weird, but it seems pretty common.- 111 replies
-
- hitcounter
- tracking
- (and 4 more)
-
Page Hit Counter – Simple Page View Tracking
adrian replied to David Karich's topic in Modules/Plugins
@David Karich - defining URL segments does seem to fix all the issues. However, I am concerned about setups where the definition would allow matching "phcv1" - mine are specific enough at the moment, but I can see it being an issue, especially if you have a segment for catching incoming affiliate links, or something similar with one segment that allows any alphanumeric characters.- 111 replies
-
- 1
-
-
- hitcounter
- tracking
- (and 4 more)
-
Page Hit Counter – Simple Page View Tracking
adrian replied to David Karich's topic in Modules/Plugins
Hi @David Karich - thanks for all the follow up. I tried uninstalling / reinstalling again here, this time on my local dev setup, rather than my production server and no errors this time - I'll put this down to a random PW glitch. I see your point of view about the AJAX approach, although I still feel like it is less efficient than a direct call during page render, but I'm not too concerned about it. Now, regarding the important stuff - you're correct that the page's HTML is not returned when debug mode is off, but I'd still consider this a bug - I am pretty sure that it being returned is not your intention ? and it's annoying to deal with it when debug mode is on. Perhaps this module shouldn't be installed while a site is still in development (when debug mode is likely to be on), but I still think this should be fixed. I don't really understand your point about non-AJAX based requests not being processed further. I think you'll need to setup urlsegments with a required trailing slash and you'll see my point about the unnecessary 301 redirect - could be easily fixed by appending a trailing slash (if required) to your call to the /phcv1 path.- 111 replies
-
- hitcounter
- tracking
- (and 4 more)
-
Page Hit Counter – Simple Page View Tracking
adrian replied to David Karich's topic in Modules/Plugins
Sorry, on a related note, if the template's urlsegment trailing slash is set to "yes" to force a trailing slash, you end up with two calls, so the module needs to check this setting and adjust the path accordingly. FYI - the reason I have that setting forcing the trailing slash is because I have urlsegments and pagination both turned on, and without it, URLs can end up broken.- 111 replies
-
- hitcounter
- tracking
- (and 4 more)
-
Page Hit Counter – Simple Page View Tracking
adrian replied to David Karich's topic in Modules/Plugins
@David Karich - on the issue of the AJAX call from the js file - turns out if you have url segments enabled for a template, when you view a page, the entire page's html is included in the response and sent to the browser along with the "Page Hit Counter: Tracked". I can workaround it by adding: if($config->ajax && $input->urlSegment1 == 'phcv1') exit; to _init.php, but I think there needs to be a more elegant solution ? I have read your section about "Notice: Tracking with URL segments", but I don't think that is really the issue here. I haven't defined my urlsegments yet (I will before the site goes live), but I don't think that will prevent this issue, will it? Any thoughts?- 111 replies
-
- hitcounter
- tracking
- (and 4 more)
-
@Macrura - I haven't used this before, but just tried on a PW latest dev install and I am seeing this browser error: selectize.js:2230 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. at Selectize.refreshOptions (selectize.js:2230) at Selectize.onFocus (selectize.js:1752) at selectize.js:2088 Please let me know if you have problems reproducing and I'll dig a little deeper. Thanks.
-
Page Hit Counter – Simple Page View Tracking
adrian replied to David Karich's topic in Modules/Plugins
Hi @David Karich - thanks very much for this. I just noticed that if you uninstall and reinstall, you get an SQL error because it's trying to create a table that already exists, so either the uninstall didn't clean things up properly (if that is the intention), or the install process needs to check to see if it already exists. Also, just wondering if the AJAX approach could be reserved for sites running ProCache? Is there a need otherwise for doing it this way, rather than hooking on page render? There's a good chance I am overlooking something, but just thought I'd ask. Another thought - have you considered a way for us to easily extend this to log click events to track users viewing PDFs etc? Maybe this really doesn't belong within this module and should be kept as something we implement on a case-by-case basis?- 111 replies
-
- 1
-
-
- hitcounter
- tracking
- (and 4 more)
-
@teppo - your first description is all I am really looking for. Obviously the second would be great, but I expect impossible with PW selectors.
-
Thanks @teppo - looking forward to seeing all these new features. I have another one for you ? Whenever I build a search engine I emulate Google's "search phrase" use of double quotes to effectively switch from ~= to *= Would you be willing to support something like that also?
-
@Robin S - I have been using this module since it was released and always thought it was a necessary tool for inserting Hanna codes, but I just starting using some of its other features like: linked_page__pagelistselect which makes it an entirely new beast - amazing. Thanks!
-
Running Firefox Developer version on MACOS here and can't seem to make it fail - tried multiple pages, multiple times. Maybe you could debug for me? When the single click scroll doesn't work, does the double-click to open settings also fail? I wonder if the JS that hacks into that button isn't loading at the right time after the button is rendered? I'll make the gear icons lighter in the next version.
-
@szabesz - I've taken care of most of your requests. The only ones I haven't done are the separate front/back end visibility for the various server type indicators - this will actually be quite a bit of work which I don't have time for at the moment. The other thing I didn't change is making those checkboxes into columns for those panels you mentioned - the problem is not just the responsive issues, but more importantly, it's that it messes with the order of checkboxes - they end up going across the rows, rather than down the columns which is actually pretty awful. Anyway, let me know if all the other stuff works as you'd hoped, including the scroll to top ?
-
@szabesz - thanks for your thoughts on the settings. One problem with setting those checkboxes to use columns is this: https://github.com/processwire/processwire-issues/issues/1327 Regarding the quicklinks being in alphabetical order. I kinda agree with you, but I @Robin S thought the matching the order of the settings was better. I'd be willing to change, but given that this is his feature, I'd like his OK first. There are direct links to settings at the bottom left of each panel. I think that is probably enough, but I could consider adding them to the Panel Selector as well if you still think it would be helpful. Not sure about the scroll to top button - it feels a bit out of place in Tracy, but I'll think it over. I'll also have a think about the server type indicator frontend/backend changes - that seems like a good idea.
-
@salmiak - did you see my suggestion above for incorporating monolog into Tracy? It might be the simplest option. If you go with a separate module, perhaps hooking into Wire::trackException might be of use?
-
Yep, it's Tracy - it's designed to give you a visual indicator as to whether you're working on a live, local, dev, staging etc version of the site. It is configurable to work with subdomains or TLDs. Take a look at the "Server Type Indicator" section in Tracy's settings. I find this really invaluable, but I know that @kongondo hates it ? Anyway, you can easily disable it if you want, but note that of course it's only visible to users with Tracy permissions, so visitors to the site won't see it.