Jump to content
kongondo

Menu Builder

Recommended Posts

On 6/13/2019 at 4:31 PM, uiui said:

Has anyone ever had the issue that changes to a menu won't save anymore? After adding page number 89 moving items isn't possible anymore as the change won't be saved. This is the case independent of the last page I add or where I move that page.

We had this issue recently, it's because of the limit of Input variables in your PHP configuration. Adjusting the value of max_input_vars in your php.ini file to a larger number will increase the number of items you can save 🙂

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
21 minutes ago, Asimov said:

We had this issue recently, it's because of the limit of Input variables in your PHP configuration. Adjusting the value of max_input_vars in your php.ini file to a larger number will increase the number of items you can save 🙂

Thanks @Asimov ! Excellent response! Welcome to the forums.

Share this post


Link to post
Share on other sites

Hello,

I need some help please. 😉 With "configuring the menu" and adding some additional stuff to my mobile menu, but not really sure how to do that.

I would like my Logo to show in my mobile menu, and I would also like the language switcher there, but cant figure it out. I tried all sorts of things but cant make it work.

My html looks like this: In html the logo is there, but when I try tu give it to menubuilder code it is gone. 

Spoiler

    <nav id="ro-main-nav" class="ro-main-nav-style-1">
      <div class="container">
        <div class="ro-brand"><a href="index.html"><img src="javascript:if(confirm('http://mysite.com/images/logo.svg\n\nThis file was not retrieved because it was filtered out by your project settings.\n\nWould you like to open it from the server?'))window.location='http://mysite.com/images/logo.svg'" alt="Logo"/><img src="javascript:if(confirm('http://mysite.com/images/logo.svg\n\nThis file was not retrieved because it was filtered out by your project settings.\n\nWould you like to open it from the server?'))window.location='http://mysite.com/images/logo.svg'" alt="Logo"/></a></div>
        <ul class="ro-nav-content text-center">
          <li class="visible-xs"><a href="index.html"><img src="javascript:if(confirm('http://mysite.com/images/logo.svg\n\nThis file was not retrieved because it was filtered out by your project settings.\n\nWould you like to open it from the server?'))window.location='http://mysite.com/images/logo.svg'" alt="Logo"/></a></li>
          <li><a href="index.html">HOME</a>
            <ul class="ro-sub-nav">
              <li><a href="basic.html">Link 1</a></li>
              <li><a href="fullwidth.html">Link 2</a></li>
              <li><a href="fullheight.html">Link 3</a></li>

            </ul>
          </li>
          <li><a href="about.html">PAGES</a>
            <ul class="ro-sub-nav">
              <li><a href="about.html">About Us</a></li>
              <li><a href="404.html">Page 2</a></li>
            </ul>
          </li>
          <li><a href="service.html">SERVICES</a></li>
          <li><a href="shop.html">SHOP</a>
            <ul class="ro-sub-nav">
              <li><a href="product.html">Product Page</a></li>
              <li><a href="cart.html">Page</a></li>
              <li><a href="checkout-1.html">Also page</a></li>
            </ul>
          </li>
          <li><a href="contact.html">CONTACT</a></li>
        </ul>
        <div id="ro-hamburger" class="ro-hamburger visible-xs pull-right"><span></span></div>
      </div>
    </nav>

I've tried with:

Spoiler

<nav id="ro-main-nav" class="ro-main-nav-style-1">
      <div class="container">
        <div class="ro-brand"><a href="<?=$config->urls->root;?>"><img src="<?=$pages->get("/Nastavitve/")->header_logo->url?>'" alt="logo"/></a></div>
          <?php 
                        $menu = $modules->get('MarkupMenuBuilder');
                        $options = array(

                            'wrapper_list_type' => 'ul',// ul, ol, nav, div, etc.
                            'list_type' => 'li',// li, a, span, etc.
                            'menu_css_id' => '',// a CSS ID for the menu
                            'menu_css_class' => 'ro-nav-content text-center',// a CSS Class for the menu
                            'submenu_css_class' => 'ro-sub-nav',// CSS Class for sub-menus
                            'has_children_class' => 'ro-sub-nav',// CSS Class for any menu item that has children
                            'first_class'=>'',// CSS Class for the first item in 
                            'last_class' => '',
                            'current_class' => 'active',
                            'default_title' => 0,// 0=show saved titles;1=show actual/current titles
                            'include_children' => 4,// show 'natural' MB non-native descendant items as part of navigation
                            'm_max_level' => 1,// how deep to fetch 'include_children'
                            'current_class_level' => 1,// how high up the ancestral tree to apply 'current_class'
                            'default_class' => '',// a CSS class to apply to all menu items
                        );
                        echo $menu->render(1163, $options);
                        ?>

        <div id="ro-hamburger" class="ro-hamburger visible-xs pull-right"><span></span></div>
      </div>
    </nav>

but there is no logo inside. I also tried with both upper codes and added images to them but not working.

And second question, I would also like to put language switcher to it, not sure how to combine this ...

Spoiler

<ul class="ro-nav-content text-center">
<?php
$savedLanguage = $user->language;

foreach($languages as $language) {
  if($language->id == $savedLanguage->id) continue;
  if(!$page->viewable($language)) continue;
  $user->language = $language;
  echo "<li><a href='$page->url'>$language->title</a></li>";
}
$user->language = $savedLanguage;

?>
</ul>

I hope u understand what Im trying to do. Any help would be appreciated. 😉

Thank you

R

Share this post


Link to post
Share on other sites

HI there, 

Very nice module thank you.

I would like to put a class in each of the ul of the sub menus I have in my menu. It seems that through the admin interface or the $option of the render() function I can't achieve this. Is this correct ?

Then would the only  way to do this is the getMenuItems() function and coding the menu's markup ?

Thanks 

Share this post


Link to post
Share on other sites

ok... I am answering my own (stupid) question in case it's of any help to somebody.

To add a class in the ul of each submenu. Use the 'submenu_css_class' in the $option array. 

Share this post


Link to post
Share on other sites

Hey guys, I've been using the MenuBuilder for quite a few projects (thanks @kongondo for the great module and support!), however this time it is my first when I need to use a menu in the sidebar if some pages are added to it. It all works as soon as I add a few items to the menu, however there is one little issue I am having - not knowing how to show the block title ONLY if the menu contains some items added. I've been looking through the module functions etc. to figure it out, however for some reason I am always getting the items count as 1 even though I've added 9.

<?php
        //Building the array of options. The ones that are not used can be removed
        //They are left here for the learning process only.
        $options = array(
         'wrapper_list_type' => 'ul',// ul, ol, nav, div, etc.
         'list_type' => 'li',// li, a, span, etc.
         'menu_css_id' => '',// a CSS ID for the menu
         'menu_css_class' => 'category-list',// a CSS Class for the menu
         'current_class' => 'active',
         'default_title' => 0,// 0=show saved titles;1=show actual/current titles
         'include_children' => 4,// show 'natural' MB non-native descendant items as part of navigation
         'm_max_level' => 1,// how deep to fetch 'include_children'
         'current_class_level' => 1,// how high up the ancestral tree to apply 'current_class'
        );

        // Render the menu by title
        $cat_menu = $menu->render(1108, $options);
        echo "This menu has: " . count($cat_menu);
        echo $cat_menu;

       ?>	

The big question here is, how can I add a check if my menu with a specific ID/title would contain some items or is just empty in order to show or not the block title etc.?

Share this post


Link to post
Share on other sites
On 12/4/2019 at 3:02 AM, MilenKo said:

Hey guys, I've been using the MenuBuilder for quite a few projects (thanks @kongondo for the great module and support!),

Hi @MilenKo. Apologies for the late response.

I am not sure what you mean by block title.

However, this count() will not work:

echo "This menu has: " . count($cat_menu);

as $menu->render() returns a string. PHP will return 1 (a boolean) but if you had Tracy Debugger it would throw an error about using count() on a non-iterable variable.

If you need to know the number of items you can use the method getMenuItems() introduced here and documented here. You can use the method to either return menu items as a an normal PHP array or as a WireArray. In the examples outlined in the first link above, you can use getMenuItems() with a custom recursive function to render your menu however you wish. In your case though, you can just use it to check number of items. For example:

$mb = $modules->get('MarkupMenuBuilder');
// menu items as PHP Array
$menuItemsAsArray = $mb->getMenuItems(1108, 1, $options);// param 2 = 1: return array
echo 'Number of Menu Items (count($menuItemsAsArray)): ' .  count($menuItemsAsArray);
// menu items as WireArray Object
$menuItemsAsObject = $mb->getMenuItems(1108, 2, $options);// param 2 = 2: return WireArray (the default)
echo 'Number of Menu Items ($menuItemsAsObject->count): ' .  $menuItemsAsObject->count;

In case you just want to know if a menu item is not empty, you can simply check if the return value of $cat_menu is a string. For example:

 // Render the menu by title
 $cat_menu = $menu->render(1108, $options);
 if(is_string( $cat_menu)) {
	echo $cat_menu;
 }

This, however, will not give you the count as explained above. You'd need getMenuItems() for that.

In case you want to know if a menu item is a parent/has children, etc, you can use the WireArray option of getMenuItems() as shown above and use ProcessWire WireArray methods to filter items. For instance:

$someChildItems = $menuItemsAsObject->find("parentID=2");
// OR
$someParents = $menuItemsAsObject->find("isParent=1");

I hope this helps.

Share this post


Link to post
Share on other sites

/site/modules/ProcessMenuBuilder/ProcessMenuBuilder.css

178 line

div.handle i.fa-trash {
    position: relative;
    border: none;
    padding: 0.6em;
    /*margin-right: -2.125em;*/
    top: 1px;
}

fix: add comment margin

 

Знімок екрану.png

  • Like 2

Share this post


Link to post
Share on other sites
36 minutes ago, duncan said:

fix: add comment margin

Thanks. I only noticed this yesterday but have not had time to fix it.

Share this post


Link to post
Share on other sites

Hi guys, hi @kongondo,

I have a menu which I built using your code from some pages back:

Quote

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 .= "<ul class='mainMenu js-mainMenu clearfix'>\n";
                    $first = 1;
                }
                else $out .= "\n<ul class='subMenu js-subMenu'>\n";
            }

            $class = $m->isCurrent ? ' class="current"' : '';

            // a menu item
            $out .= '<li' . $class . '><a href="' . $m->url . '"' . $newtab . '>' . $m->title;
            // if menu item has children
            if ($m->isParent) {
                $out .= '</a><span class="icon submenu__expand js-submenu__expand icon-cheveron-down"></span>';
            }

            else $out .= '</a>';

            // call function again to generate nested list for sub-menu items belonging to this menu item.
            $out .= buildMenuFromObject($m->id, $menu, $first);
            $out .= "</li>\n";

        }// end if parent

    }// end foreach

    if ($has_child === true) $out .= "</ul>\n";

    return $out;

}

 

which works fine, although I have a question regarding the submenus. I have selected to include all native descendants of my page into the submenu. which generates something like this:

<ul>
  <li> Projects </li>
  <ul class="submenu">
  	<li class="submenuItem">
      Project 1
    </li>
    <li class="submenuItem">
      Project 2
    </li>
    ... -> render all remaining Project objects which are children of the Projects Page
  </ul>

This, however, bloats my submenu, if I have a lot of projects. Is there some option to limit the amount of projects that are rendered, to e.g. 10 and then provide a link as the last project item which leads to a project list view which displays all projects?

I just don't quite get the code; e.g. where the code fetches the native descendants of the ``projects`` page.

Any help would be appreciated.

Greetings, derelektrischemoench

Share this post


Link to post
Share on other sites

Update: Menu Builder 0.2.6

Changelog

  1. Added the properties numChildren, totalChildren and showMoreText for use with getMenuItems()
  2. Added option maximum_children_per_parent to limit the maximum number of (included) children a menu item can return. Thanks @derelektrischemoench for inspiration/request.
  3. Fixed CSS issue that affected menu items' trash cans in the backend. Thanks @duncan.
  4. Refactored code to improve efficiency.

In dev branch only for testing.

I have also updated the docs, especially around getMenuItems().

@derelektrischemoench,

See this gist for an example recursive menu builder function that uses maximum_children_per_parent and showMore.

OK, breaktime over, back to Padloper! :-).

  • Like 2

Share this post


Link to post
Share on other sites
On 12/17/2019 at 1:44 PM, kongondo said:

Update: Menu Builder 0.2.6

Changelog

  1. Added the properties numChildren, totalChildren and showMoreText for use with getMenuItems()
  2. Added option maximum_children_per_parent to limit the maximum number of (included) children a menu item can return. Thanks @derelektrischemoench for inspiration/request.
  3. Fixed CSS issue that affected menu items' trash cans in the backend. Thanks @duncan.
  4. Refactored code to improve efficiency.

In dev branch only for testing.

I have also updated the docs, especially around getMenuItems().

@derelektrischemoench,

See this gist for an example recursive menu builder function that uses maximum_children_per_parent and showMore.

OK, breaktime over, back to Padloper! :-).

Hi Kongondo,

thanks for including my input and change requests :) very cool! I'm gonna give it a try, asap.

Greetings

derelektrischemoench

Share this post


Link to post
Share on other sites

Hi kongondo and hi all guys!

Is there a way to put a new field (ex: description) on each menu entries? I like to have something like:


Title: Home
Description: My beautiful home page
URL: /my-beautiful-url/

I wait your feedback.

Thanks and have a nice day!

Share this post


Link to post
Share on other sites
On 1/8/2020 at 5:52 PM, e0f said:

Is there a way to put a new field (ex: description) on each menu entries? I like to have something like:


Title: Home
Description: My beautiful home page
URL: /my-beautiful-url/

I wait your feedback.

Thanks and have a nice day!

Hi @e0f,

Currently, this is not doable out of the box. However, using the method getMenuItems() (see a few posts up for examples), you can use the property pagesID (or index pages_id if getting back array of menu items) to get ($pages->get($m->pageID), for example) the respective ProcessWire pages of the menu items and return the custom fields you want, e.g. description. Having said that, I would not recommend this. It seems like an overkill and may not be very performant based on the number of menu items and other factors.

Perhaps if you could explain your use case, I would see if I can add an option to retrieve the values of simple fields (text, integers, dates, etc) for use with getMenuItems(). MenuBuilder is primarily for building navigation menus. From your example, it seems you are using it for a different purpose? Maybe provide a fuller example so that I can get my head around this.

  • Like 1

Share this post


Link to post
Share on other sites
12 hours ago, kongondo said:

Hi @e0f,

Currently, this is not doable out of the box. However, using the method getMenuItems() (see a few posts up for examples), you can use the property pagesID (or index pages_id if getting back array of menu items) to get ($pages->get($m->pageID), for example) the respective ProcessWire pages of the menu items and return the custom fields you want, e.g. description. Having said that, I would not recommend this. It seems like an overkill and may not be very performant based on the number of menu items and other factors.

Perhaps if you could explain your use case, I would see if I can add an option to retrieve the values of simple fields (text, integers, dates, etc) for use with getMenuItems(). MenuBuilder is primarily for building navigation menus. From your example, it seems you are using it for a different purpose? Maybe provide a fuller example so that I can get my head around this.

Thanks for answer kongondo.

I need to have a little description appear under my mega menu.

In frontend menu I'll have something like "Home" and under it a little description of the menu entry (ex: my beautiful home page).

So each menu voices will have a custom description on desktop version.

I hope is all clear now. Let me know if you need more infos!

Have a nice day,

Share this post


Link to post
Share on other sites

Update: Menu Builder 0.2.7

Changelog

  1. Added the property extra_fields for use with getMenuItems() ONLY. This enables returning the page field values for some selected Fieldtypes. For example, the description field in the page corresponding to the menu item. Thanks @e0f for the inspiration. Full documentation of this new feature is available here.
  2. Menus in multi-lingual sites can now be called using their multi-lingual titles or names irrespective of the current user's language. For example, a multi-lingual site with English, German and Finnish languages could have a menu with the respective titles My Awesome Menu / Mein Tolles Menü / Oma Mahtava Valikko. Any of these titles can be used in the code to call the menu (using render() or getMenuItems() methods). [PS: blame you-know-who for these language translations :-)]
  3. Changed the way new menus are added. Only one menu can be added at a time. The title field/input is multi-lingual ready. See screens below.
  4. Improved the backend GUI when viewing locked menus. Only the menu items and and exit button are shown in such cases.
  5. Fixed bug that allowed access to unpublished menus for frontend rendering.
  6. Updated the documentation
  7. Refactored code to improve efficiency.

In dev branch only for testing.

Screenshots

a. Add Menu (Multi-lingual)

mb-version-27-add-menu-multilingual-screen.thumb.png.1c5654f2eae1e95c5fcee2b4baf5f1d1.png

 

b. Edit Menu (Multi-lingual)

mb-version-27-edit-menu-multilingual-screen.thumb.png.2c5d93ef748b5b9298f51d4ed67ee366.png

c. Locked Menu

mb-version-27-locked-menu-screen.thumb.png.991346ad1977d5d2216c2c872ed96e95.png

d. An example usage of extra_fields (I am no designer, so yeah, nothing much to see here...but you get the idea :-))

mb-version-27-extra-fields-screen.thumb.png.4f981af877a394d4d2175f0294b1181d.png

 

Thanks for testing!

  • Like 2

Share this post


Link to post
Share on other sites

i added new option in menu options because i needed css class in <a> tag, searched for a while and didn't find any example so had to do the following.

$NavOptions = array(
                                'wrapper_list_type' => 'ul', // ul, ol, nav, div, etc.
                                'list_type' => 'li', // li, a, span, etc.
                                'menu_css_id' => 'navbarSupportedContent', // a CSS ID for the menu
                                'menu_css_class' => 'navbar-nav ml-auto', // a CSS Class for the menu
                                'current_class' => 'active',
                                'default_title' => 0, // 0=show saved titles;1=show actual/current titles
                                'default_class' => 'nav-item', // a CSS class to apply to all menu items
                                'ahref_class'=>'nav-link'
                            );

 

added following line in MarkupMenuBuilder.module
$this->set('linkClass', isset($options['ahref_class']) ? $options['ahref_class'] : '');

// if $iTag is empty, apply css id and classes to <a> instead
if(!$iTag) $out .= "\n\t<a{$itemCSSID}{$class}{$newtab} href='{$m->url}'>{$m->title}</a>";
else $out .= "\n\t<{$iTag}{$itemCSSID}{$class}>\n\t\t<a{$newtab} href='{$m->url}' class='{$o->linkClass}'>{$m->title}</a>";

suggest me if there is any better way out!!

  • Like 1

Share this post


Link to post
Share on other sites

Welcome to the forums @Neeraz,

5 hours ago, Neeraz said:

because i needed css class in <a> tag,

It was decided early on to add classes to the <li> instead of the <a>, as it was the usual practice.

6 hours ago, Neeraz said:

suggest me if there is any better way out!!

Getting the <a> via CSS is quit easy, for instance...

#menu li a {
/* your styles here*/
}

You can be as specific as  you want with your CSS.

6 hours ago, Neeraz said:

added following line in MarkupMenuBuilder.module

Not a good idea as this will get overwritten next time you upgrade Menu Builder :-).

Share this post


Link to post
Share on other sites
8 hours ago, kongondo said:

Welcome to the forums @Neeraz,

It was decided early on to add classes to the <li> instead of the <a>, as it was the usual practice.

Getting the <a> via CSS is quit easy, for instance...


#menu li a {
/* your styles here*/
}

You can be as specific as  you want with your CSS.

Not a good idea as this will get overwritten next time you upgrade Menu Builder :-).

i know this but i have no permission to modify customer css file so had to do this, i suggest you to add the same option in future update so it will be more flexible 🙂

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MoritzLost
      This is a new module that provides a simple solution to clearing all your cache layers at once, and an extensible interface to perform various cache-related actions.
      The simple motivation behind this module was that I was tired of manually clearing caches in several places after deploying a change on a live site. The basic purpose of this module is a simple Clear all caches link in the Setup menu which clears out all caches, no matter where they hide. You can customize what exactly the module does through it's configuration menu:
      Expire or delete all cache entries in the database, or selectively clear caches by namespace ($cache API) Clear the the template render cache. Clear out specific folders inside your site's cache directory (/site/assets/cache) Refresh version strings for static assets to bust client-side browser caches (this requires some setup, see the full documentation for details). This is the basic function of the module. However, you can also add different cache management action through the API and execute them through the module's interface. For this advanced usage, the module provides:
      An interface to see all available cache actions and execute them. A system log and logging output on the module page to see verify what the module is doing. A CacheControlTools class with utility functions to clear out different caches. An API to add cache actions, execute them programmatically and even modify the default action. Permission management, allowing you granular control over which user roles can execute which actions. The complete documentation can be found in the module's README.
      Beta release
      Note that I consider this a Beta release. Since the module is relatively aggressive in deleting some caches, I would advise you to install in on a test environment before using it on a live site.
      Let me know if you're getting any errors, have trouble using the module or if you have suggestions for improvement!
      In particular, can someone let me know if this module causes any problems with the ProCache module? I don't own or use it, so I can't check. As far as I can tell, ProCache uses a folder inside the cache directory to cache static pages, so my module should be able to clear the ProCache site cache as well, I'd appreciate it if someone can test that for me.
      Future plans
      If there is some interest in this, I plan to expand this to a more general cache management solution. I particular, I would like to add additional cache actions. Some ideas that came to mind:
      Warming up the template render cache for publicly accessible pages. Removing all active user sessions. Let me know if you have more suggestions!
      Links
      https://github.com/MoritzLost/ProcessCacheControl ProcessCacheControl in the Module directory

    • By joshua
      This module is (yet another) way for implementing a cookie management solution.
      Of course there are several other possibilities:
      - https://processwire.com/talk/topic/22920-klaro-cookie-consent-manager/
      - https://github.com/webmanufaktur/CookieManagementBanner
      - https://github.com/johannesdachsel/cookiemonster
      - https://www.oiljs.org/
      - ... and so on ...
      In this module you can configure which kind of cookie categories you want to manage:

      You can also enable the support for respecting the Do-Not-Track (DNT) header to don't annoy users, who already decided for all their browsing experience.
      Currently there are four possible cookie groups:
      - Necessary (always enabled)
      - Statistics
      - Marketing
      - External Media
      All groups can be renamed, so feel free to use other cookie group names. I just haven't found a way to implement a "repeater like" field as configurable module field ...
      When you want to load specific scripts ( like Google Analytics, Google Maps, ...) only after the user's content to this specific category of cookies, just use the following script syntax:
      <script type="optin" data-type="text/javascript" data-category="statistics" data-src="/path/to/your/statistic/script.js"></script> <script type="optin" data-type="text/javascript" data-category="marketing" data-src="/path/to/your/mareketing/script.js"></script> <script type="optin" data-type="text/javascript" data-category="external_media" data-src="/path/to/your/external-media/script.js"></script> <script type="optin" data-type="text/javascript" data-category="marketing">console.log("Inline scripts are also working!");</script> The type has to be "optin" to get recognized by PrivacyWire, the data-attributes are giving hints, how the script shall be loaded, if the data-category is within the cookie consents of the user. These scripts are loaded asynchronously after the user made the decision.
      If you want to give the users the possibility to change their consent, you can use the following Textformatter:
      [[privacywire-choose-cookies]] It's planned to add also other Textformatters to opt-out of specific cookie groups or delete the whole consent cookie.
      You can also add a custom link to output the banner again with a link / button with following class:
      <a href="#" class="privacywire-show-options">Show Cookie Options</a> <button class="privacywire-show-options">Show Cookie Options</button> This module is still in development, but we already use it on several production websites.
      You find it here: https://github.com/blaueQuelle/privacywire/tree/master
      Download: https://github.com/blaueQuelle/privacywire/archive/master.zip
      I would love to hear your feedback 🙂
      Edit: Updated URLs to master tree of git repo
       
    • By David Karich
      Admin Page Tree Multiple Sorting
      ClassName: ProcessPageListMultipleSorting
      Extend the ordinary sort of children of a template in the admin page tree with multiple properties. For each template, you can define your own rule. Write each template (template-name) in a row, followed by a colon and then the additional field names for sorting.
      Example: All children of the template "blog" to be sorted in descending order according to the date of creation, then descending by modification date, and then by title. Type:
      blog: -created, -modified, title  Installation
      Copy the files for this module to /site/modules/ProcessPageListMultipleSorting/ In admin: Modules > Check for new modules. Install Module "Admin Page Tree Multible Sorting". Alternative in ProcessWire 2.4+
      Login to ProcessWire backend and go to Modules Click tab "New" and enter Module Class Name: "ProcessPageListMultipleSorting" Click "Download and Install"   Compatibility   I have currently tested the module only under PW 2.6+, but think that it works on older versions too. Maybe someone can give a feedback.     Download   PW-Repo: http://modules.processwire.com/modules/process-page-list-multiple-sorting/ GitHub: https://github.com/FlipZoomMedia/Processwire-ProcessPageListMultipleSorting     I hope someone can use the module. Have fun and best regards, David
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version (has been tested up to v3.3), add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "https://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


×
×
  • Create New...