-
Posts
636 -
Joined
-
Last visited
-
Days Won
8
Everything posted by psy
-
May or may not help... was getting a similar, but not quite the same, error after adding a single auto-load module. Forgot that bit and tried to load it again in a template with a local variable, eg: $mymodule = $modules->get('myModule'); Ambiguous error was: Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in /home/xxx/xxx/wire/core/Selectors.php line 378) TracyDebugger's error description was no more helpful than the PW logs. While the error message was correct, it didn't truly reflect the cause of the problem. Only by disabling modules (in my case easier cos all worked before adding this particular module), and screening template code, was I able to resolve the problem. Solution for me was to access module's methods as static functions, eg "myModule::someFunction()" in the template. Key difference between 2.x & 3.x is namespaces. Is there a function used by index.php line 64 in your template (or _init.php or ready.php) that needs a namespace (or \)?
-
My first hook to customise the page title for a specific template
psy replied to LAPS's topic in General Support
@LAPS I haven't used conditional hooks. Instead, I'd have written it as: wire()->addHookAfter('Pages::saveReady', function($event) { $page = $event->arguments('page'); if ($page->template != 'user') return; $page->of(false); $page->title = $page->last_name . " " . $page->first_name; $event->return = $page; }); -
My first hook to customise the page title for a specific template
psy replied to LAPS's topic in General Support
@LAPS just noticed you have Page('template=user')::saveReady. Try changing it to Pages('template=user')::saveReady - ie Pages, not Page -
My first hook to customise the page title for a specific template
psy replied to LAPS's topic in General Support
@LAPS hrmm... here is a similar hook that I use and it works fine: /***** Ensure the $page->seo->title field is not empty */ wire()->addHookAfter('Pages::saveReady', function($event) { $page = $event->arguments(0); $t = wire()->templates->get($page->template); if($t->hasField("seo_title") && !$page->seo_title) { $title = $page->get('headline|title'); $page->of(false); $page->seo_title = $title; $event->return = $page; } }); -
My first hook to customise the page title for a specific template
psy replied to LAPS's topic in General Support
Did you try turning off formatting before changing the page field data? wire()->addHookAfter('Page(template=user)::saveReady', function($event) { $page = $event->arguments('page'); $page->of(false); $page->title = $page->last_name . " " . $page->first_name; $event->return = $page; }); -
@heldercervantes Oops... shared your great blog post on FaceBook and concerned it may have gone viral
-
@tpr Thank you for this great module. Note to self: When your site is doing something fabulous and you can't remember for the life of you how you did it, check AOS first
-
I've used https://themeforest.net/item/canvas-the-multipurpose-html5-template/9228123?s_rank=1 for a number of sites and found it covers most of my front end requirements. It has a heap of page templates that are easy to convert to PW templates and individualise for client site looks.
- 23 replies
-
- 6
-
- template
- website template
-
(and 2 more)
Tagged with:
-
@horst thanks for that tip. Love that I learn something new about PW's inbuilt power everyday
-
Should also add... if you decide to change the abcd page URL, you should also consider redirecting any backlinks pointing to the old URL to the new one. Module comes to mind but have no idea if it works with PW 2.3
-
Don't be put off by what your competitors are doing. They can be wrong. Google gives lower ratings to pages that it sees as lower down the page tree... eg page abcd in the tree abcd.com.au/all/about/abcd would rate lower (probably 40%) than page all-about-abcd in url abcd.com.au/all-about-abcd (probably 80% as it's one page off the root) Google is also smart enough to recognise hyphens in URLs as spaces. The only suggestion I would make would be to rename the URL to abcd-is-about - that way abcd is up front Hope this helps
-
@horst Google is Google... not %100 certain but strongly suspect G adds meta to jpgs it optimizes and so gives higher scores even if the original was fully optimized first. Even so, still regularly getting GSPI scores on mobile 75%+ and desktop 90%+ with PW, Procache etc and with careful coding so no errors on https://validator.w3.org/ . Can only do what I can do. I use the PW site results as comparisons to WordPress site performances to show my clients that PW is the way to go. For me, it's not about getting upset with G, it's more about proving how well PW performs
-
Like you, I've tried lots of different compression techniques. Seems Google only likes its own compressed files. What I do to get the scores up... 1. Run the test then download the zip containing the compressed images generated by Google Page Speed Insights and expand the file 2. Upload the images to the assets/files/[page#] directory and overwrite the images generated by PW 3. Run GPSI again and your score will soar It's not a long-term answer but helpful in development.
-
@szabesz yes but stranger things happen on the web! The original PDF's are 'print-ready' so not web optimised and Robin S didn't say how they were 'adapted' to responsive web docs. Just putting an idea out there as an alternative to developing and maintaining a separate app... can all be done within PW.
-
Had a similar challenge, ie client needed access to PW generated documents when there was no internet access. My solution was to convert the PW pages to PDF and save them to a DropBox folder that synched with their mobile devices. There are many roads up the mountain
-
Lovely site and unbelievably fast. How did you do that?
-
Hey @heldercervantes Very nice. I want to go there! Chrome Developer inspector reported: The fontello css was missing on other pages too and guessing I didn't get to see the full beauty of the site due to the missing font?
-
@rick Thanks for the tip. Done
-
Hi @maxf5 See the kink in the border on larger screens more as a quirk than a bug . Have used the same technique on sites including my own. Kinda like it.
-
Client suddenly realised she needed a website in order to hand out her new business cards which had the website URL & email address, less than 2 weeks before her TED talk. Was given 1x logo, 1x photo, 1x phone screenshot of a paragraph of text and told she'd like to see the 'wings flying'. TED talk event 2 Nov 2017: https://www.ted.com/tedx/events/23988 End result landing page: https://beautifulhumanway.com/ Hopefully site will grow to show more of this amazing woman and her achievements Using PW 3.0.79 with delayed output and regions Modules (many thanks to @ryan and his pro modules): Profields: Functional fields Profields: Repeater Matrix ProCache FormBuilder MarkupSEO MarkupJson-LDSchema MarkupSimpleNavigation MarkupSrcSet EmailObfuscator and for a short time during development, PageProtector
-
get all unique values from a page-field in all pages …
psy replied to ngrmm's topic in API & Templates
Thanks @Robin S. too early in the morning. Realised I'd misread the requirement and edited my post. -
get all unique values from a page-field in all pages …
psy replied to ngrmm's topic in API & Templates
Nice -
Thank you @ryan for pointing me in the right direction. Problem solved. FormBuilder was a red herring, all good there. The cryptic debug message was key to finding the cause. I refer to the home page throughout the site and normally add $homePage = $pages->get('/'); in the _init.php file. Tried to be too clever and tweak page load speed by reducing the number of database calls so put the following below the LoginRegister code: // shortcut to home page saved in session $homePage = $session->get('home-page'); // Fairly certain this is the culprit! if (!$homePage) { $homePage = $pages->get('/'); $session->set('home-page', $homePage); } While the above works for $cache, it doesn't for $session, or even replacing $session with $_SESSION and using array_key_exists('home-page', $_SESSION), etc. Reverted to $homePage = $pages->get('/'); for every page and Login/Register working perfectly.
-
@wbmnfktr Wow! Thank you again. I'm still having problems. My forms are embedded via the API. Back to the drawing board
-
Managed to get Login/Register working on a clean install with no FormBuilder with a few minor tweaks to the code: Firstly, to be on the safe side, I changed $page->url to $page->httpUrl. Secondly, on occasion my frontend page named 'login' got confused with the admin page named 'login' so specified exactly where to redirect. if(!$user->isLoggedin() && $page->id!=1193) { // not for login page $session->set('returnPage', $page->httpUrl); $session->redirect($pages->get(1193)->url); } Still having issues with SessionCSRF with LoginRegister + FormBuilder. Will post in the FB forum. Thanks