Jump to content

Roych

Members
  • Posts

    383
  • Joined

  • Last visited

Recent Profile Visitors

3,319 profile views

Roych's Achievements

Sr. Member

Sr. Member (5/6)

77

Reputation

  1. Is it possible to upgrade module to work with PHP 8.2 or 8.3 maybe? It only works on PHP 7.4 at least here ... Thank you R
  2. Maybe something like this? $menuBuilder = $this->modules->get('MarkupMenuBuilder'); $menu = $this->pages->get($id); if ($menu->menu_items->count()) { $this->menuItems = $menuBuilder->getMenuItems($id); } else { // Handle the case where there are no menu items, for example: $this->menuItems = []; // or any other appropriate action } Haven't tested! This code (should) first checks if there are any menu items by using the count() method on the menu_items field. If there are menu items, it proceeds to fetch and assign them using the getMenuItems method from the MenuBuilder module. If there are no items, you can handle it as needed. In the example above, an empty array is assigned to $this->menuItems, but you can customize it to match your specific requirements. This approach allows you to use the MenuBuilder module to create menus with or without items, without triggering the error you mentioned. Cheers, R
  3. Great, thank you for clarifying the problem. ? R
  4. Hmm, never seen this in PW before. ... It stoped after half an hour, I updated everything to the latest version and now it seems that it is gone. I hope this is it. Thank you R
  5. Hello, Not sure why nothing was changed on the site but today when I logged in my admin I'm getting several errors non-stop and they are weird wordpress looking errors, what is happening? I don't have any wordpress site installed on the server at all. Where are those errors coming from? Any ideas. The site and admin are working normaly as it seems, just errors are here all the time. Im posting gif to see what I mean. Any Ideas what is happening here? Thank you R
  6. I'have a strange problem, my drag and drop is not working anymore not sure why. All the settings are correct and should be working. It's quite annoying, anybody else have this problem? any ideas how to fix this? Menu is published, unlocked. ... Thank you R
  7. Hmm, I was just playing with the module and I added <?php namespace ProcessWire; in front of the module files, and it seem that it started to work ... Not sure if this was the case at all. R
  8. I tried both of them ... I have my site atm in a subfolder, but I moved it to the root but still, I can only see the right URL when logged in as superuser. Even editors cant see the URL's? Any idea? Thx R
  9. I there any update on this module? Links only works when you are loged in as superuser, when you are logged out all links goes to homepage. I there some fix for this maybe? It is a shame, because the module is awesome I'm using PW v. 3.0.210 Thx R
  10. No, still not resolved, I tought that the code above works but when I looked closer it wasn't. So I guess the best approach would be to create another menu for the footer.
  11. Ohhh, with a lot of thinking, this is somehow working But not as expected ? <?php $homepage = $pages->get(1); // get the homepage $topLevelPages = $homepage->children("parent_id=1"); // get the top-level pages $out = ""; foreach ($topLevelPages as $page) { $out .= "<li><a href='{$page->url}'>{$page->title}</a></li>"; } if ($out != "") { $out = "<ul>" . $out . "</ul>"; echo $out; } else { echo "No menu items found."; } ?>
  12. not realy working. The children are not native children of a page, they are made with MenuBuilder drag&drop option. I want those in my header main menu, but in my footer I only want to show the first row.
  13. No it is the ID of my menuBuilder Menu instead of menu name I'm using ID
  14. Hello I'm having some problems with my menu. I want to show only first level of my menu without any children but can't make it work, no matter what I do. It always shows children. Any idea? It is a multilanguage site! I'm tried: <?php $menu = $modules->get('MarkupMenuBuilder'); $options = array( 'max_levels' => 1, 'include_children' => 0 ); echo $menu->render(1030, $options); ?> But it's not working. Am I missing something or is there some bug maybe. Tried all sorts of codes but childrens are always there. Thank you R
×
×
  • Create New...