Jump to content

combicart

Members
  • Posts

    78
  • Joined

  • Last visited

Recent Profile Visitors

2,384 profile views

combicart's Achievements

Full Member

Full Member (4/6)

22

Reputation

  1. @MoritzLost Just tested it out and it works great! Thanks!
  2. @MoritzLost I installed this module today and I'm wondering if it's compatible with PHP 8.3 and Processwire 3.0.229? When I add the field to a FormBuilder form and try to open the form on the website I get the following errors at the top of the form: Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /wire/core/Inputfield.php on line 1395 Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /wire/core/Inputfield.php on line 1395 Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /wire/core/Inputfield.php on line 1395
  3. @Jan Romero and @da², thanks for your help! I just tried it again with the selector from Jan and it gives the correct results. I didn't correctly understand the query from the original post for my situation but this helped a lot. Thanks!
  4. Thanks @da², I tried to solve it with an additional foreach loop but unfortunately that didn't work.
  5. Hello, I'm currently building an events website where one event can be in different locations. Each location can have it's own date. I therefore have added a repeater field called `event_locations` to an event where we can add more information about the location. The `event_locations` repeater contains the following fields: location (page reference) event_date (datetime field) event_price (text field) event_link (url field) On the event detail page I would like to show the different locations and sort them by date and city. Events in the past can be removed from the page. I normally check the date with `event_date>=today` which works whenever I loop through all pages and filter by template. However in this case I would like to filter through the repeater field which doesn't give the same results for some reason. This works (but displays all future event_locations): $pages->find('event_date>=today, sort=event_date, sort=location.location_city') This doesn't work (this give no results at all): $page->event_locations->find('event_date>=today, sort=event_date, sort=location.location_city') Can't the event_date be used in this case? Or is there a different way to get only events in the future for this specific event?
  6. @Mirox and @BrendonKoz, thanks for the help. That was exactly what I was looking for ?
  7. @BrendonKoz Thanks! I've added the change and now it works like expected. One other question. I would like to make the checkbox 'checked' when one or more filters are enabled. I tried doing this with the checked() method and with in_array but so far I'm not able to get the results that I want. Is there a way to add the `checked` option to a checkbox when it's active in the filter?
  8. I'm currently working on a page which shows an overview of Events. I would like to add a filter so that users can view the Events that are in their neighbourhood or that belong to a specific category. I'm using the following code for the form: <form action="." method="get" id="events_filter"> <?php foreach ($pages->get(1104)->children() as $category) : ?> <div class="flex items-center"> <input id="<?= $category->id; ?>" name="category" value="<?= $category->id; ?>" type="checkbox" class="text-gold-600 h-4 w-4 rounded border-brown-300 focus:ring-gold-500"/> <label for="<?= $category->id; ?>" class="ml-3 text-brown-800"><?= $category->title; ?></label> </div> <?php endforeach; ?> <?php foreach ($pages->find("template=location") as $location) : ?> <div class="flex items-center"> <input id="<?= $location->id; ?>" name="location" value="<?= $sanitizer->kebabCase($location->title); ?>" type="checkbox" class="text-gold-600 h-4 w-4 rounded border-brown-300 focus:ring-gold-500" /> <label for="<?= $location->id; ?>" class="ml-3 text-brown-800"><?= $location->title; ?></label> </div> <?php endforeach; ?> <button type="submit" id="events_filter" class="text-md flex w-full justify-center rounded bg-orange-500 px-8 py-3 font-semibold text-white transition hover:bg-orange-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-orange-200">Filter</button> </form> On the page itself I've added the following code to get the categories and locations: //Default selector to get ALL events $selector = "template=event"; // Get cateogry and location variables and sanitize $category = $sanitizer->selectorValue($input->get->category); $location = $sanitizer->selectorValue($input->get->location); if ($category) { $selector = $selector .= ",event_categories=$category"; } if ($location) { // See how this uses greater than or equal to $selector = $selector .= ",event_locations.title=$location"; } $events = $pages->find($selector); There is only one thing that I can't get to work. When a user currently selects multiple checkboxes, only the last checkbox will be used inside the filter. Ideally when a user selects multiple checkboxes they all will be used inside the filter. Is there someone that could point me into the right direction on how to achieve that?
  9. @Robin S That's really great! Will use the combined setup with getPaginationString() and MarkupPagerNav to achieve the pagination markup. Thanks, for pointing me in the right direction!
  10. Hey, i'm currently building a website with a news section. On the overview page I would like to add a pagination so that users can easily switch from page to page. I already included the MarkupPagerNav setup. However I would like to adjust the output of the module and I'm not really sure how to adjust it to my needs. I would e.g. like to output the current page and the total number of pages. See example below of what I would like to achieve: Could someone point me in the right direction on how to output the correct variables? Thanks!
  11. Hi there, I would like to start the navigation on the 2nd level / depth instead of the 1st. I've tried to set this up with the `$rootPage` variable, bit I can't seem to find the correct flow for what i'm trying to achieve. Ideally I want to use the following setup: - Home -- Location A --- Page 1 --- Page 2 -- Location B --- Page 3 --- Page 4 When you're on the Homepage the menu should show: Home - Location A - Location B When you're on the Location A page, the menu shows: Home (which is the Location A page) - Page 1 - Page 2 Is there a way to achieve this with the MarkupSimpleNavigation module? Or could somebody point me in the right direct to implement this menu? Thanks!
  12. Thanks for pointing me in the right direction. I've add a hook to the ready.php file. If someone is interested, below i've added a snippet of what i'm using: wire()->addHookAfter('Pages::saveReady', function(HookEvent $event) { $page = $event->arguments(0); foreach ($page->body_extended as $item) { // $body_extended is the name of the matrix field if ($item->type == 'text') { // Looking for a 'text' matrix field $seo_description = substr(strip_tags($item->body), 0, 255); // Find the body text and strip/trim the html tags break; } } $page->seo_description = $seo_description; // Save the body inside the seo_description field on the page });
  13. In my current setup I've added a matrix field called 'body_extended'. Inside this field one of the matrix types is a 'text' block. Inside this block I have two fields: 'title' and 'body'. The body field is a CKEditor text area field. I would like to copy the content of the 'body' field that is inside the first 'text' block that is available on the page inside a different field (called 'seo_description') on the same page (just a regular field, not a matrix field) however I'm struggling to find the best approach. I've started looking into hooks but I'm not sure if and which hook is suitable for this situation. Has somebody faced a similar situation before or could someone point me in the right direction? I've attached a screenshot of what I'm trying to accomplish. Thanks!
  14. Hi @dragan, thanks! I've just implemented the hook and it's working perfectly! Thanks for pointing me in the right direction!
  15. Is it possible to show additional markup for a specific menu item? I would like to show the number of subpages (with it's own markup) for one specific main menu item. The page is a regular page with the same template as other pages in the menu. Would this be possible?
×
×
  • Create New...