Jump to content

sebibu

Members
  • Posts

    53
  • Joined

  • Last visited

Everything posted by sebibu

  1. Thanks for your help! Trying.. {var $map = wire('modules')->get('MarkupLeafletMap')} {$map->render($page, 'map')} ..in RockPageBuilder block LATTE-file I get: Call to undefined function wire() in block Trying.. {var $map = $this->$wire('modules')->get('MarkupLeafletMap')} {$map->render($page, 'map')} .. I get: Method name must be a string in block Now I'm confused. πŸ˜† What I'm doing wrong?
  2. Thx @wbmnfktr for taking on ProcessWire Recipes and the time for caring and asking this questions! To be honest.. Yes, I would expect (and maybe even demandπŸ˜‡) that ProcessWire related projects like this are built with ProcessWire itself. Especially for sites with structured and tagged content like on ProcessWire Recipes, PW is predestined, I think.πŸ˜‰πŸ™‹β€β™‚οΈ
  3. I really love LATTE (Template Engine by Nette) but here and there I still have problems with the syntax. I'm using RockPageBuilder by @bernhard and try to output the html for this module: https://processwire.com/modules/fieldtype-leaflet-map-marker/ In PHP this would be: <?php echo $map->render($page, 'YOUR MARKER FIELD'); ?> And in LATTE? πŸ˜† I tried this variants and more: {$map->render($page, 'map')} {$map->render($page, 'block->map')} {$map->render($page, $block->map)} Getting: Call to a member function render() on null in block #1158 (rockpagebuilderblock-map) Maybe this topic can be a collection point for smaller Latte syntax questions.
  4. Thank you @poljpocket for this good optimizations!πŸ‘ While searching for hooks I stumpled across this syntax but didn't tested and then forgot it.πŸ€“
  5. Thank you @bernhard for helping optimizing the code!πŸ‘ For checking the template field I already used a guard clause, but for the template check it makes sense and is more readable to use it, too. I would like to keep the german special characters like Àâüß instead of exchanging (->pageNameTranslate) them with ae, oe, ue, ss. So wire('sanitizer')->pageNameUTF8($title); should be the way to go. Right?
  6. Hey Procis, wrote this - and my very first - hook β€žPrepend date in page nameβ€œ, yesterday. Once you get it, this system and the API is magnificent. Thank you @ryan and @all contributers! On new (news) pages it works great so far. E.g.: Title: Testnews mit ÜmlÀüten Altered page name: 2024-09-24-testnews-mit-ΓΌmlÀüten But on existing pages special characters are removed. E.g. Title: Partnerschaftliche UnterstΓΌtzung - Ihr werdet gesucht! Altered page name: 2023-07-27-fans1991-partnerschaftliche-untersttzung-ihr-werdet-gesucht Another example is attached. There you can see, that the ProcessPageEdit-message shows the right path!? I have this in my site/config.php to allow only german special characters: $config->pageNameCharset = 'UTF8'; $config->pageNameWhitelist = '-_abcdefghijklmnopqrstuvwxyz0123456789Àâüß'; Temporary uninstalled Module β€žPagePathHistoryβ€œ with no look. The code of my hook (suggestions for improvement are very welcome!): /* NEWS pages only: prepend date in page-name */ $wire->addHookAfter('Pages::saveReady', function($event) { // get current Page object β€” in this case this is the first argument for the $event object $page = $event->arguments(0); // Only for pages with news template if($page->template == 'news') { // Test if field day exists, otherwise exit if (!$page->template->hasField('day')) { $event->message("Field 'day' is missing!"); return; } $title = $page->get('title'); // Sanitize title and substitute special characters $optimizedTitle = wire('sanitizer')->pageNameUTF8($title); //$optimizedTitle = wire('sanitizer')->pageName($title, Sanitizer::okUTF8); // or translate option $date = wireDate('Y-m-d', $page->day); // Set output formatting state off, for page manipulation $page->of(false); $page->name = $date.'-'.$optimizedTitle; //$page->save('name'); $event->message("New saved name is $page->name"); //$event->message("Path of new saved page is $page->path"); } }); Any idea why this doesn't works on all existing news, too? Thx and πŸ‘‹ Sebastian
  7. Thanks @bernhard for helping me out yesterday! Will try to include jQuery only on the necessary pages with a different implementation in the new week.
  8. @bernhard Do you have any ideas on this? Thx & greetings!?
  9. Any idea why editing blocks does not open up in a modal anymore for editors and superusers on both websites I'm using RPB? Seems like for the first milliseconds it opens a modal but then follows a normal pagerequest to the RockPageBuilderBlocks-site. I browsed my configuration, the docs the last days and editors do have the permission `page-edit-front`. I'm without further ideas..?
  10. I agree with that. Thanks @Stefanowitschfor the first impressions. Looks great. I am looking forward to your whole showcase! Thanks also for showing the block-actions-setting-syntax! That would have been the next thing i would have asked, I didn't find that in the docs. Did I missed it or otherwise could you please add it, @bernhard? A search function on your site for the docs would be convenient and probably saves you a few questions.
  11. Thanks for the in-depth knowledge to this, @bernhard! I used this before but tried to avoid it for security reasons. The background is.. At one time the block-actions were not visible, so I suspected it could be the noescape-filter. Yesterday I realized by chance, that block-actions are not visible when using the β€žhide topbarβ€œ-button in the RockFrontend Topbar. I don't find that logical. Can you please separate this two functions in two topbar-buttons?
  12. Thanks for the valuable clarification, @bernhard! I'm still a newbie to PW and the API. One last question for today?: What could be the reason the RPB-content is outputted like this?? <section id="b1672" class="rpb-text" data-rpbblock=1672 alfred='{"icons":[{"icon":"edit","tooltip":"Edit Block #1672","href":"\/rs\/page\/edit\/?id=1672&language=1062","class":"pw-modal alfred-edit","suffix":"data-buttons=\"button.ui-button[type=submit]\" data-autoclose data-reload"},{"icon":"up","label":"","tooltip":"vSpace top default","type":"vspacetop","widget":1672},{"icon":"down","label":"","tooltip":"vSpace bottom default","type":"vspacebottom","widget":1672},{"icon":"clone","label":"","tooltip":"Clone Block #1672","href":"\/rs\/rockpagebuilder\/clone …
  13. Okay, I had a board in front of my head.? <div class="uk-child-width-1-2@s" uk-grid> <div>{$block->rpb_left->render()}</div> <div>{$block->rpb_right->render()}</div> </div>
  14. While testing I tried your version, too @bernhard but getting this.. Unknown Selector operator: '[empty]' -- was your selector value properly escaped? field='1672', value='', selector: '1672' in block #1671 (rockpagebuilderblock-twocolumns) This syntax works: ☺️ {$pages->get("$block->rpb_left")->text()} Looking forward to the insights @Stefanowitsch might have.? Any idea on how to output all possible blocktypes (like text, image,..) clever for both columns?
  15. Thx for your quick answer, @bernhard! This is exactly what I tried ( My blocks name is only TwoColumns instead of layout.?), but unfortunately it's from the backend-side not that intuitive then in the CMS/screenshot above. However.. how can I get the content of the blocks inside a block with LATTE? I tried this but curly brackets in curly brackets are not allowed.? {$pages->get({$block->rpb_left})->text()} Thanks in advance!
  16. @bernhard I love your Modules for the well structured and OOP-way with lots of possibilities for advanced users to hook in and extend functionalities. In RockPageBuilder I'm still missing a way to visual integrate two and more-columns layout simple and intuitive in blocks (not templates!) like this in MODX. Can I achive this in any way? Thx and greetings to Vienna?
  17. Oh, that helps a lot! Thanks @AndZyk!!??
  18. Thanks @bernhard! Yesterday I was asking myself if my client has been active in the new system as promised and tried to find and filter a managerlog like in my CMS I used before PW. Now I installed ProcessLoginHistory for the future, but the passed data isn't there. Having that functionality in the core from the installation on would make sense for this case, GDPR and system security in general.. in my opinion. Otherwise or maybe anyway I have to use PW-profiles or similar for my new projects to have the basic extensions and customizations directly at hand.
  19. Directly another question.? To save the editor the trouble of entering a dropdown field, I would like to determine the value of a dropdown field in the next (and probably only) pagetree-upper page having a template with template-id e.g. = 50. Is this also possible only with Latte or do I have to determine the value in PHP first?? Thx!?
  20. Thanks to all three of you! Learned something new again. I'm on PHP8 and because the $page object should be existent on every page, this should be sufficient and works great: <body n:class="$page->category?->value"> ??
  21. I am also already in love with Latte, but curiously enough can't find a solution to output a fieldvalue only if it exists. Ideally with short code and output class-tag only if the value exists. What I tried: <body n:class="$page->category->value !== '' ? $page->category->value"> // Unexpected end, expecting for element started on line 46 at column 5 (in '.../sections/header.latte' on line 120 at column 26) {if $page->category->value !== ''}{$page->category->value}{/if} or <body n:class="$page->category->value !== '' ? $page->category->value"> // 2 x PHP Warning: Attempt to read property "value" on null in .../Latte/templates-sections-header.latte--27db76d0dd.php:53 I'm sure it's so easy.? Can you help me out?
  22. I just installed and played around with AdminStyleRock and AdminThemeBoss to be a little bit prepared. Good points! I agree with you. I think it makes sense to design all action related things (mostly buttons) with the same striking color. Normal mode and dark mode should IMO be separated from the color contrast topic. Normal mode bright and friendly. Dark mode to work more relaxed in the dark and to generate less ambient light. Just seen.. with AdminStyleRock the Offcanvas mobile menu looks as if it was not styled. Is that intentional? In any case, the colors are very contrasting. Looking forward to see in a few minutes! Sebastian
  23. Okay, changing a template with same RPB-fields preserves content. But changing the template of a page to a template without the former RPB-field deletes the content. Even if you change the template back. Hope that helps for this topic, which is obviously and unfortunately not of interest for you.
  24. ? So let's go!? For editors who prefer to change content in the backend, editing content/blocks already in 2 or 3 columns is way more natural. Moreover, when selecting "2-column layout" then there are still 3 RPB-fields of which you are not allowed to use the last one, if I understand you right.?
Γ—
Γ—
  • Create New...