Jump to content

baronmunchowsen

Members
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

2 Neutral

About baronmunchowsen

  • Rank
    Newbie

Recent Profile Visitors

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

  1. I have a repeater matrix that is used on multiple pages. The repeater matrix contains the following repeater matrix types: quote, hero, text, ... 'quote' is made up of 3 fields: quote_text, quote_source, quote_link I would like to return all instances of the matrix repeater type 'quote' used on any pages. Ideally I would have an array of objects that I could then access the 3 quote fields from. Is this possible within the processwire field/page api? Many thanks for any insights.
  2. Thanks @MoritzLost I implemented similar to as follows, which itself could be abstracted to a function or method: $cache_key = '...some cache key...'; $response = $response = $this->cache->getRaw($cache_key, 120); if(!$response) { $response = '{...some json response...}'; $this->cache->saveRaw($cache_key, $response, 120); } return $response;
  3. @MoritzLost Do you have an example of using your getRaw hook with a function as a fallback (see last example: https://processwire.com/api/ref/wire-cache/get/) In this scenario, the returned value of the function is set as the cache value, but this falls back to the $cache->save where, ideally, it would use the saveRaw. Would you recommend not using the function fallback and instead using getRaw and saveRaw (based on the value returned from getRaw). Thanks!
  4. Awesome - thanks for the notes @MoritzLost and for the direction @BitPoet - will take a look at that and upvote. Cheers,
  5. Thanks for confirming what I had suspected. For anyone interested here's the method https://github.com/processwire/processwire/blob/master/wire/core/WireCache.php#L1229 which is implemented in various places in the WireCache module. For what it's worth (not much likely!) I'd agree that this is indeed being too clever, and suggest that ideally you'd get out of the cache exactly what you put into it, not an interpretation of that data. Cheers,
  6. I have found that if I store a JSON string in wirecache https://processwire.com/api/ref/wire-cache/, I get an array, not a string back... $response = $this->cache->get('mycache', 60, function() { return '{ "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } }'; }); First call, when the cache is set, returns a string (expected). Subsequent calls to retrieve cached data do not return a string, but an array (unexpected). Any thoughts? Am I missing something? Thanks
  7. Thanks @Mike Rockett for the help ~ I'll take a look at the mapping collections and use the existing solution for query strings.
  8. Hi there - looking for some support help: Ordering/Prioritization of Jumplinks Is there any way to ensure one or more jumplinks get processed before another: e.g. blog/old-url => new-blog/new-url gets run before - blog/{all} => new-blog/{all} Query Strings Is there any way to ensure that any query string is attached to the destination without having to write a specific redirect e.g. old-page-url?foo=bar => new-page-url?foo=bar I have this in place with the following 2 jumplinks: old-page-url => new-page-url and old-page-url?{all} => new-page-url?{all} but it seems like this should be feasible in one jumplink? Sorry these questions are fairly simple - I feel like I'm missing something staring me right in the face. Thanks
  9. Hi, Wondering if anyone can advise on the following 2 use cases for site running at https://example.com (so $config->httpHosts array in config.php contains example.com) Want to create link to https://subdomain.example.com however cannot do this as example.com is present and so looks for an internal link Want to create a mailto link such as mailto:user@example.com however cannot do this. Changing the site to run at www.example.com solves (1) but does not solve (2). Thanks in advance for any advice.
×
×
  • Create New...