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
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-10-18
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




    • By eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild.  
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Steps (Read more) Manual override of the selected value (will still adhere to the rules above) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant If it's usable for others I'll add it to the Modules list  
      Changelog
      v002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional 
      v001
      - Initial release
       
      Thanks!
       
       
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS

       
      Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
×
×
  • Create New...