-
Posts
2,007 -
Joined
-
Last visited
-
Days Won
21
Everything posted by dragan
-
If you're serious about performance and don't have http2 available, you can optimize a lot with resource hints and service workers + cache API.
-
@verdeandrea Sounds like a cool project! If I had to do this, I guess I would go a similar route like @wbmnfktr suggests. However, gradient generators are a lot more work than just (single) color-pickers. I'm not sure it's worth re-creating all that stuff just so your authors can finally insert some CSS for a given section. I would perhaps rather use a markup inputfield*, and just open a gradient generator in a (pw-) modal, and instruct the editors to copy and paste the generated CSS into a regular textarea. Would certainly not look as polished and streamlined as a native PW inputfield, but it would get the job done way faster. * https://modules.processwire.com/modules/fieldtype-runtime-markup/ or https://processwire.com/talk/topic/21982-rockmarkup2-inputfield-to-easily-include-any-phphtmljscss-in-the-pw-admin/
-
While you're at it, do yourself (and your client) a favor and try to upgrade to PHP 7.2 or higher - official PHP 5.6 support ended a year ago.
- 12 replies
-
- 1
-
- loginregister
- processwire
- (and 3 more)
-
You could also try this: https://ckeditor.com/docs/ckeditor4/latest/examples/timestamp.html
-
@abdulqayyum has version 1.0.1, while the latest seems to be 1.0.3, maybe that feature was added in-between those versions? What version of PW are you running?
- 12 replies
-
- loginregister
- processwire
- (and 3 more)
-
[SOLVED] 301 redirect loop on all pages except homepage
dragan replied to a-ok's topic in General Support
@a-ok Works for me... did you fix it? -
Well, DB-user and host are wrong. Just compare the two screenshots...
-
[SOLVED] Remove Select Page/File from Insert Link Modal
dragan replied to Klenkes's topic in General Support
Then simply add both, and hide the PWLink items via a hook (based on role) + CSS: Inspect such a page, and find the two buttons (pw link + unlink). Each have unique IDs: body.ProcessPageEdit-template-basic-page #cke_43, body.ProcessPageEdit-template-basic-page #cke_44 { display: none; } -
[SOLVED] Remove Select Page/File from Insert Link Modal
dragan replied to Klenkes's topic in General Support
Create another textarea field, type CKEditor, and in the RTE settings simply replace PWLink with Link, this will give you CKEditor's default link dialog. To customize that CKE plugin, you'll have to dig into their docs / code. Maybe this is a good start. -
Did you edit your hosts file accordingly? i.e. 127.0.0.1 processwire.test
-
There's certainly a lot to be considered, and quite possibly I haven't thought about all pros and cons, but... If you have the multi-language settings* "what should happen when alternate language is empty (not translated)?" -> show default language content, then the authors would still only edit the original german default tab, and simply leave the 2nd "fake" german language version alone (just make sure it's activated). re: "don't confuse authors" You can simply hide the 2nd german language tab via custom admin CSS or/and hooks. That way, the default tab is still the relevant one for german and is only empty if this page is really meant to not exist in german. Only potential caveat I can think of: required fields. afaik you can't say field X is only required in one language and not in another. At least not out of the box. You'd probably have to adjust search, and navigations (don't show double entries, always rule out default, etc.) * this is defined at field-level, and afaik is the default option
-
integrating payment process in a user registration form
dragan replied to JeevanisM's topic in General Support
You can also try the recently added https://processwire.com/blog/posts/pw-3.0.139/#new-toggle-field And then have no - unpaid yes - paid paymentAttemptFailed - user tried to pay, but for some reason didn't succeed To make it even fancier, you could log the 3rd use-case in another field (each attempt with timestamp) -
use a hook? https://processwire.com/api/ref/fieldtype/create-field/ or wait for impeachment? ?
- 1 reply
-
- 2
-
Why do you need to test them so often? The obvious advice would be: Test them on the development instance of the site. Depending on embed method (A-D), a query string may or may not work. Perhaps with a hook that checks for user-role? $this->addHookBefore('FormBuilderProcessor::emailForm', $this, 'testEmails'); protected function testEmails(HookEvent $event) { /* @var InputfieldForm $form */ $form = $event->arguments(0); if ($user->hasRole("email-tester") && $config->emailTesting === true) { $recipient = $form->getChildByName('recipient'); $recipient = 'foo@admin.com'; // or put inside $config too // some re-definition of the landing page, e.g. add query string or pseudo-landing page, or real-landing-page-url + url-segments /test-only/ } }
-
Bug report - Get $user->language in hook Pages::saveReady
dragan replied to DV-JF's topic in Multi-Language Support
That actually seems to work! Meanwhile, with latest PW dev, I get an error on line 242 (my screenshot above): ProcessPageEdit: Method ProcessWire::getCurrentUser does not exist or is not callable in this context This error didn't occur with the previous dev version o_O -
Just very quickly a few pointers, since it's getting late over here... Definitely create a PW-tpl and matching page for such tasks. Most people use one such special page for all kinds of API/AJAX stuff. Inside the page, you can check with a simple switch/case statement which action should be run. In that "AJAX endpoint" page (or whatever you want to call it), you can e.g. use if($config->ajax) and therefore (in the else clause) also re-use it for other purposes (classic GET or POST, i.e. data not sent via AJAX). (more examples on use-cases of $config->ajax) I guess this looks OK (though personally I prefer the more verbose form), but in your case I would definitely add input validation (sanitize / maybe add a hidden input field etc.). Also, I don't know where $randTitle or $randHas comes from - I guess it's there in your original code but you omitted to post it here for brevity? It looks like it comes from this code snippet. Just make sure you have initalized those two variables.
-
Yeah, the navigation is not ideal. I have to scroll 3-4 times down to see the next content below, which is counter-intuitive. There are also JS/Vue errors in projects. I can't get past the 2nd one and get [Vue warn]: Error in render: "TypeError: Cannot read property 'title' of undefined"
-
This is a very hackish solution, but then again it's Saturday, I have never used the LR module before, and I could do with more coffee :) Basically: Create an iFrame. May not be elegant, but it seems to work. You'd have to add a logic for the registration confirmation page, so that this doesn't load in the iframe, but in its own page. btw, the very first line above was me trying out another idea: create several pages with the LR-template and then tinker around with form targets or hidden input fields.
-
@abdulqayyum can you please delete your other two identical forum threads?
- 3 replies
-
- wiremailsmtp
- loginregister
-
(and 4 more)
Tagged with:
-
Bug report - Get $user->language in hook Pages::saveReady
dragan replied to DV-JF's topic in Multi-Language Support
Yes, it's weird, and most probably a bug. Funny thing is that the current active language is recognized correctly (status10189 = 1), but language name and title are mixed up. -
Actually, for href the correct format is +49 (country prefix). The leading numbers don't matter (same as for the leading zero after the country prefix). I know I could use an HTML5 regex pattern, but actually I just do an instruction text below the input field, with an example.
-
Best practice for building two sites on the same processwire install
dragan replied to blanco's topic in General Support
Do you need one single PW admin for both sites? Or each site has its own PW-backend? -
Apparently you can't. May I ask why you want to do this? Is changing the title not enough?