Jump to content

Stefanowitsch

Members
  • Posts

    387
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Stefanowitsch

  1. I keep getting this error message on all backend and frontend pages in one of my projects: ErrorException: Undefined array key 1 in /var/www/html/site/assets/cache/FileCompiler/site/modules/TracyDebugger/panels/TracyLogsPanel.php:71 Stack trace: #0 /var/www/html/site/assets/cache/FileCompiler/site/modules/TracyDebugger/panels/TracyLogsPanel.php(71): Tracy\Bar->Tracy\{closure}(2, '...', '...', 71) #1 /var/www/html/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.10.x/src/Tracy/Bar/Bar.php(142): TracyLogsPanel->getTab() #2 /var/www/html/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.10.x/src/Tracy/Bar/Bar.php(115): Tracy\Bar->renderPanels('') #3 /var/www/html/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.10.x/src/Tracy/Bar/Bar.php(89): Tracy\Bar->renderPartial('...') #4 /var/www/html/site/modules/TracyDebugger/tracy-2.10.x/src/Tracy/Debugger/DevelopmentStrategy.php(123): Tracy\Bar->render(Object(Tracy\DeferredContent)) #5 /var/www/html/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.10.x/src/Tracy/Debugger/Debugger.php(314): Tracy\DevelopmentStrategy->renderBar() #6 [internal function]: Tracy\Debugger::shutdownHandler() #7 {main} I am using the newest PW Version and the newest Tracy Debugger Version, can anybody give me a hint what is happening here?
  2. I have a little update on this procedure: When disabling the two-factor authorization it is straight-forward and fast to add the customers instagram account into the app. First you don't have to ask the customer for the security code (on each login attempt) and second you don't need to add the clients instagram account to your facebook accounts center in the first place. When the app is working the client can feel free to re-activate the two-factor authorization.
  3. @bernhard another quick question: Is it possible to change the color (the tiny little dot) or even better, the text or background color of a type of event? Each parent page of an event has a specific category. Every category has a primary color and I want to reflect this in the event overview calendar.
  4. I just finished integrating this module on a client website (it's not live yet!) . The client has roundabout 85 groups. Each group meets on a specific date - recurring! So I added a RockCalendar field for each group and created the recurring events for each group depending on their meeting times. The group meeting times vary massively and you can think about every possible combination for example: "every second and last tuesday in every second month" and so on... This was no problem with this module! After that you can easily view and modify the events for the specific group: After creating recurring events for all of the 85 groups we now have about 5000+ event pages in the backend. This is huge! As expected from ProcessWire I did not notice any downgrades in the performance. The last thing I did - with the help of @bernhard- was to set up an "overview calendar" in the backend to get a quick look at all occurring events (for all groups): If you know how to do it this is an easy thing. You can hook into the "getEvents" method of the RockCalendar module and return custom - or modified - event data. In my case the overview calendar field is placed on the "group overview" template. This template has no direct event page children, so the overview calendar did not display anything. I used this hook to collect all event pages within the range of a month and return those events as an PageArray to the module as event data (this hook needs to be placed into the init.php!) wire()->addHookAfter('RockCalendar::getEvents', function ($event) { $pageId = $event->arguments(0); $startDate = $event->arguments(1); $endDate = $event->arguments(2); $template = wire('pages')->get($pageId)->template->name; if ($template === 'gruppe-overview') { $events = wire('pages')->find("template=event, rockcalendar_date.inRange='".$startDate." - ".$endDate."'"); $event->return = $events; } }); There you go!
  5. Thanks! You are right. After removing the HTML Entity Encoder Text Formatter form the field the decoding works.
  6. I have a trivial problem that is driving me insane. I am saving JSON Data into a field: $groupOverview->json_calendar_data = json_encode($eventsData); $groupOverview->save(); The JSON string is valid, as I have testet. In the frontend I turn this string back into an array like this: $eventsData = json_decode($groupOverview->json_calendar_data, true); bd($eventsData); The problem is: It always returns NULL. Printing out the field value as string works fine though, this is not a field selector issue.
  7. hi @bernhard I need a hint how to sort the events based on the "start time" in the rockcalendar_date field. I am collecting multiple events from multiple pages and put them all into one page array. Since the events are already sorted by date in the backend this works fine. But i need to sort those collected events by the time they start to print them out in order in the frontend. Right now it looks like this: As you can see the start time is not ascending but random. I need to sort the events like this. This selector is not working, but see it as an example how I thought it could work 🙂 $events = $pages->find("parent=$groups, rockcalendar_date.inRange='".$startDate." - ".$endDate."', sort=rockcalendar_date.start"); Edit: Sorting does work when using the "rockcalendar_date" field as query parameter. $pages->find("template=event, rockcalendar_date.inRange='".$startDate." - ".$endDate."', sort=rockcalendar_date");
  8. Hi @bernhard, I showed this module to a client and we want to integrate your module in an existing project. I am talking about this site here which holds roundabout 85 "recurring event" pages: https://www.kibis-itzehoe.de/ The site structure looks like this (just a snippet) As far as I understand the integration of the RockCalendar module from your youtube video, my question is: What is the best practice to integrate already existing pages into the calendar without re-creating or moving them? Right now every "event page" is actually called a "group page" (because it is a group that meets on a specific recurring date). I understand that i have to re-adjust the recurring event details when integrating it into the RockCalendar view again. What I like to avoid is to create each of the 85 group pages as a new "event page" from the RockCalendar view in the first place.
  9. @nbcommunication As the deadline of the 4th December is coming closer I started abandoning the old InstagramBasicDisplayApi module and using your new version. Thank you for releasing the new version!! I once again experienced that it is a real "pain" to set up an app via the Facebook Developer Account and then do the authorization for the instagram account that is going to be used. Maybe I am doing it wrong but I would like to ask how you - and the other users of this module - handle the authorization for client instagram accounts. Let me explain: 1. The client has a instagram account (so far so good...) 2. To make the integration possible: does the client have to set up an own facebook developer account and create the "Instagram App" inside this account by himself? To be honest, none of my clients is capable of doing this on their own. Thats why: 3. I am using my own facebook developer account to create the app 4. But then theres the authorization process for the instagram account: - You have to log in with the clients instagram credentials two times. Once to add the actual account and allow to fetch data from it. And second to generate a token. - Each time you log in with the credentials the two factor authorization method comes into place and sends a security code to the mobile phone of - the client! So basically you need to set everything up "together" with the client. And another problem: To be able to add the account to the facebook app in the first place you first have to add the clients instagram account to your facebook accounts center. Otherwise you won't be able to do any of the steps mentioned here in step 4! And this also does only work with two factor authentification. So therefore I am asking: How do you handle the integration process? I am using the InstagramBasicDisplayApi module in very few projects and I don't really have best-practice in setting up the integration yet.
  10. A very good Video. This is a top feature of Rock Frontend for me!
  11. Hi @bernhard I have an older project where I am using SCSS instead of LESS files. I want to make use of the SCSS parser function of RockFrontend. 1. I installed the SCSS module 2. I added this code to my ready.php: /** @var Scss $scss */ $scss = $modules->get('Scss'); $watchFiles = $files->find( $config->paths->templates . "styles/css", ['extensions' => 'scss'] ); // compile input SCSS to output CSS $scss->compileIfChanged( input: $config->paths->templates . "styles/styles.scss", watch: $watchFiles, ); 3. My stylesheet is included like this: <? $rockfrontend->styles() ->add($config->urls->templates . 'styles/styles.scss') ->minify(!$config->debug); ?> When opening the website in my browser I get this exception: ProcessWire\WireException Method Scss::compileRF does not exist or is not callable in this context By looking in the StylesArray.php in the RockFrontend module folder, line 293 I can see that this method is called here: $compiler->compileRF($asset->basename, $cssFile, $cssPath, $asset->dir, $style, $sourcemap); But the Method "compileRF" does not exist anywhere inside the RockFrontend folder.
  12. Thanks! Now I understand what was happening. Removing the "int" argument let's me check via "isset" if any of those parameters are passed.
  13. Hi @bernhard While testing my ajax endpoint with RockFrontend I noticed a behaviour. This is more a ProcessWire related theme however, there is nothing wrong with the ajax endpoint feature itself. I am using the ajax endpoints to handle form submissions on my pages. The URL for a request looks like this: /ajax/form?pageId=1401&formId=1418&lang=1016 So I am passing three get variables here: 1. pageId 2. formId 3. lang Inside my endpoint php file I am passing those values with the files->render method to handle the form submission: echo $files->render('elements/_formular',['page' => $pages->get($pageId), 'form' => $pages->get($formId), 'lang' => $lang]); As long as I am calling the endpoint URL together with those parameters, everything is fine. If I just call: /ajax/form I receive a PHP error that one ore more of the variables are "NULL". This is obviously! Now comes the part that I don't really get: I am retreiving the GET values like this via the ProcessWire API: $pageId = $input->get('pageId','int'); But this variable returns two different values, depending on how I output them: bd($pageId); // returns "0" return $pageId // returns "" So to check if I am actually passing values via GET I use the following condition: if (isset($pageId, $formId, $lang)) { echo $files->render('elements/_formular',['page' => $pages->get($pageId), 'form' => $pages->get($formId), 'lang' => $lang]); } But this does not work, the variables are all set to "0" when I am passing no parameter (I would expect NULL). So the question is: How would you elegantly check of one of those variables are set?
  14. Sounds very promising @bernhard! I a past project I had the need of creating and managing recurring events, too. Back then there was no calendar module available for ProcessWire, so I wrote my own logic using PW repeater fields in combination with the RRULE PHP library. The interface for a event page looks like this. In this example the event occurs every third tuesday in every month from 4pm - 6pm. I handle the updates of the dates that are displayed in the frontend via a cronjob that runs every night. The date field then gets updated, based on the set of rules that are set for the event: What is handy feature for me is to get an overview of upcoming events. Either in a classic "calendar view" or maybe in a small list overview like here. I list all events within the current week:
  15. Okay, so you commented out the save method and used the saveReady hook instead? I will try this out! Saving inside the "saveReady" hook brought me some trouble because I got catched in an endless save-loop. Thats why I used the 'noHooks' option here.
  16. Hi @bernhard! I noticed that the Scrollclass Feature has stopped working in RockFrontend (I am on version 3.19.0) https://www.baumrock.com/en/processwire/modules/rockfrontend/docs/javascript/ See line 258 of RockFrontend.js, the variable declaration for "j" is missing here: for (j = 0; j < attrs.length; j++) { This same goes for line 264: scrollpos = window.scrollY; Here is the updated snipped that will work: /** * Add/remove class on scroll position * * Usage: * <a href='#' rf-scrollclass='show@300'>Add class "show" at 300px scrollposition</a> * * Add multiple classes (thx @StefanThumann) * <a href='#' rf-scrollclass='show@300 show2@600'>Add class "show" at 300px scrollposition, "show2" at 600px</a> */ (function () { let scrollElements = document.querySelectorAll("[rf-scrollclass]"); for (let i = 0; i < scrollElements.length; i++) { let el = scrollElements[i]; let attrs = el.getAttribute("rf-scrollclass").split(" "); for (let j = 0; j < attrs.length; j++) { let parts = attrs[j].split("@"); if (parts.length != 2) return; let cls = parts[0]; let y = parts[1] * 1; window.addEventListener("scroll", function () { let scrollpos = window.scrollY; if (scrollpos >= y) el.classList.add(cls); else el.classList.remove(cls); }); } } })();
  17. Have you found a solution for specifying multiple "upload_dirs" inside this initial config call? It seems not to work here.
  18. Can someone help me? Each time I create a new project with "ddev config" I have to adjust the then created config yaml file manually (php version, etc.). I know there is a global ddev config file located here: $HOME/.ddev/global_config.yaml As far as I understand I can add some configuration options there and each time I create a new project all the settings should be inherited from this global config file. Unfortunately that does not work, my additions just get ignored. I know I can add the arguments to my initial ddev config call like this: ddev config --php-version 8.3 But I have a few more additions and this command line is way to long just to type away. How do you handle this?
  19. Here's my solution to this. For anybody who might integrate it in a similar way: 1. Create a custom search index field and add it to the page templates that should be included in the search. The idea is that all RockPageBuilder blocks on a page will write "their content" into this field so that when searching for keywords the corresponding page (that includes a block) will be listed 2. Create a method called "createIndex" in each RockPageBuilder block class that you want to include in the search results. For example a simple Textblock would only return its body field: public function createIndex() { return "{$this->body}\n"; } 3 Make use of the Pages::saved Hook in ready.php to save the content of all RockPageBuilder bocks into the search index field: $wire->addHookAfter('Pages::saved', function($event) { $page = $event->arguments(0); $index = ''; // Iterate over all fields on the page foreach($page->fields as $field) { // Check if the field is of the type used by RockPageBuilder if ($field->type instanceof FieldTypeRockPageBuilder) { // Get the formatted content of the field $blocks = $page->getFormatted($field->name); // Further processing of the blocks if needed foreach($blocks as $block) { if (method_exists($block, 'createIndex')) { $index .= $block->createIndex(); } } } } //bd($index); // Save index to custom search index field $page->block_search_cache = $index; $page->save(['noHooks' => true]); }); 4. Inside your search template you can search for pages that contain blocks like this: $matches = $pages->find('block_search_cache%=' . $q);
  20. I just want to see which user did the latest changes on a specific block. In the backend page tree I modified the view like this: This works for pages but you can not see which page builder block (inside those pages) has been edited by which user.
  21. Hi @bernhard! I don't know if this is a RockFrontend or RockPageBuilder related question (or maybe only PageFrontEdit?). But here we go: In the PW backend I can see unter the "settings" tab of a page which user modified this page recently: $modifiedFormatted = date("d.m.y H:i", $page->modified); $lastModifiedByUser = $page->modifiedUser->name; Is it possible to display this information when editing a RPB Block in a modal window, for example on the top? Something like this:
  22. Thanks, bernhard. I will try this out. So basically each block saves it's own content into a hidden field that is part of the "parent" page template. That makes sense, it should work.
  23. I have not tried this before. So I would like to ask if it is -practically- possible to include RPB blocks in the search results. As far as I understand - each block is a separate page - so this makes searching a bit tricky. Because how does ProcessWire know where this particular RPB block is located in the frontend - I mean on which page? If I search for "lorem ipsum" (you get the Idea...) will the search result find the page where a RPB block is placed that contains this string?
  24. @heldercervantes Managing Content Blocks Previews with The RockPageBuilder is actually quite nice and super easy: All you have to do is take a preview-icon-picture and save it directly inside the corresponding block folder. It will show up automatically:
  25. Not it seems that those settings are not part of the Docs (at the moment). Have a look in inside RockPageBuiler.module.php on Line 257. There you will finde all attributes that you can change in the markup: // setting specific to rockpagebuilder blocks 'noBlock' => false, // prevent block icons if true 'addTop' => null, // set to false to prevent icon 'addBottom' => null, // set to false to prevent icon 'addHorizontal' => null, // shortcut for addLeft + addRight 'move' => true, 'isWidget' => $isWidget, // is block saved in rockpagebuilder_widgets? 'widgetStyle' => $isWidget, // make it orange 'trash' => true, // will set the trash icon for rockpagebuilder blocks 'clone' => true, // can item be cloned? 'widgetable' => $widgetable, // can be converted into widget?
×
×
  • Create New...