Jump to content

fliwire

Members
  • Posts

    64
  • 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. Same issue: $collections->sync_queue("product={$product}, limit=1"); // this not work in hook $collections->sync_queue->find("product={$product}, limit=1"); // this works if pagination limit not enabled in settings.
  2. My access to support form expired. sync_queue is a "ProFields: Table field". Version: Table 0.2.3 // ready.php $wire->addHookBefore( "Pages::saveReady(template=collection)", function (HookEvent $event) { $page = $event->arguments(0); if ($page->sync_add) { $collections = pages()->get("template=collections"); $collections->of(false); foreach ($page->children() as $key => $product) { $queue = $collections->sync_queue("product={$product}, limit=1"); // always give 1 count can't check if already added. if (!$queue->count) { $q = $collections->sync_queue->makeBlankItem(); $q->product = $product; $q->date = time(); $collections->sync_queue->add($q); $collections->save('sync_queue'); } } // This works $home = pages("/"); $http = new WireHttp(); $response = $http->post($home->httpUrl, [ "collection" => $page->id, "sync_add" => $page->sync_add, ]); } $page->sync_add = 0; $event->removeHook(null); } ); // home.php $collection = input("post", "collection", "int"); $sync_add = input("post", "sync_add", "int"); $collection = pages()->get("template=collection, id={$collection}"); if ($collection->id && $sync_add) { $products = $collection->children(); $collections = pages()->get("template=collections"); $collections->of(false); foreach ($products as $key => $product) { // Only add product one time $queue = $collections->sync_queue("product={$product}, limit=1"); // this works as expected if (!$queue->count) { $q = $collections->sync_queue->makeBlankItem(); $q->product = $product; $q->date = time(); $collections->sync_queue->add($q); $collections->save('sync_queue'); } } }
  3. <?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, ]); }); ?>
  4. 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>
  5. you can set password and other settings in config.php WireMailSmtp/WireMailSmtpConfig.php at master · horst-n/WireMailSmtp · GitHub $config->wiremailsmtp = [ "smtp_password" => "test", ];
  6. hotwire, unpoly doesnt require any backend language. mostly use with pw: Unpoly: Unobtrusive JavaScript framework
  7. 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; } });
  8. https://developers.google.com/search/docs/advanced/robots/create-robots-txt
  9. 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.
  10. SameSite cookies explained (web.dev) u need https and set SameSite = "None"; $config->sessionCookieSameSite = "None";
  11. u can use unpoly. Layers - Unpoly <a href="/post-page" up-layer="new" up-target='.content'>Open Content</a>
  12. 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
  13. 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); });
×
×
  • Create New...