Jump to content
Soma

MarkupSimpleNavigation

Recommended Posts

When rendering two navs on the same page it seems that the first interferes with the second.

If my first nav is...

$menu = $modules->get("MarkupSimpleNavigation");
$items = $pages->find("parent=news");
echo $menu->render(null, null, $items);

...and then my second nav is...

echo $menu->render();

...then that second nav only shows children of news even though no PageArray is passed in to the render method.

Even if my second nav is...

$second_menu = $modules->get("MarkupSimpleNavigation");
echo $second_menu->render();

...it still seems to be limited by the PageArray of the first nav.

Can someone explain where I'm going wrong here? Thanks.

Share this post


Link to post
Share on other sites

I think I see what is causing this but don't fully understand yet as with a new instance it shouldn't be limited by the first. A second call with no arguments it should default to "null" but looks like it's somehow saved but don't get how this happens.

In my quick test It's only if you use a PageArray as root page. If using only 1 page as the root it doesn't happen. 

So for a quick solution you just have to explicit set the root page or items.

Share this post


Link to post
Share on other sites

I think I found the problem a pushed a fix and it's now v 1.3.4. Good find, thanks for the mention.

Share this post


Link to post
Share on other sites

Hello,

I've been testing MarkupSimpleNavigation for the first time yesterday.

I had been testing some pieces of code found in the ProcessWire Forums and in some profiles just before deciding to finally try it.

But for the moment, I'm stuck with the same obstacles.

I have a first horizontal menu with only the homepage and its children(1) (I will see if I remove the homepage later).

Just below I would like a second horizontal menu with the children(2) of a child(1) appearing when their parent is active.

But, I would need the children(2) not to disappear when clicking on one of them.

Is it possible, and without having to create a different template?

Thanks in advance for some help.

Here is the current second menu (but I've tried several variations with the first and second menus):

<?php
        if($page->template != "home") {
            $subMenu = $modules->get("MarkupSimpleNavigation"); // load the module
            $rootPage = $page;
            echo $subMenu->render(null, null, $rootPage); // render default submenu           
        }
    ?>

Share this post


Link to post
Share on other sites

you have no issue here - you've just say the module what pages to show....so if you have a spitted menu with

topmenu 

_______ |

content   | sidebarmenu

               |

you could switch to show childpages to siblings so the submenu is there if you select a subpage of a mainmenu item.

//sideBarMenuNav change items to view 
if($page->hasChildren) {  //we are on a first level parent page so show sencond level
$entries = $page->children;
} else {   //we are on second level so show siblings to actual page
$entries = $page->siblings;
};

using the menu i always show all options to easy change settings and/or see at first glance what is set...

//just a example from one of my websites...see max_levels, show_root and other options here
//markup is fitting for a bootstrap pill subnavigation...

$sideBarMenu = $modules->get("MarkupSimpleNavigation"); // load the module
	$options = array(
		'parent_class' => 'parent',		// overwrite class name for current parent levels
		'current_class' => 'active',	// overwrite current class
		'has_children_class' => 'has_children',    // overwrite class name for entries with children
		'levels' => true,    // wether to output "level-1, level-2, ..." as css class in links
		'levels_prefix' => 'level-',    // prefix string that will be used for level class
		'max_levels' => 2,    // set the max level rendered
		'firstlast' => false,    // puts last,first class to link items
		'collapsed' => false,    // if you want to auto-collapse the tree you set this to true
		'show_root' => false,    // set this to true if you want to rootPage to get prepended to the menu
                'selector' => 'template!=settings',    // define custom PW selector, you may sanitize values from user input
		'selector_field' => 'nav_selector',    // string (default 'nav_selector') define custom PW selector by using a property or field on a page. Use this setting if you want to overwrite the default nav_selector
		'outer_tpl' => '<ul class="nav nav-pills nav-stacked">||</ul>',    // template string for the outer most wrapper. || will contain entries
		'inner_tpl' => '<ul>||</ul>',    // template string for inner wrappers. || will contain entries
		//'list_tpl' => '',    // template string for the items. || will contain entries, %s will replaced with class="..." string
		'list_field_class' => '',  // string (default '') add custom classes to each list_tpl using tags like {field} i.e. {template} p_{id}
		'item_tpl' => '<a href="{url}#start">{title}</a>',    // template string for the inner items. Use {anyfield} and {url}, i.e. {headline|title}, if field is of type image it will return url to image (first image if multiple)
		'item_current_tpl' => '<a href="{url}#start">{title}</a>',    // template string for the active inner items.
		'xtemplates' => '',    // specify one or more templates separated with a pipe | to use the xitem_tpl and xitem_current_tpl markup
		'xitem_tpl' => '',    // same as 'item_tpl' but for xtemplates pages, can be used to define placholders
		'xitem_current_tpl' => '',    // same as 'item_current_tpl' but for xtemplates pages
		'date_format' => 'Y/m/d',    // default date formatting for Datetime fields and native created/modified
		'code_formatting' => true,    // enable or disable code indentations and newslines in markup output
		'debug' => false,    // show some inline information about rendertime and selectors used as html comments
	);
$sideBarNav = $sideBarMenu->render($options, null, $entries);

regards mr-fan

study all the options kindly (RTFM :rolleyes: ) before getting into an issue - this module with all the options is very very powerfull!

  • Like 1

Share this post


Link to post
Share on other sites

@Christophe

I think in your second menu you want

$rootPage = $page->rootParent;
  • Like 2

Share this post


Link to post
Share on other sites

Hello Soma,

Where can version 1.3.4 be found?

Perhaps it can help solve my issue.

Have a nice day!

Ah sorry, it seems I haven't commited it yet or forgot it... It's now updated.

  • Like 1

Share this post


Link to post
Share on other sites

@mr-fan: I don't know why I didn't try with an if...else statement. Perhaps I had been too long on the computer...

I also have a commented version for the first menu.

@Cerulean: this time, just using $rootPage = $page->rootParent; is enough.

It's possible I used $rootParent here or somewhere else once without really knowing what I was doing, but then changed it as I was testing things in multiple tabs, and couldn't find it back later.

And perhaps I also did like just now: I forgot to upload the file again in FileZilla.

Thank you both!

I will also later look (if and) how I can use Drop Jumbo [ http://cferdinandi.github.io/drop/ ] with MarkupSimpleNavigation.

(The Drop Basic demo is going to be fixed. It seems that, since the new version and website were released a few days ago, it doesn't work anymore.)

Share this post


Link to post
Share on other sites

@soma

I was trying to add an image to the left of each navigation link.

As your docs mention, the following will grab the first image in a field I specify

'item_current_tpl' => '<div class="nav-icon"><img src="{images}"></div><a href="{url}">{title}</a>',

I had a few challenges here and wondered about best approach

Image Tag

My images field may contain several images. I could create a separate navigation_images field but would love to call an image by tag

Image size

I can accomplish by CSS but wondered if I could apply the API width() 

Ultimately, my markup would resemble something like this. It's the getTag and width(300) which break the call

'item_current_tpl' => '<div class="nav-icon"><img src="{images->getTag('icon')->width(300)->url}"></div><a href="{url}">{title}</a>',

Share this post


Link to post
Share on other sites

Wondered if I was along the right track with following.

I associate a variable with my image tag including width:

$myimage = $page->images->getTag('icon')->width(300)->url;

and then in the MarkupSimpleNavigation refer to $myimage in the item_crrent_tpl line

'item_current_tpl' => '
<div class="nav-icon"><img src="{myimage}"></div><a href="{url}">{title}</a>
',

Share this post


Link to post
Share on other sites

Eventually solved this with the help of a mate who is an experienced PHP developer.

<?php $treeMenu = $modules->get("MarkupSimpleNavigation");
		  
$myimage = $page->images->getTag('icon')->width(50)->url;	
		
$options = array(
'item_current_tpl' => '<div class="nav-icon"><img src="'.$myimage.'"></div><a href="{url}">{title}</a>',
; 
?>	

We both acknowledge that a better solution is most likely to use the Hook method outlined in the Module readme but I needed something quick (approaching deadline) that I could relate to and maintain myself.

Given time I may look more closely at the Hook method and try understand that a bit more.

Share this post


Link to post
Share on other sites

like i wrote i've added a kind of megamenu (even with images and last articles) with hooks...i'm not at home now but i will prepare a example on this...;)

Share this post


Link to post
Share on other sites

@Peter Knight - won't $myimage always be the icon for the current page?

$myimage = $page->images->getTag('icon')->width(50)->url;    

or does the $page context change inside the MSN loop? ... curious about your solution

Share this post


Link to post
Share on other sites

@Peter Knight - won't $myimage always be the icon for the current page?

or does the $page context change inside the MSN loop? ... curious about your solution

Each pages navigation link has an icon. 

Share this post


Link to post
Share on other sites

right, that's good to know (nevermind my dumb question)... i guess MSN changes the $page context, even though you set the variable outside of the options...in other words $page when in options means the menu item page, not the page being viewed;

Share this post


Link to post
Share on other sites

Eventually solved this with the help of a mate who is an experienced PHP developer.

<?php $treeMenu = $modules->get("MarkupSimpleNavigation");
		  
$myimage = $page->images->getTag('icon')->width(50)->url;	
		
$options = array(
'item_current_tpl' => '<div class="nav-icon"><img src="'.$myimage.'"></div><a href="{url}">{title}</a>',
; 
?>	

We both acknowledge that a better solution is most likely to use the Hook method outlined in the Module readme but I needed something quick (approaching deadline) that I could relate to and maintain myself.

Given time I may look more closely at the Hook method and try understand that a bit more.

That's seems like a viable solution, but only for the active current page. You also just set the "item_current_tpl" and that's only for the current active page. If that's the idea that's ok. 

MarkupSimpleNavigation doesn't change any page context at all. So the $page you have there's is only the current page viewing.

When working with a hook, you would have to check for current page with

if($child === wire("page")) {
    // do your markup logic
}

Taking the example from the readme I linked earlier it would be like:

$nav = $modules->get("MarkupSimpleNavigation");

function myItemString(HookEvent $event){
    // the current rendered child page
    $child = $event->arguments('page'); 
    
    // if current child you're viewing
    if($child === wire("page")) { 
        $myimage = $child->images->getTag('icon')->width(50);
        $itemMarkup = "<div class='nav-icon'><img src='{$myimage->url}'></div><a href='{$child->url}'>{$child->title}</a>";
        $event->return .= $itemMarkup; // send back the markup that will present a item
    }
}

// setup the hook
$nav->addHookAfter('getItemString', null, 'myItemString');

// a render will then also trigger the hook above on each item
echo $nav->render(); 

This would allow to have all different logic in your output depending on custom criterias

  • Like 2

Share this post


Link to post
Share on other sites

Hi - Can someone tell me what options I would need to modify to get MSN to output below menu?

  <select id="mobile-nav">
                  <option>Select page:</option>

                  <option value="index.html">Home</option>
                    <option value="index.html">  Default Layout</option>
                  <option value="about.html">About</option>
                  <option value="blog_right.html">Blog</option>
                    <option value="blog_right.html">  Right sidebar - 1</option>
                    <option value="blog_right2.html">  Right sidebar - 2</option>
                    <option value="blog_post.html">  Blog Post</option>
        <option value="simplecodes_columns.html">Simple Codes</option>
          <option value="simplecodes_columns.html">  Columns</option>
        <option value="portfolio_three1.html">Portfolio</option>
          <option value="portfolio_one1.html">  One Column 1</option>
          <option value="portfolio_three1.html">  Three Columns 1</option>
        <option value="contact.html">Contact</option>

                </select>

Share this post


Link to post
Share on other sites

Seems like a weird menu or I don't get it. If it's for a menu, why it needs a "Select page"?

I'm not sure MSN is made for that task if it's a nested menu structure cause it used UL//OL style nesting that isn't the same as a Select menu would require. I haven't tried but maybe something like this works for a single level menu.

$nav = $modules->MarkupSimpleNavigation;

$options = array(
    "outer_tpl" => "||",
    "list_tpl" => "||",
    "item_tpl" => "<option value='{url}'>{title}</option>",

);

$content .= "<select id='mobile-nav'>";
$content .= "<option>Select</option>";
$content .= $nav->render($options);
$content .= "<select id=''>";

There's JS plugins that can make a Select menu out of a UL list menu.

Share this post


Link to post
Share on other sites

That's seems like a viable solution, but only for the active current page. You also just set the "item_current_tpl" and that's only for the current active page. If that's the idea that's ok. 

Macrura and Soma - you're both correct. My code only works for the current page. I hadn't realised earlier as I was testing and viewing a single page which just happened to be my current page :-/

Moving on, I've worked Somas example into my template, updated the field names etc to produce the following.

As Soma mentioned, this displays an icon only for the current page.

<?php $nav = $modules->get("MarkupSimpleNavigation");

function myItemString(HookEvent $event){
    // the current rendered child page
    $child = $event->arguments('page'); 
    
    // if current child you're viewing
    if($child === wire("page")) { 
        $myimage = $child->nav_icon;
        $itemMarkup = "<div class='nav-icon'><img src='{$myimage->url}'></div><a href='{$child->url}'>{$child->title}</a>";
        $event->return .= $itemMarkup; // send back the markup that will present a item
    }
}

// setup the hook
$nav->addHookAfter('getItemString', null, 'myItemString');

// the navigation options
$options = array(

  'parent_class' => 'parents',
  'current_class' => 'current',
  'has_children_class' => 'has_children',
  'levels' => true,
  'levels_prefix' => 'level-',
  'max_levels' => 1,
  'firstlast' => true,
  'collapsed' => false,
  'show_root' => true,
  'selector' => '',
  'selector_field' => 'nav_selector',
  'outer_tpl' => '<ul class="sidelist">||</ul>',
  'inner_tpl' => '<ul>||</ul>',
  'list_tpl' => '<li%s >||</li>',
  'list_field_class' => '',
  'item_tpl' => '<a href="{url}">{title}</a>',
  'item_current_tpl' => '<a href="{url}">{title}</a>',
  'xtemplates' => '',
  'xitem_tpl' => '<a href="{url}">{title}</a>',
  'xitem_current_tpl' => '<span>{title}</span>',
  'date_format' => 'Y/m/d',
  'code_formatting' => false,
  'debug' => false
);

$root = $page->rootParent; // Start from the top root parent of current page
// a render will then also trigger the hook above on each item
echo $nav->render($options, null, $root); 
?>	

The key to getting my menu to produce a unique icon per page seemed to be removing the if($child === wire("page"))

function myItemString(HookEvent $event){
    // the current rendered child page
    $child = $event->arguments('page'); 
    
    
        $myimage = $child->nav_icon;
        $itemMarkup = "<div class='nav-icon'><img src='{$myimage->url}'></div><a href='{$child->url}'>{$child->title}</a>";
        $event->return .= $itemMarkup; // send back the markup that will present a item
   
}

My only problem at the moment is that each navigation link is being output twice.

post-1166-0-18507800-1441472175_thumb.pn

Share this post


Link to post
Share on other sites

Ok I got it to work.

I realised I had to zap the contents of both 'item_tpl' and item_current_tpl' 

My final working code is as follows.

Apologies if I'm filling up this thread with my own hacked code and examples. Just hoping it's useful to someone in the future.

<?php 

$nav = $modules->get("MarkupSimpleNavigation");

function myItemString(HookEvent $event){
    $child = $event->arguments('page'); // current rendered child page
    // any logic with $child possible here
    	
		$myimage = $child->nav_icon;
        // set the return value of this hook to a custom string
        $event->return .= "<div class='nav-icon'><img src='{$myimage->url}'></div><a href='$child->url'>$child->title</a>";
   
}


$options = array(
				'parent_class' => 'parents',
				'current_class' => 'current',
				'has_children_class' => 'has_children',
				'levels' => true,
				'levels_prefix' => 'level-',
				'max_levels' => 1,
				'firstlast' => true,
				'collapsed' => false,
				'show_root' => true,
				'selector' => '',
				'selector_field' => 'nav_selector',
				'outer_tpl' => '<ul class="sidelist">||</ul>',
				'inner_tpl' => '<ul>||</ul>',
				'list_tpl' => '<li%s >||</li>',
				'list_field_class' => '',
				'item_tpl' => '',
				'item_current_tpl' => '',
				'xtemplates' => '',
				'xitem_tpl' => '<a href="{url}">{title}</a>',
				'xitem_current_tpl' => '<span>{title}</span>',
				'date_format' => 'Y/m/d',
				'code_formatting' => false,
				'debug' => false
			);
$root = $page->rootParent; // Start from the top root parent of current page
// setup the hook after on ___getItemString($class, $page) method
$nav->addHookAfter('getItemString', null, 'myItemString');
echo $nav->render($options, null, $root);

?>

Share this post


Link to post
Share on other sites

Sorry little late at the party but like i wrote a little how to use MSN for a megamenu or add any other items between items...

this should be the result - some li item with extra div content with latest/top article and some other items in this example from a pagefield/categories....

post-2327-0-50642100-1441473527_thumb.pn

Code ist hopefully well commented...

//topMenuNav
$rootPage = $page->get('/'); //shows current tree
$topMenu = $modules->get("MarkupSimpleNavigation"); // load the module

// hook to have custom items markup
$topMenu->addHookAfter('getTagsString', null, 'customNavItems');

function customNavItems(HookEvent $event){
    $item = $event->arguments('page');
    // get the article mainnav item and add some megamenu items...
    if($item->id == 1068){

        //build the normal li item output
        $out    = '<a href="'.$item->get("url").'">'.$item->get("title|name").'</a>';

        //get the last article
        $top_article = wire('pages')->find("template=artikel,top_thema=1,sort=-publish_from")->first();
        //get the last article
        $latest_article = wire('pages')->find("template=artikel,sort=-publish_from")->first();

        //get image thumb from $top_article
        //get the original image
        $imagetop = $top_article->get("artikel_bild");
        // get the image instance of the cropped version of "artikel" 750px wide
        $thumbtop = $top_article->artikel_bild->getCrop('Artikel');

        //get image thumb from $latest_article
        //get the original image
        $imagelatest = $latest_article->get("artikel_bild");
        // get the image instance of the cropped version of "artikel" 750px wide
        $thumblatest = $latest_article->artikel_bild->getCrop('Artikel');

        //get the items for the tagmenu
        $cat_items = wire('pages')->find("template=artikel_cat");

        //get the rootpage of the posts
        $artikel_root = wire('pages')->get(1068);
        //homepageurl
        $homepageurl = wire('pages')->get('/')->httpUrl;

        //start megamenu
        $out    .= '<ul class="mega">';
        //first column last "top" marked article
        $out    .= '<div class="one_third"><h4 class="subtitle">Top Aktuell</h4>';
        $out        .= '<a class="mega-link-img" href="'.$top_article->get("url").'"><img src="'.$thumbtop->url.'" alt="'.$thumbtop->description.'"><br></a>';
        $out        .= '<h6><strong>'.$top_article->get("headline").'</strong></h6>';
        $out        .= '<p>'.$top_article->get("shorttext").'</p>';
        $out    .= '</div>';
        //second column - latest article
        $out    .= '<div class="one_third"><h4 class="subtitle">Letzter Artikel</h4>';
        $out        .= '<a class="mega-link-img" href="'.$latest_article->get("url").'"><img src="'.$thumblatest->url.'" alt="'.$thumblatest->description.'"><br></a>';
        $out        .= '<h6><strong>'.$latest_article->get("headline").'</strong></h6>';
        $out        .= '<p>'.$latest_article->get("shorttext").'</p>';
        $out    .= '</div>';
        //third column - list of tags (links to URL segments on artikel_stamm template)
        $out    .= '<div class="one_third"><h4 class="subtitle">Themenbereiche</h4>';
            foreach ($cat_items as $cat) {
                $out .= '<li><a href="'.$homepageurl.$artikel_root->name.'/'.$cat->name.'/">'.$cat->title.'</a></li>';
            }
        $out    .= '</div>';
        //close megamenu
        $out    .= '</ul>';
        $event->return = $out;
    }
}

$options = array(
    'parent_class' => 'parent',        // overwrite class name for current parent levels
    'current_class' => 'current',    // overwrite current class
    'has_children_class' => 'has_children',    // overwrite class name for entries with children
    'levels' => true,    // wether to output "level-1, level-2, ..." as css class in links
    'levels_prefix' => '',    // prefix string that will be used for level class
    'max_levels' => 3,    // set the max level rendered
    'firstlast' => false,    // puts last,first class to link items
    'collapsed' => false,    // if you want to auto-collapse the tree you set this to true
    'show_root' => false,    // set this to true if you want to rootPage to get prepended to the menu
    'selector' => 'template!=artikel|event',    // define custom PW selector, you may sanitize values from user input
    'selector_field' => 'nav_selector',    // string (default 'nav_selector') define custom PW selector by using a property or field on a page. Use this setting if you want to overwrite the default nav_selector
    'outer_tpl' => '<ul id="nav" class="sixteen columns">||</ul>',    // template string for the outer most wrapper. || will contain entries
    'inner_tpl' => '<ul>||</ul>',    // template string for inner wrappers. || will contain entries
    //'list_tpl' => '',    // template string for the items. || will contain entries, %s will replaced with class="..." string
    'list_field_class' => '',  // string (default '') add custom classes to each list_tpl using tags like {field} i.e. {template} p_{id}
    'item_tpl' => '<a href="{url}">{title}</a>',    // template string for the inner items. Use {anyfield} and {url}, i.e. {headline|title}, if field is of type image it will return url to image (first image if multiple)
    'item_current_tpl' => '<a href="{url}">{title}</a>',    // template string for the active inner items.
    'xtemplates' => '',    // specify one or more templates separated with a pipe | to use the xitem_tpl and xitem_current_tpl markup
    'xitem_tpl' => '',    // same as 'item_tpl' but for xtemplates pages, can be used to define placholders
    'xitem_current_tpl' => '',    // same as 'item_current_tpl' but for xtemplates pages
    'date_format' => 'Y/m/d',    // default date formatting for Datetime fields and native created/modified
    'code_formatting' => true,    // enable or disable code indentations and newslines in markup output
    'debug' => false,    // show some inline information about rendertime and selectors used as html comments
);

$topMenuMarkup = $topMenu->render($options, null, $rootPage);

It's long and detailed i always like to see how all options of the Menu are set....so options could be less.

Hope this works for others as example how to get there with MarkupSimpleNavigation...on such topics.

I like this module very much since in my former CMS there was a great function for generating menus, too. With this kind of generating markup for navigation it is not always easy but it is always very powerfull and if you've it running it a solid solution ;)

Best regards mr-fan

  • Like 2

Share this post


Link to post
Share on other sites

Hello, 

how to hook the Module right. 

I need for an document e.g id = 1033 to target blank my custom url. 

Which is the best way to realize that ? 

Tnx 

Share this post


Link to post
Share on other sites

if you take my example from above you could strip it to the minimal setup like this:

//topMenuNav
$rootPage = $page->get('/'); //shows current tree
$topMenu = $modules->get("MarkupSimpleNavigation"); // load the module

// hook to have custom items markup
$topMenu->addHookAfter('getTagsString', null, 'customNavItems');

function customNavItems(HookEvent $event){
    $item = $event->arguments('page');

    //if the item id is 1068 do something

    if($item->id == 1068){

        //build the normal li item output or change the item with id 1068 to your needs
        //add new items that aren't in the normal pagetree or add megamenu items
        //....do what you want!
        
        $out    = '<a href="'.$item->get("url").'">'.$item->get("title|name").'</a>';

        $event->return = $out;
    }
}
//setup $options for the normal markup and render the nav...

so you could get every special item you need and change it.

best regards mr-fan

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Gadgetto
      SnipWire - Snipcart integration for ProcessWire
      Snipcart is a powerful 3rd party, developer-first HTML/JavaScript shopping cart platform. SnipWire is the missing link between Snipcart and the content management framework ProcessWire.
      With SnipWire, you can quickly turn any ProcessWire site into a Snipcart online shop. The SnipWire plugin helps you to get your store up and running in no time. Detailed knowledge of the Snipcart system is not required.
      SnipWire is free and open source licensed under Mozilla Public License 2.0! A lot of work and effort has gone into development. It would be nice if you could donate an amount to support further development:

      Status update links (inside this thread) for SnipWire development
      2020-01-21 -- Snipcart v3 - when will the new cart system be implemented? 2020-01-19 -- integrated taxes provider finished (+ very flexible shipping taxes handling) 2020-01-14 -- new date range picker, discount editor, order notifiactions, order statuses, and more ... 2019-11-15 -- orders filter, order details, download + resend invoices, refunds 2019-10-18 -- list filters, REST API improvements, new docs platform, and more ... 2019-08-08 -- dashboard interface, currency selector, managing Orders, Customers and Products, Added a WireTabs, refinded caching behavior 2019-06-15 -- taxes provider, shop templates update, multiCURL implementation, and more ... 2019-06-02 -- FieldtypeSnipWireTaxSelector 2019-05-25 -- SnipWire will be free and open source Plugin Key Features
      Fast and simple store setup Full integration of the Snipcart dashboard into the ProcessWire backend (no need to leave the ProcessWire admin area) Browse and manage orders, customers, discounts, abandoned carts, and more Process refunds and send customer notifications from within the ProcessWire backend Complete Snipcart webhooks integration (all events are hookable via ProcessWire hooks) Integrated taxes provider (which is more flexible then Snipcart own provider) Useful Links
      SnipWire in PW modules directory (alpha version only available via GitHub) SnipWire Docs (please note that the documentation is a work in progress) SnipWire @GitHub (feature requests and suggestions for improvement are welcome - I also accept pull requests) Snipcart Website  
      ---- INITIAL POST FROM 2019-05-25 ----
       
    • By d'Hinnisdaël
      Happy new year, everybody 🥬
      I've been sitting on this Dashboard module I made for a client and finally came around to cleaning it up and releasing it to the wider public. This is how it looks.
      ProcessWire Dashboard

      If anyone is interested in trying this out, please go ahead! I'd love to get some feedback on it. If this proves useful and survives some real-world testing, I'll add this to the module directory.
      Download
      You can find the latest release on Github.
      Documentation
      Check out the documentation to get started. This is where you'll find information about included panel types and configuration options.
      Custom Panels
      My goal was to make it really simple to create custom panels. The easiest way to do that is to use the panel type template and have it render a file in your templates folder. This might be enough for 80% of all use cases. For anything more complex (FormBuilder submissions? Comments? Live chat?), you can add new panel types by creating modules that extend the DashboardPanel base class. Check out the documentation on custom panels or take a look at the HelloWorld panel to get started. I'm happy to merge any user-created modules into the main repo if they might be useful to more than a few people.
       Disclaimer
      This is a pre-release version. Please treat it as such — don't install it on production sites. Just making sure 🍇
      Roadmap
      These are the things I'm looking to implement myself at some point. The wishlist is a lot longer, but those are the 80/20 items that I probably won't regret spending time on.
      Improve documentation & add examples ⚙️ Panel types Google Analytics ⚙️ Add new page  🔥 Drafts 🔥 At a glance / Page counter 404s  Layout options Render multiple tabs per panel panel groups with heading and spacing between ✅ panel wrappers as grid item (e.g. stacked notices) ✅ Admin themes support AdminThemeReno and AdminThemeDefault ✅ Shortcuts panel add a table layout with icon, title & summary ✅ Chart panel add default styles for common chart types ✅ load chart data from JS file (currently passed as PHP array) Collection panel support image columns ✅ add buttons: view all & add new ✅
    • By Robin S
      This module is inspired by and similar to the Template Stubs module. The author of that module has not been active in the PW community for several years now and parts of the code for that module didn't make sense to me, so I decided to create my own module. Auto Template Stubs has only been tested with PhpStorm because that is the IDE that I use.
      Auto Template Stubs
      Automatically creates stub files for templates when fields or fieldgroups are saved.
      Stub files are useful if you are using an IDE (e.g. PhpStorm) that provides code assistance - the stub files let the IDE know what fields exist in each template and what data type each field returns. Depending on your IDE's features you get benefits such as code completion for field names as you type, type inference, inspection, documentation, etc.
      Installation
      Install the Auto Template Stubs module.
      Configuration
      You can change the class name prefix setting in the module config if you like. It's good to use a class name prefix because it reduces the chance that the class name will clash with an existing class name.
      The directory path used to store the stub files is configurable.
      There is a checkbox to manually trigger the regeneration of all stub files if needed.
      Usage
      Add a line near the top of each of your template files to tell your IDE what stub class name to associate with the $page variable within the template file. For example, with the default class name prefix you would add the following line at the top of the home.php template file:
      /** @var tpl_home $page */ Now enjoy code completion, etc, in your IDE.

      Adding data types for non-core Fieldtype modules
      The module includes the data types returned by all the core Fieldtype modules. If you want to add data types returned by one or more non-core Fieldtype modules then you can hook the AutoTemplateStubs::getReturnTypes() method. For example, in /site/ready.php:
      // Add data types for some non-core Fieldtype modules $wire->addHookAfter('AutoTemplateStubs::getReturnTypes', function(HookEvent $event) { $extra_types = [ 'FieldtypeDecimal' => 'string', 'FieldtypeLeafletMapMarker' => 'LeafletMapMarker', 'FieldtypeRepeaterMatrix' => 'RepeaterMatrixPageArray', 'FieldtypeTable' => 'TableRows', ]; $event->return = $event->return + $extra_types; }); Credits
      Inspired by and much credit to the Template Stubs module by mindplay.dk.
       
      https://github.com/Toutouwai/AutoTemplateStubs
      https://modules.processwire.com/modules/auto-template-stubs/
    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.60
      Composer: rockett/jumplinks
      ⚠️ NOTICE: 1.5.60 is an important security patch-release for an XSS vulnerability discovered by @phlp. It's HIGHLY RECOMMENDED that all Jumplinks users update to the latest version as soon as possible.
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy! 🙂
    • By Robin S
      Add Image URLs
      Allows images/files to be added to Image/File fields by pasting URLs.

      Usage
      Install the Add Image URLs module.
      A "Paste URLs" button will be added to all image and file fields. Use the button to show a textarea where URLs may be pasted, one per line. Images/files are added when the page is saved.
       
      https://github.com/Toutouwai/AddImageUrls
      https://modules.processwire.com/modules/add-image-urls/
×
×
  • Create New...