Jump to content

fliwire

Members
  • Posts

    62
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

fliwire's Achievements

Full Member

Full Member (4/6)

24

Reputation

  1. <?php $home = pages("/"); echo cache()->get('offcanvas-nav', 10, function() { return ukNav($home->and($home->children), [ 'depth' => 2, 'accordion' => false, 'type' => 'default', 'class' => '', // 'blockParents' => [ 'blog' ], 'repeatParent' => true, 'noNavQty' => 20, 'maxItems' => 16, 'divider' => false, ]); }); ?>
  2. install it via composer and than how init latte? tried breadcrumbs code not working? <ul> <li n:foreach="$page->parents()->add($page) as $item"> <a href="{$item->url}" n:tag-if="$item->id != $page->id"> {$item->title} </a> </li> </ul>
  3. you can set password and other settings in config.php WireMailSmtp/WireMailSmtpConfig.php at master · horst-n/WireMailSmtp · GitHub $config->wiremailsmtp = [ "smtp_password" => "test", ];
  4. hotwire, unpoly doesnt require any backend language. mostly use with pw: Unpoly: Unobtrusive JavaScript framework
  5. delete " - site name" from module settings and add "site name" if not home page. $wire->addHookAfter('SeoMaestro::renderSeoDataValue', function (HookEvent $event) use ($settings) { $group = $event->arguments(0); $name = $event->arguments(1); $value = $event->arguments(2); $page = wire("page"); if ($page->id != 1 && $group === 'meta' && $name === 'title') { $event->return = $value . ' - ' . $settings->site_name; } });
  6. https://developers.google.com/search/docs/advanced/robots/create-robots-txt
  7. make sure u have latest master version 3.0.184. sessionCookieSameSite added 3.0.178 ProcessWire Weekly #366 or add to htaccess <ifmodule mod_headers.c> Header always edit Set-Cookie ^(.*)$ $1;SameSite=None;Secure </ifmodule> u should have no issue.
  8. SameSite cookies explained (web.dev) u need https and set SameSite = "None"; $config->sessionCookieSameSite = "None";
  9. u can use unpoly. Layers - Unpoly <a href="/post-page" up-layer="new" up-target='.content'>Open Content</a>
  10. hi @Sebi found that that was server fault. AUTHORIZATION headers not set. cant find what apache module should enable but .htaccess solve my issue. SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
  11. hi need to add custom variable to every request . Token has an_id value and need to fetch user data from another database. Tried bottom code but $tokenString is empty. Simply need to add $token->an_id value to request $data object. wire()->addHookBefore('Router::handle', function (HookEvent $event) { $auth = Auth::getInstance(); $tokenString = Auth::getInstance()->getBearerToken(); // if ($tokenString === null || !is_string($tokenString) || empty($tokenString)) { // return false; // } // throws exception if token is invalid: // try { // $secret = $auth->application->getTokenSecret(); // if (!$singleJwt) { // $secret = $auth->application->getAccesstokenSecret(); // } // $token = JWT::decode($tokenString, $secret, ['HS256']); // } catch (\Firebase\JWT\ExpiredException $e) { // throw new AccesstokenExpiredException(); // } catch (\Firebase\JWT\BeforeValidException $e) { // throw new AccesstokenNotBeforeException(); // } catch (\Throwable $e) { // throw new AccesstokenInvalidException(); // } $routeInfo = $event->arguments(0); $routeInfo[2]["an_id"] = $token->an_id; $event->arguments(0, $routeInfo); });
  12. module bug or wrong usage ? ptable has 3 row data // this work $page->of(false); foreach ($page->ptable() as $key => $item) { $item->test = "test444"; } $page->save("ptable"); // this not works // any selector cause not save $page->of(false); foreach ($page->ptable("start=0, limit=10") as $key => $item) { $item->test = "test444"; } $page->save("ptable");
  13. how to disable validation with processInput hook? Or maybe better solved this problem? Tried to load custom options and save value. $wire->addHookBefore('InputfieldSelect::render', function (HookEvent $event) { $InputfieldSelect = $event->object; if ($InputfieldSelect->name == "dselect") { $page = wire("page"); $event->replace = true; $options = [ "1" => "test2", "2" => "test3", "3" => "test4", ]; $attrs = $InputfieldSelect->getAttributes(); unset($attrs['value']); foreach ($options as $key => $value) { $selected = $key == $page->dselect ? "selected" : ""; $out .= "<option value='{$key}' $selected>{$value}</option>"; } $out = "<select " . $InputfieldSelect->getAttributesString($attrs) . ">{$out}</select>"; $event->return = $out; } }); // tried for disable validation $wire->addHookBefore('InputfieldSelect::processInput', function (HookEvent $event) { $field = $event->object; if ($field->attr('name') == "dselect") { $page = wire("page"); $event->replace = true; // $field->setAttribute('value', input("post", "dselect")); $event->arguments(0, $field); } });
×
×
  • Create New...