Jump to content

psy

Members
  • Posts

    643
  • Joined

  • Last visited

  • Days Won

    8

psy last won the day on June 10 2024

psy had the most liked content!

3 Followers

Contact Methods

  • Website URL
    http://www.clipmagic.com.au

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

9,251 profile views

psy's Achievements

Hero Member

Hero Member (6/6)

952

Reputation

  1. And the final piece of the puzzle, again thanks to @Robin S, in site/templates/admin.php, see this post: $wire->addHookAfter('AdminTheme::getExtraMarkup', function(HookEvent $event) { $scripts = wire('files')->render('inc/admin-tpl-hook'); $parts = $event->return; $parts['head'] .= $scripts; $event->return = $parts; });
  2. AFAIK, a PageFiles field shows all files, including file descriptions, tags, etc. The visibility option is for the entire field. It would be helpful to minimise the file list in admin to filename or custom fields, eg {basename} {modified}, only in the admin area similar to repeaters. A down arrow could expand individual file meta. When a page has lots of attached files, it's cumbersome to scroll through all the files with descriptions & tags when the field visibility is "Open".
  3. First time I've ever encountered this warning message and unsure how to resolve. Scenario: Customer is a long-time PW client in Australia who is moving to the UK. The web host created a new account hosted in Germany and copied all the AU files and DB to the new hosting account/location, Germany being their closest hosting centre to the UK. Time diff between Germany and UK is 1hr Time diff between Australia and Germany is 10hrs Site is working with new URL, etc The new PHP time zone needs to be "Europe/London" and $config->timezone is set to same Times are important as the client will be taking online appointment bookings. How do I match the DB time to the new UK time zone? Solution: In 'site/config.php' immediately after the database connection info: $config->dbInitCommand = "SET NAMES '{charset}', time_zone = 'Europe/London' "; Where {charset} can be utf8 or utf8mb4 depending on your setup
  4. Using v1.0.14 which fixes a problem for multi-language sites. Unfortunately it breaks single language sites as it assumes multi-language support is installed. Fix for me was: public function ___wakeupValue(Page $page, Field $field, $value) { $field = $field->getContext($page); $this->svg = $field->get("format") !== "gif"; $this->markup = $field->get("markup") === 1; $user = $this->user; $languages = null; if(wire('modules')->isInstalled("LanguagesSupport")) $languages = $user->isGuest() ? [$user->language] : $page->getLanguages(); $sources = $this->parseSources($page, $field); return $this->generateQRCodes($page, $sources, $languages);
  5. Installed RockFrontend for the first time on a client dev site. Great work @bernhard! Client (superuser) is happy with the ability to modify content on the fly from the frontend. Had a few issues however with FormBuilder conflicts. When I render a FormBuilder form on page via the api, and manually add its styles and scripts in the <head> tag, RFE js fails with RockFrondEnd not found. Worked around this by embedding the form via the api so no js conflicts How do I turn off LiveReload for a guest user? Another form is in a 'body' field that is ALFRED enabled, with FormBuilder Method A, see attached image. The LiveReload code still loads and screws the FormBuilder CSRF check even though the user is not logged in. Work around was to turn off CSRF Check on the form but would prefer to have it enabled. Using: PW: 3.0.237 RockFrontEnd: 3.18.2 FormBuilder: 0.5.5
  6. No question, ProcessWire is fabulous for developers and the suggestions above would make it even better. Customers who are not developers are increasingly giving me feedback about how unintuitive the backend admin/editor is, especially now with the proliferation of DIY pagebuilders. Clients don't understand or care about the consequences. They care about not having to learn code to easily update their sites. They want the backend to look similar to the frontend, the convenience of doing it themselves without having to pay a developer. Too bad if the site doesn't work on all screen sizes, light/dark modes, isn't accessible, the home page looks like a ransom note, whatever. They genuinely don't like the default PW admin UI/UX. Pagegrid and RockPageBuilder modules are leading the way to solve this issue. Kudos to both developers BUT the modules are premium while a WP site gives customers basic WYSIWG page editing out of the box. My vote is to overhaul the admin UI/UX to make editing pages more WYSIWIG.
  7. Agree with @BrendonKoz. A vertical list on mobile is boring and no one scrolls on a carousel. The thing that has worked best for me is to shuffle the list. This has several benefits: No sponsor can complain their logo isn't visible - all have an equal opportunity Page content is constantly fresh which keeps the search engines happy Maybe on mobile have a small number of random logos on the home page/footer and a button linking to a sponsor list page. Have clients take this one step further and give each sponsor a dedicated page after clicking on their logo. Again this has worked well for SEO especially when the sponsor shared their page on their socials.
  8. Here is a CSS-only solution to this exact problem from Kevin Powell:
  9. [solved] And so it happened again but this time it was same but different. Two weeks ago, all worked perfectly according to the LRP recipes. Today the fe user wouldn't log in??? I could login to the protected pages as superuser. Checked all the advice given in above and other posts. I had not changed anything on the site and nothing recorded in the logs, Tracy Debugger etc. The only hint was in the Chrome browser dev tools that the LoginRegisterPro init() function wasn't loaded. I'm using MarkupRegions and on the latest versions of PW and LRP and PHP 8.1 My bad, I had in my template code: <region id="regHeadCSS" pw-append> <?php $loginRegister->renderStyles() ?> <?php $loginRegister->renderScripts() ?> </region> Should have been: <region id="regHeadCSS" pw-append> <?= $loginRegister->renderStyles() ?> <?= $loginRegister->renderScripts() ?> </region> OR: <region id="regHeadCSS" pw-append> <?php echo $loginRegister->renderStyles() ?> <?php echo $loginRegister->renderScripts() ?> </region> Still don't understand why it worked originally but all's well that ends well
  10. Try in your template: <?php // assuming 'matrix' is the name of your repeater matrix field if($page->hasField('matrix') && $page->matrix->count > 0) : echo $page->render('matrix'); else: echo $page->body; endif; ?>
  11. I'm familiar with $files->render and use it reguarly to include snippets in templates, passing PW vars to the snippet file. Came across a head-scratcher today. In my included snippet, I pass a PW WireArray as a var. I tried lots of variations in various browsers, all with the same result: When logged in as admin and viewing page, everything displays correctly When not logged in, ie guest user, only the included snippet HTML wrapper displayed on the frontend, not the output logic generated within the snippet The page has no viewing restrictions and the file permissions on the server all look good. Using: ProcessWire 3.0.234 PHP 8.1 Suggestions on how to fix or pointers to the documentation I may have missed, welcome. TIA psy Solution: The $files->render call was a red herring. The problem arose with my $pages->find selector. The requested page template is quite complex with a page reference field within a repeater and the parent page hidden from lists and searches. Seems PW struggled with all the complexities involving the repeater field filtering on a page reference field, especially when the page's parent was hidden, and user permissions. In one variation, the selector returned all the correct page ids as a string, despite not specifying same in the selector. Finally got it to work by making life easier for PW, ie: <?php $currency = 'USD'; $things = $pages->find("template=thing, page_thing_type.id=1040"); // get all the published pages with a template of 'thing' and page reference field id of 1040 $things->filter("rptr_currency_and_msrp.page_currency.title=$currency" ); // reduce the PageArray based on the repeater field's page reference field's title $thingItems = $page->getMythings($things, $currency); // do stuff with the filtered PageArray in a page class $files->render('inc/my_things',['lines' => $thingItems]);?> Now all displaying correctly for guest users and tested in multiple browsers.
  12. ChatGPT found MutationObserver and helped me solve a similar issue, ie modifying ajax-loaded page content on a 3rd party SaaS platform ?
×
×
  • Create New...