Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by sz-ligatur

  1. Hi dotnetic, I try to use your /processwire-language-pack-helper setup. I've got it running locally so far, but whenever I try to edit a language file I get the error: ProcessWire: ProcessLanguageTranslator: Unable to load textdomain Any ideas whats wrong? Another question regarding translations and suggestions for edits: in case of changes for existing terms – is it intended to first discuss any change here or should I make my PR in any case and it's up to you to accept or deny it? (for example I would suggest to replace "Umdrehen" with "Spiegeln" at the image action select - like its used to be called in all image-editors). Thank you!
  2. btw at https://processwire.com/modules/german/ the link for Download is broken now (https://github.com/jmartsch/pw-lang-de/archive/master.zip) (I guess ist should read /main.zip)?
  3. I'm not sure if that fit to your needs - I did that before in a template file, for a page that renders different output depending on URL segments: //the custom url $itemurl = "{$page->httpUrl}/{$slug}"; //alter seomaestros canonical url $page->seo->meta->canonicalUrl = $itemurl; // set custom og:url $wire->addHookAfter('SeoMaestro::renderMetatags', function (HookEvent $event) use($itemurl) { $tags = $event->arguments(0); $group = $event->arguments(1); if ($group === 'opengraph') { $tags['url'] = '<meta property="og:url" content="'.$itemurl.'">'; $event->return = $tags; } });
  4. …ah… thank you adrian! I rember seeing that before. The whole change from v0.2.0 to v0.3.0 is kind of nebulous for me… I should read about namespacing I guess. And it works! I namespaced all my hanna codes now, changed all wire('…') to $…-> and prefixed my custom function calls as you mentioned.
  5. Ah, I forgot to mention it, I tried already – adding <?php Namespace Processwire; doesn't change anything…
  6. I have trouble with latest update v0.3.0 – my hanna code stops working. In v0.2.0 I could use #1: wire("pages")->get($someid) – in v0.3.0 it throws error "Call to undefined function wire()". It's easily fixed by calling $pages->get($someid) instead - but I wonder why it's now the opposite as it was in v0.2.0 where I couldn't use $pages? #2: Inside the hanna code I call custom functions defined in _func.php (included @ready.php – I once moved the include from site/_init.php to ready.php to be able to use the shared functions in hanna code). That worked with v0.2.0, now in v0.3.0 I receive the same error as above "Call to undefined function myFunction()"s I guess I've got something basically wrong here… I have no clue how to get my custom functions work inside hanna code. Anybody can shed a light … ? ProcessWire: 3.0.165 PHP: 7.4.11
  7. Hello kixe, I guess it's a good idea that the pph-module is working silently in the background for non-super-users. And your examples are good to know and helpful. Thank you for your instant reply!
  8. Hello, I have a need, that the pagepath-history module should be accessible for a certain editor role (the output like under "settings"-tab › " What other URLs redirect to this page?" @page-edit). Is there a way to achieve this for core modules? E.g. add permissions for a module via hooks?
  9. Hi Robin - thank you for your improvement on that. I guess there is a typo in CustomInputfieldDependencies.module @Line 52, the comma breaks the installation… $this->hideInputfield($inputfield, $field,);
  10. After changing a table field to paginated (limit = 30) I can't figure out the right tags to display the total in admin list label. My current template settings for fields to display in admin lists looked like this: Termine: {schedule.count} – but this now displays only the count of page #1. Is there an equivalent tag for getTotal() in the field options? I tried {schedule.total}, {schedule.gettotal} … with no success. Can anybody point me in the right direction?
  11. @Wanze – congratulations for version 1.0.0 and a big thank you! @adrian: i've got it working now to correctly display the og:image in admin view – below the hook with inheritance mode as follows: if page og:image is empty, travel up tree until there is one at closest parent, use this. If no og:image found until home use default og:image from settings-page (a special page for sitewide settings). should go @ready.php /** * In addition to module SeoMaestro * if page has no og:image set, inherit from closest parent with given og:image * if no og:image is set in branch until home -> fallback to default og:image @settings-page */ $this->addHookAfter('SeoMaestro::renderSeoDataValue', function (HookEvent $event) { $group = $event->arguments(0); $name = $event->arguments(1); $value = $event->arguments(2); $isAdmin = ($this->page->rootParent->id == 2); if ($isAdmin) { $page = wire('pages')->get(wire('input')->get->id); } else { $page = $event->wire('page'); } $field = "og_image"; // used field for og:image // @config: one element or NULL if empty // no default output if empty $configpage = "1049"; // holding site-wide default og:image (og_image here set as required) if ($group === 'opengraph' && $name === 'image') { bd('og image is: '.$value); bd('page is: '.$page->id); // do nothing if page has og:image if ($value !== "") return; $sitedefaultimage = wire('pages')->get($configpage)->getFormatted('og_image'); //scenario 1: fetch default image assigned in field-settings (get formatted) // config field settings @og_image accordingly, what page to use if empty //scenario 2: inherit from next upper parent-page in tree with assigned image // @config @og_image: no setting for default value $selector = "og_image.count>'0'"; $option = $page->parent($selector); if ($option->id) { $value = $option->getFormatted($field); $src = $option->title; } else { $value = $sitedefaultimage; $src = "site-settings"; } $value = $value->httpUrl; bd("og:image inherited from: {$src}\n{$value}"); $event->return = $value; } }); I corrected $value = $value->url; to $value = $value->httpUrl;
  12. Hi adrian, I had a similar situation, and found an editor friendly solution using hooks: https://github.com/wanze/SeoMaestro/issues/8#issuecomment-486658463 Maybe that's a starting point?
  13. Hi BitPoet, thank you for that module, I'm quite happy cause I just recognized that it's not possible to use a multiplierfield in formbuilder forms – so your solution looks promising. I tried it with a single textfield and it works as expected. Except if the form validation forces the form to load again. Than the multiplier fields get messed up (cloned again) – and after a second submit error the fields are empty. Is this maybe related to a version conflict or is the repopulation after submit-errors just not implemented? ProcessWire: 3.0.123 FormBuilder 40/ states 39(?), FormBuilder Fieldset Multiplier 0.0.6 Form embed used: template embed (option B) Thanks for any help or hint…
  14. …ahhh – I see. That makes sense. Thank you!
  15. Maybe I get things wrong… I copied your js example-code now to my snippet file (and added the missed .js extension) – now there is no error anymore, but the snippets @file doesn't show up. I still see the snippets stored in local storage. The content (json) structure in local storage (code, modified, name) looks different from your example js code (name, content, tabTrigger)… I wonder if your code maybe is related to the snippet-runner panel? BTW. what means tabTrigger here? Sorry for all my confusion and thank you for your instant reply Adrian.
  16. Save Custom Snippets @file gives js error. Pwire: v3.0.123, TracyDebugger: v4.19.35 I try to save my custom snippets as given in the options at a local snippet file instead of LocalStorage in the browser. I have set up path and file, but on initializing td console after page load I see this error @browser console: Uncaught ReferenceError: getCustomCodeSnippets is not defined at <anonymous>:1:192812 at HTMLScriptElement.script.onreadystatechange.script.onload [as onreadystatechange] (?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:1353) (anonymous) @ VM2077:1 script.onreadystatechange.script.onload @ ?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:1353 load (async) load @ ?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:1351 (anonymous) @ VM2077:1 script.onreadystatechange.script.onload @ ?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:1353 load (async) load @ ?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:1351 (anonymous) @ VM2077:1 (anonymous) @ ace.js:1 (anonymous) @ ace.js:1 n @ ace.js:1 a @ ace.js:1 a @ ace.js:1 i.onload.i.onreadystatechange @ ace.js:1 load (async) t.loadScript @ ace.js:1 t.loadModule @ ace.js:1 (anonymous) @ VM2077:1 script.onreadystatechange.script.onload @ ?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:1353 load (async) load @ ?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:1351 (anonymous) @ VM2077:1 (anonymous) @ ?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:531 evalScripts @ ?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:525 init @ ?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:37 (anonymous) @ ?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:306 setTimeout (async) (anonymous) @ ?login=1&_tracy_bar=js&v=2.6.3&XDEBUG_SESSION_STOP=1:301 Any idea what's wrong? Thanks for any hint!
  17. It was my mistake – I use a download-file template, that forces downloading a pdf. To track this I used $page->save('phits') to update the counter. Obviously this is a page edit… by guest. if ( $user->isGuest() ) { $page->phits += 1; $page->of(false); //$page->save('phits'); $page->save('phits', array('quiet' => true)); $page->of(true); } The added option 'quiet' does the trick…
  18. A very nice simple tracker - thank you David. I have one issue – just realized, that pages with tracking activated are "edited" by each hit by "guest" (field phits) – that's obvious. In combination with the module "changelog" – where I want to list pages last edited only by editors – the "edited by guest" makes it difficult to filter out what my editor colleagues have changed recently. Maybe it's worth adding an option to set the field->save method to "quiet"? https://processwire.com/api/ref/pages/save-field/
  19. … and it works – thank you so much – your fix arrived just in time :o)
  20. Hi Maestros, I just recognized, that the meta_title_format field ist not correctly interpreted in language variants – instead the default language is used in the outputted markup. Can anybody confirm this? Any ideas where and how to fix this behavior? Please see attached screenshot. (SeoMaestro 0.8.0, pwire 3.0.123)
  • Create New...