Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by MateThemes

  1. Hello everyone,

    I have following markup for my menu build with module "MenuBuilder" and I want to update it to PHP 8. I am not very expirienced with PHP so I cant find a solution. Here is the code:

    <?php namespace ProcessWire;
     * Main Menu.
     * Builds a nested list (menu items) of a single menu.
     * A recursive function to display nested list of menu items.
     * @access private
     * @param Int $parent ID of menu item.
     * @param Array $menu Object of menu items to display.
     * @param Int $first Helper variable to designate first menu item.
     * @return string $out.
    function buildMenuFromObject($parent = 0, $menu, $first = 0) {
        if(!is_object($menu)) return;
        $out = '';
        $has_child = false;
        foreach ($menu as $m) {
            $newtab = $m->newtab ? " target='_blank'" : '';
            // if this menu item is a parent; create the sub-items/child-menu-items
            if ($m->parentID == $parent) {// if this menu item is a parent; create the inner-items/child-menu-items
                // if this is the first child
                if ($has_child === false) {
                    $has_child = true;// This is a parent
                    if ($first == 0){
                        $out .= "\n<ul class='uk-navbar-nav'>";
                        $first = 1;
                    else {
                        $out .=
                            "\n\t<div class='uk-navbar-dropdown'>" .
                            "\n\t\t<ul class='uk-nav uk-navbar-dropdown-nav'>";
                // active/current menu item
                $class = $m->isCurrent ? ' class="uk-active"' : '';
                // a menu item
                $out .= "\n\t<li$class><a href='{$m->url}{$newtab}'>{$m->title}</a>";
                // call function again to generate nested list for sub-menu items belonging to this menu item.
                $out .= buildMenuFromObject($m->id, $menu, $first);
                if ($m->isParent) $out .= "\n\t</div>\n";// close div.uk-navbar-dropdown
                $out .= "</li>";
            }// end if parent
        }// end foreach
        if ($has_child === true) $out .= "\n</ul>";
        return $out;
    // example usage
    $mb = $modules->get('MarkupMenuBuilder');
    $menuItemsAsObject = $mb->getMenuItems(1073, 2);
    $menu = buildMenuFromObject(0, $menuItemsAsObject);
    echo $menu;

    As far as I found out, the problem is the function with the $menu variable. But I can't find a way to update this.

    May someone can help me out!

    thanks in advance

  2. 47 minutes ago, AndZyk said:

    As in my experience the menu usually doesn't change much, except maybe for submenus, I define the navigation in the _init.php and loop through the items and children:

    $homepage = pages()->get("/");
    $nav = $homepage->children("template=foo|bar, sort=sort");

    I try to keep the navigation connected to the page tree as close as possible.

    Thank you for your reply and a code example. You are right menu isn't changed. But how you manage if the customer wants complete freedom over navigation?

    15 hours ago, Zeka said:

    Hi @MateThemes Usually, If I need something simple I use Repeater field with depth option, if something more advanced I use Repeater Matrix field with depth.

    Thank you for your reply.

    Do you have a code example? Especially how you manage mega menu with an image in the menu?

  3. Hello everyone,

    this is a general support topic. The last time I often had website templates with mega menu including images. So there this is always an advanced topic for me. I normally used ProcessMenuBuilder but this is not suitable for me anymore.

    So I want to asked the community, how do you build your menus? With module or whatever.

    Thanks in advance.

    • Like 1
  4. Hello everyone.

    I need your help. I use in my template following code to render my uikit offcanvas.

    <div class="uk-offcanvas-bar uk-box-shadow-large">
    	<button class="uk-offcanvas-close" type="button" data-uk-close></button>
    	// example of caching generated markup (for 600 seconds/10 minutes)
    	echo cache()->get('offcanvas-nav', 10, function() {
    		return ukNav(pages('/')->children(), [
    				'depth' => 2,
    			'accordion' => false,
    			'type' => 'default',
    			'class' => '',
    			// 'blockParents' => [ 'blog' ],
    			'repeatParent' => true,
    			'noNavQty' => 20,
    			'maxItems' => 16,
    			'divider' => false,

    In this code is the root page (home page) not render. I didn't find a solution to render the root page. May someone can help me!

    Thanks in advance.

  5. 2 minutes ago, MateThemes said:

    Hy @bernhard

    You are right. I just downloaded the RockFrontend and RockMigrations and installed it via the backend as zip upload. I need to say, I just don't know why this happened?! Is it better to move the module inside the side modules folder and add the module from there?

    Thank you.

    I removed the module from the folder and installed it with uploading RockMigrations in site/modules now the error message is gone.

    It seems to happen with the zip upload.

  6. 1 hour ago, bernhard said:

    Thx @MateThemes it's fixed in v1.6.8

    PS: Why is RockMigrations placed in the "MagicPages" folder? Shouldn't that be "RockMigrations"??

    Hy @bernhard

    You are right. I just downloaded the RockFrontend and RockMigrations and installed it via the backend as zip upload. I need to say, I just don't know why this happened?! Is it better to move the module inside the side modules folder and add the module from there?

    Thank you.

  7. Hello,

    what I really would love to see in Processwire is a content preview like Shopify have or even CraftCMS.

    Does anyone build such a thing for a Processwire site or is this possible with a ProModule (RepeaterMatrix)? I have a customer who wants such a feature but I really want to use Processwire and not CraftCMS.

    Thank you.

  8. 1 hour ago, 3fingers said:

    I reply to you since nobody else does ?
    The motivation behind this silence is that in the past there was a similar thread in which someone else raised the same questions, regarding themes and a marketplace eventually.
    Short answer is no, most of the users here in the forum don't rely on theme market (as far as I remember, personally I design them from scratch).
    Same goes as having a starting point for processwire, due to the fact I build heterogeneous sites where it's kinda rare I feel the need for something different than a blank profile.

    Tailwind css rules ??


    Thanks for your honest answer.

    I was quite sure that there is no need for a marketplace, because it would be there one, if the dev's here would need one. It is surely the approach of processwire, that there is no need for that, because every setup for every single website will be in a different way.

    Thank you.

    • Like 1
  9. Hello everyone.

    I am interested in your dev workflow with TailwindCSS. 

    How to you use the build process for TailwindCSS in your templates? Are you building your templates first in a separat HTML/CSS setup or to you build your design in a dev installation of processwire. If you build your designs in a dev setup of processwire do you use a gulp setup or something else?

    Thank you.

  10. Hello everyone!

    First of all I am relatively new to Processwire. I am currently a member of this forum, I think since 3 years or so. I have build several projects with Processwire and I need to say "Dev things" and Webdesign is only a part time job for me.

    The main thing I want to ask you is: I am currently thinking of to build a small marketplace for themes build on UIkit 3 and/or TailwindCSS (Themes should be sold on ThemeForest) and templates for Processwire. As Processwire is only a developer CMS, not like Wordpress that is for non Developers too, I want to ask you.

    • Is there any need for you for a theme market?
    • Do you build the most themes from scratch or do you buy themes and customize them - if needed?
    • If you buy themes - Where do you buy theme?
    • Are there any needs for you to have a solid starting point with predefined fields in Processwire or is it better for you to build everything from scratch?
    • What is your preferred CSS Framework?

    I am looking forward for your replys!

    Gerald from MateThemes

    • Like 1
  11. Hello kongondo!

    Really amazing work!!! I have an ecommerce project for my own use in working progress and I really think of to not use processwire, coz there was no infos on padloper 2. Now, I know I will stay with ProcessWire and wait for the release of Padloper 2. It would be an honor to be an alpha tester!

    One question I have so far: I didn't see in the video for sure, if there are also virtual/downloadable products (My ecommerce project will only have virtual goods) or did I miss something?


    • Like 1
  12. 8 hours ago, B3ta said:

    Processwire and the whole community is AMAZING, but the only thing that I think is missing... is the part where developers start to create, sell and maintain their plugins.  

    By creating a premium PW plugin marketplace the following scenario will probably happen:

    1. @ryan will/can receive a comision on each sale. This will be a well deserved token of appreciation for all his amazing work invested to build and maintain PW.
    2. Plugin creators will be constantly motivated to build, maintain compatibles and improve the quality of their plugins.
    3. The developers that will pay and use the premium plugins and they will save thousands in development time. Probably their clients will be happier with smaller project fees and shorter delivery times.

    I’m suggesting this since I’m always looking in Craft cms plugin marketplace and I have the feeling that they have a plugin for everything. 
    Some are silly some are amazing... i know..
    But in the moment you browse it, you always have the feeling that the only thing you have to do in order to create a big project is just to put the puzzle pieces together. 

    If PWmarketplace would be a real thing...

    What would be the premium plugin that you will want to buy RIGHT NOW?


    I also think this would be a great thing. OctoberCMS has also a marketplace and 30% of the plugin price supports the project.

    Have a nice day!

    • Like 1
  13. On 2/15/2020 at 11:36 AM, Mikie said:

    Hi @MateThemes

    I think below is what you mean? This is for the portfolio-index.php.

    Pagination is a bit more involved. You could use the inbuilt pager https://processwire.com/docs/front-end/markup-pager-nav/

    <?php namespace Processwire;
    $entries = $page->children();
    foreach ($entries as $entry) {
    	echo "<p>{$entry->title}</p>";
    	foreach ($entry->images as $image) {
    		$imgUrl = $image->width(600)->url;
    		echo '<img src="' . $imgUrl '">';



    Thank you for your help, that gives me a starting point!

  • Create New...