-
Posts
2,007 -
Joined
-
Last visited
-
Days Won
21
Everything posted by dragan
-
yeah, since a recent forum update, copy-and-pasting code snippets can wield weird results ?
-
try changing to
-
I have followed @bernhard's suggestion and hooked into saveReady, and replaced setAndSave() with just $page->name = $pageName. Because... a hook named saveReady doesn't need a separate (injected) save() command. You can SET values right before it SAVES things.
-
Try this if ($this->page->template == 'admin') { function customPageName(HookEvent $event) { $dummy = 'hook-generated'; $page = $event->arguments(0); if ($page->template->name == 'basic-page') { $pageName = wire()->sanitizer->pageName($page->title . '-' . $dummy, true); $page->setOutputFormatting(false); $page->name = $pageName; } } $this->addHookAfter('Pages::saveReady', null, 'customPageName'); }; I guess a certain combination of hook + save() will create an infinite loop, but this (abbreviated) example works just fine here.
-
Definitely go with Repeater Matrix. It's worth every cent. Plus, ProFields has lots of other items you'll find helpful. You'll reduce development time drastically, and your client will enjoy the ease of use and flexibility.
-
ProcessWireUpgrade Not Showing Core Upgrade Options
dragan replied to vwatson's topic in General Support
In the modules section, go to the bottom of the page and click the "clear compiled files" button. This should (hopefully) re-create the module caches. -
Try options_colors.title, options_colors.value (or even options_colors.name) Or use page-references instead.
- 1 reply
-
- options
- options-field
-
(and 2 more)
Tagged with:
-
I'm not sure I understand. Are your client's editors using this to make selections? Or you (= the developer)? If the latter, why not use custom selector with something like title%=axa|client_name%=sbb ?
-
For such scenarios, you can always add as many custom $config items as you need. Or pass parameters to the cron-script. Or maybe even use gethostname(), as suggested here (untested).
-
On a slightly serious note though: There are CKEditor plugins for spellchecking. I think AOS has one of those (SCAYT) built-in. It's quite handy. Among other things, you can choose to ignore a suggestion, or add your own phrases to the dictionary. (Of course, this won't work with plain-text fields)
- 1 reply
-
- 4
-
Did you notice that one of those modules is not officially stated as compatible with PW3? You should always post module-specific questions in their dedicated support forums, instead of creating a new thread (the blue button on the official module page at the left) At quick glance, I noticed you are not supplying the page field for your Photoswipe gallery. It should be: echo $pwpswp->renderGallery($page->nicePictures); // or whatever you've called your images-field... I have never used any of those two modules. But a potential "gotcha" with outputting files in a template is if you're allowing just one single file or multiple. If you expect an array of items, use $page->fieldName->first()->url (in case of the video file). Depending on your field-settings, you can use one method or another, i.e. if it's set to 1 file only, you can use $page->fieldName->url etc. Do you get errors? If you're in debug mode, you should see errors appearing. Also look at the browser console for JS errors. Finally, if you use Tracy Debugger, you should get hints and more extensive debugging infos.
-
It works here (Apache) as expected. You could use regular PHP instead: echo $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']) . '/';
-
selecor Using numReferences in selectors?
dragan replied to schwarzdesign's topic in General Support
But referenced to what? You use $pages->find(), not $page->numReferences. -
@bernhard Thanks for these tips and tests. How long did finally this 1 million page-creation script take?
-
Move uploaded images or files from one page to another
dragan replied to Webrocker's topic in General Support
Short reply: There's no built-in way to move files around like that. However, you could clone the page as many times as you need, and then go back in and delete everything you don't need anymore. -
Do you really mean user:pass, as described in the docs, or do you simply have a field named username and another named pass? If the latter, you can just do regular post fields. Or try setting an Authorization: Basic header as shown here.
-
In Win / Chrome it looks exactly like your screenshot. Styling and inf. scroll seem to work just fine. What are you testing with, and how does it look like on your end?
-
@teppo Thanks for your insights and links. I have stumbled over import-/export WP plugins, and tried out two or three that sounded promising, but none of them did a clean job with ACF pages. I will definitely take a closer look at WP REST. The task I will definitely hate the most are internal links. WP stores them as hardcoded links. If all URLs inside PW will change* (conceptual question of course), updating those countless links inside RTE fields to avoid broken links will be tedious. But I'm sure I'll whip out something that'll work (regex, .htaccess 301 redirects, storing old URLs in hidden PW fields too etc.) * i.e. in case we'll not keeping the old WP structure and hence not going to use /site/templates/includes/hooks.php like Ryan did (his first post in this thread)
-
@ryan Thanks a lot for your detailed posts and code-examples! I will probably have to do a massive export from WP in the near future, so I was taking a closer look at the WP data structure, and ways how to accomplish it. In my case, the old WP site has so many plugins, that the whole DB queries are a nightmare. Exporting Tribe events is a bit tedious, but doable. With ACF though, it will be a nightmare (ACF is the standard commercial add-on if you'd like custom fields, but compared to PW it's kindergarten). Most probably, I will have to re-create those with Repeater Matrix, and re-build each item via API... sigh.
-
What kind of multisite setup are you using? Multiple installations of PW, or one PW installation serving several sites (Soma's setup, #2 of this doc page)? If I understand you question correctly, $page->name is enought, since this is really only the page-name, without page-parent(s).
-
spa Architekturführer Köln - SPA in the front, ProcessWire in the back
dragan replied to schwarzdesign's topic in Showcase
@schwarzdesign I just noticed that you block /api with your robots.txt: https://architekturfuehrer.koeln/robots.txt Don't do that. This is most probably the reason Google can't index your Vue-powered site. You can check what Googlebot really sees here: https://search.google.com/test/mobile-friendly In your case, it's the empty, unpopulated Vue app tag. Not even the app shell is visible. When I checked another Vue site earlier this week, Google actually reported issues when confrontend with a bot-blocking robots.txt rule. (another one was a missing cross-origin HTTP header, which doesn't apply for your site, since you're not loading anything from another domain) -
Get a unique identifier for the current session?
dragan replied to Robin S's topic in API & Templates
Can't you use one of these? $_COOKIE["wires"]; $_COOKIE["wires_challenge"]; Seems like the first one is always created, and the second one only if logged in. -
Issue when exporting/importing fields along with pages
dragan replied to dreerr's topic in General Support
yoursite.com/backend/setup/field/ -> at the bottom right, you'll see two buttons: export + import ? -
I have never used that module, but I guess it should be: $content .= $modules->MarkupSocialShareButtons->render();
-
Also take a look at the JS console, maybe you'll spot errors there, while editing / saving a page.