Jump to content
Soma

MarkupSimpleNavigation

Recommended Posts

Next little tutorial on this really great module...

Getting a Footermenu stripped from the mainmenu and output in a footermenu

1. Setup Pagefield for your /settings/ or /tools/ page

This solution could be set by the user direct via a simple pagefield to select normal contentpages that a normaly in the mainmenu...but this items should stay not there and render somewhere else...

post-2327-0-42569000-1442412709_thumb.jp

2. Strip the choosen pages from the mainmenu

//get the pagefield content
$footerMenu = $settings->footer_menu;

//just the needed option listed - other options like needed for your menu
$options = array(
       'selector' => 'id!='.$footerMenu.'',    // define custom PW selector
);

3. Output the pagefield items

post-2327-0-41513000-1442412792_thumb.jp

<?php //in my example i am in the _main.php template and render some footermenu
if ($settings->footer_menu) { //check for the pagefield
    echo '<div class="eight columns">';
    foreach ($settings->footer_menu as $item) {
        if (!$item->is('hidden') || $item->is('unpublished')) { //check for hidden/unpublished pages!!
	    echo '<a href="'.$item->url.'" class="button sendbtn btnSend">'.$item->title.'</a>';
	}
    }
    echo '</div>';
}
?>

hope this is helpful...have fun.

I don't have a blog and i am a fan of keeping things together....so don't bother if i'm posting such things here and write me if such usecases are not helpful or nonsense...... ;)

Best regards mr-fan

  • Like 2

Share this post


Link to post
Share on other sites

Is it possible to use the "selector" option to choose menu items based on parent?

I tried...

"selector" => "parent=1020"

...and...

"selector" => "parent=/my-page/"

...but neither of these worked.

I know I can do this by setting a PageArray as the root object but I'm trying to understand why I can't do this with the selector option.

Share this post


Link to post
Share on other sites

No it's not possible, it iterates the tree structure as is. "parent -> childrens -> childrens".

You can only set the top root items per a PageArray. Form there these are iterated down the tree. The selector only is used to filter the children of the current nodes.

Share this post


Link to post
Share on other sites

Next little tutorial on this really great module...

Getting a Footermenu stripped from the mainmenu and output in a footermenu

1. Setup Pagefield for your /settings/ or /tools/ page

This solution could be set by the user direct via a simple pagefield to select normal contentpages that a normaly in the mainmenu...but this items should stay not there and render somewhere else...

attachicon.giffootermenu.jpg

2. Strip the choosen pages from the mainmenu

//get the pagefield content
$footerMenu = $settings->footer_menu;

//just the needed option listed - other options like needed for your menu
$options = array(
       'selector' => 'id!='.$footerMenu.'',    // define custom PW selector
);

3. Output the pagefield items

attachicon.giffootermenusorting.jpg

<?php //in my example i am in the _main.php template and render some footermenu
if ($settings->footer_menu) { //check for the pagefield
    echo '<div class="eight columns">';
    foreach ($settings->footer_menu as $item) {
        if (!$item->is('hidden') || $item->is('unpublished')) { //check for hidden/unpublished pages!!
	    echo '<a href="'.$item->url.'" class="button sendbtn btnSend">'.$item->title.'</a>';
	}
    }
    echo '</div>';
}
?>

hope this is helpful...have fun.

I don't have a blog and i am a fan of keeping things together....so don't bother if i'm posting such things here and write me if such usecases are not helpful or nonsense...... ;)

Best regards mr-fan

There's a tutorial board here in the forums where you would post such examples. I don't think it helps much in here.

Share this post


Link to post
Share on other sites

The selector only is used to filter the children of the current nodes.

Thanks Soma, I understand better now.

Share this post


Link to post
Share on other sites

There's a tutorial board here in the forums where you would post such examples. I don't think it helps much in here.

Ok if i've the time i collect my snippets to a "Tipps&Tricks with MarkupSimpleNavigation" topic - to get things connected.

For myself - i always read modulethreat completly if i'm using them to get the best start or knowlegde about the used addon...Read the fucking Manual....is not a option it is a obligation if you are new to a cms/module/technique....;)

But i will follow your advice since it better fits as tutorials than tracking issues or getting help.

Best regards and thank you for feedback mr-fan

Share this post


Link to post
Share on other sites

Markup Simple Navigation Module

While there was a lot of people asking how to make navigation, and there were many examples around already (apeisa, ryan...) I took the chance to sit down 2-3 hours to make a simple navigation module. It has even some options you can control some aspects of the output.

Installation:

1. Put this module's folder "MarkupSimpleNavigation" into your /site/modules folder.

2. Go to your module Install page and click "Check for new modules". It will appear under the section Markup. Click "install" button. Done.

Technically you don't even need to install it, after the first load call ( $modules->get("MarkupSimpleNavigation") ) it will install automaticly on first request if it isn't already. But it feels better. However, it will not be "autoloaded" by Processwire unless you load it in one of your php templates.

Documentation:

https://github.com/somatonic/MarkupSimpleNavigation/blob/master/README.md

Modules Repository processwire.com

mods.pw/u

Download on github

https://github.com/somatonic/MarkupSimpleNavigation

Advanced example with hooks

creating a Bootstrap 2.3.2 Multilevel Navbar

https://gist.github.com/somatonic/6258081

I use hooks to manipulate certain attributes and classes to li's and anchors. If you understand the concept you can do a lot with this Module.

could i put the "creating a Bootstrap 2.3.2 Multilevel Navbar" code in the _init.php to run ?

Share this post


Link to post
Share on other sites

The load and setup hooks you could put in _init.php but the render would be where you render your navigation.

Share this post


Link to post
Share on other sites

Hi Soma,

I need to use plain PHP pages ("/foo/bar.php") to a website powered by ProcessWire. How can I add this in Markup Simple Navigation?

Sample structure that shows the mix of Processwire pages and PHP pages in use:

  • Products
    • Product 1
    • Product 2
    • Product 3
    • Request quote <- Quote form in plain PHP.
  • References
  • About us

Share this post


Link to post
Share on other sites

I need to use plain PHP pages ("/foo/bar.php") to a website powered by ProcessWire. How can I add this in Markup Simple Navigation?

Question: any particular reason why the form needs to be processed outside of PW?

Share this post


Link to post
Share on other sites

Wanted to ask the same.

Only way I see is use a page with a text field to enter a path to a php file. Then use that field as in the url tag in the item template. I.e. href='{pathphp|url}'

Share this post


Link to post
Share on other sites

@Mike Rockett & Soma: The reason for processing the form outside PW is that it's part of a 3rd party booking system using an external database.

I have the following enhancement request for the module: "It shall be possible to include plain PHP pages ("/foo/bar.php") from third party plug-ins and the like to MarkupSimpleNavigation. Suggested solution is to allow adding in-memory pages to the navigation entries on the fly. The purpose of adding in-memory pages is to place the 3rd party page in PWs Page structure. Something along these lines:

$p = new Page();
$p->setOutputFormatting(false);
$p->parent = $pages->get("/MyParentPage");
$p->template = "SomeTemplate";
$p->title = "External page";
$p->name = "external_page";
// Note I do not use $p->save(), so it's a pseudo page that exists in memory only.
// Add the page to $entries somehow [...] -> $entries = $pages->get("/")->navigation_entries; ....
$entries = $pages->get("/")->navigation_entries; // Load entries (including our new page)
echo $treeMenu->render(null, null, $entries);

(Perhaps this is already possible without making changes to the module?)

Right now, I will go ahead and 1) make a unique template for the form that "include()" the form from a PHP file, 2) add a PW page for the form and 3) repeat this process for all relevant files (4 times in total per site using the booking system). I can then output a link and title to the page using MarkupSimpleNavigation. (I have done this before, it's a bit cumbersome but it will work.)

Share this post


Link to post
Share on other sites

While it would be possible to inject in memory pages, I don't want to go that route for various reasons.

What I do is add a dummy page as you mention. Then add a field "exturl" to the template. Then enter the url in that field like "/path/to/file.php".

In the navigation code you then use "exturl" in the item_tpl:

$options = array("item_tpl" => "<a href='{exturl|url}>{title}</a>');
  • Like 1

Share this post


Link to post
Share on other sites

I have problems with outputting the whole Menu Tree  up to the parent page Product when in 3rd level of a submenu.

The structure is

Home

  Products

      product 1

      product 2

         Item 1

         Item 2

         Item 4

      product 3

My menu looks like this

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

$leftNavOptions = array(
	'max_levels' => 3,
	'collapsed' => true,
	'show_root' => false,
	'levels' => true,
	'outer_tpl' => '<ul id="leftNavOuter" class="noPrint">||</ul>',
	'firstlast' => true
);

$root = $page->parents->count == 1 ? $page : $page->parent;
echo $leftNav->render($leftNavOptions, $page, $root);

that works perfect well until you navigate into the 3rd Level, then all levels above disapear and you see only the items level

Is there a way to output all three levels when in 3rd level?

Your help is much appreciated.

Share this post


Link to post
Share on other sites

that works perfect well until you navigate into the 3rd Level, then all levels above disapear and you see only the items level

I think your problem comes from this:

$root = $page->parents->count == 1 ? $page : $page->parent;

For the first two levels $root is "Products", but on the third level $root is "product 2" or whatever level 2 parent you are in. So you only see children of "product 2".

I think this will do what you want:

$root = $page->rootParent;

Share this post


Link to post
Share on other sites

Hello all,

I have two questions:

First:

using MSN Module ... is it possible to have "unlinked" items  in the menu?.
I have several pages that serve as headlines to structure the content better. They have a seprate template (menu-ueberschrift) and they should not be clickable ... just be there as plain text. These Items have children. I want an uncollapsed menu..

Second question:

Goes into the same direction: I would like to have active pages without links, too. I think there is no need for links  for a page I'm currently viewing.

Hopefully someone can help, as I'm stuck here.

Share this post


Link to post
Share on other sites

Solved it myself ...

Finally managed to set up hooks:

function myItemString(HookEvent $event) {
    $child = $event->arguments('page'); // current rendered child page
    // any logic with $child possible here
    
    /**
     * Überschriften
     */
    if ($child->template->name == 'menue-ueberschrift') {
        $event->return = "<span> $child->title</span>";
    };

    /**
     * active
     */
    if ($child->template->name == 'standard') {
        if ($child->id == wire('page')->id) {
            $event->return = "<span> $child->title</span>";

        }
    };
}

// setup the hook after on ___getItemString($class, $page) method
$nav->addHookAfter('getItemString', null, 'myItemString');
/* Render Navigation Markup adding options, too---------------- */
echo $nav->render()

Seems to work so I guess it's ok.

And I've learned something new :-)

Cheers Hanna

  • Like 2

Share this post


Link to post
Share on other sites

Ok,

I am having some issues with this menu (will be in bootstrap).

I currently have:

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

	 function hookGetListClass(HookEvent $event){
	    $child = $event->arguments('page'); // current rendered child page
	    $class = $event->arguments('class'); // the class string already present
			$options = array(
				'has_children_class' => 'dropdown',
				'outer_tpl' => '<ul class="nav">||</ul>',
				'inner_tpl' => '<ul class="dropdown-menu">||</ul>'
			);


	     // any check on that child to set your custom class
	     if($child->id == 1001){
	         $event->return .= " inner"; // add your custom class to the existing
	     }
	 }

	 // setup the hook after on ___getListClass($class, $page) method
	 $nav->addHookAfter('getListClass', null, 'hookGetListClass');
	 echo $nav->render($options);
	 ?>

However, the nav doesnt seem to be taking the options, and is instead using the "has_children" class. I saw a post almost exactly like this, but couldnt get the outcome. The inner ul should have a class of "dropdown".

Share this post


Link to post
Share on other sites

Hey guys,

I love this plugin. It works almost perfect for me. But I have a little question. I want that the parents don´t have a link.

This is my markup now:
<nav>
               
        <a href="<?=$config->urls->root; ?>" id="home">Von der Berkelaue</a>
       
        <?php 
            $treeMenu = $modules->get("MarkupSimpleNavigation"); // Modul laden   

        
            $options = array(
                'max_levels' => 2,
                'show_root' => true,
                'outer_tpl' => '<ul id="menu">||</ul>',
                'inner_tpl' => '<ul>||</ul>',
                'list_tpl' => '<li%s>||</li>',
                'item_tpl' => '<a href="{url}">{title}</a>',
                'item_current_tpl' => '<a href="{url}" class="active">{title}</a>',
                'debug' => true,
                'selector' => 'template!=aktuelles-eintrag, has_parent!=/galerie/',
            );
            echo $treeMenu->render($options); // Navigation rendern
        ?>
    </nav>

And this is my output:

<ul id="menu">
    <li class="current"><a href="/" class="active">Startseite</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li><a href="/aktuelles/">Aktuelles</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li class="has_children"><a href="/uber-uns/">Über uns</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
        <ul>
            <li><a href="/uber-uns/familie/">Familie</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/uber-uns/unsere-hunde/">Unsere Landseer</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
        </ul>
    </li>
    <li><a href="/wurfplanung/">Wurfplanung</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li class="has_children"><a href="/wurfe/">Würfe</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
        <ul>
            <li><a href="/wurfe/wurfplanung/">A-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/b-wurf/">B-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/c-wurf/">C-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/d-wurf/">D-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/e-wurf/">E-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/f-wurf/">F-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/g-wurf/">G-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
        </ul>
    </li>
    <li><a href="/galerie/">Galerie</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li><a href="/gastebuch/">Gästebuch</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li><a href="/links/">Links</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li><a href="/kontakt/">Kontakt</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
</ul>
<!-- [MarkupSimpleNavigation Rendertime: 0.0366] -->
</nav>

And it should look like this:

<ul id="menu">
    <li class="current"><a href="/" class="active">Startseite</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li><a href="/aktuelles/">Aktuelles</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li class="has_children"><a href="#">Über uns</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
        <ul>
            <li><a href="/uber-uns/familie/">Familie</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/uber-uns/unsere-hunde/">Unsere Landseer</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
        </ul>
    </li>
    <li><a href="/wurfplanung/">Wurfplanung</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li class="has_children"><a href="#">Würfe</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
        <ul>
            <li><a href="/wurfe/wurfplanung/">A-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/b-wurf/">B-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/c-wurf/">C-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/d-wurf/">D-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/e-wurf/">E-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/f-wurf/">F-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
            <li><a href="/wurfe/g-wurf/">G-Wurf</a>
                <!-- [Selector Level2: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
            </li>
        </ul>
    </li>
    <li><a href="/galerie/">Galerie</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li><a href="/gastebuch/">Gästebuch</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li><a href="/links/">Links</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
    <li><a href="/kontakt/">Kontakt</a>
        <!-- [Selector Level1: template!=aktuelles-eintrag, has_parent!=/galerie/] -->
    </li>
</ul>
<!-- [MarkupSimpleNavigation Rendertime: 0.0366] -->
</nav>

I hope you understand my problem. My english isn´t very good :D

Thanks, Jannis

Share this post


Link to post
Share on other sites

Hi Jannis,

Is  that you want this

<li class="has_children"><a href="#">Über uns</a>

appear like a headline ? with no link?

I think it would be a good idea to give those 'headlines' their own template like 'ueberschrift' or so.

Then you could proceed similar to what I posted here using a hook.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks HannaP,

this should work. But I find now another way to solve it. 

Still thanks!

Share this post


Link to post
Share on other sites

Hi,

i am using this Module for quit a while with great joy. Easy to implement and very flexible.

Right now i wonder if something like this is possible by using just the module options without hooking the core: I have a 2-level menu with several parents and relevant child pages. On last parent the child array is (should) populated from a variable ($items), which collects only (child) pages with dedicated page view permission.

So i fiddle around with the "selector_levelN" option. First try:

$options = array(
  "levels" => true,
  "max_levels" => 2,
  "selector_level2" => "id=$items"
);

This gives me the expected result in level2 on the last child tree, but fails of course because the selector ("id="$items") returns nothing on all other parent/child levels. What i would need is some condition like (Tried this and other notations, no luck):

$options = array(
...
"selector_level2" => (parent=<id>) ? "id=$items" : ""
);

In words. If the parent page has a dedicated ID (here: the parent page which holds all permission controlled (child) pages), populate the "selector_level2" option with predefined pages ($items), otherwise don't constrain the collecting for level 2.

Probably this is the nutshell: Are condition possible/allowed in module option selector values?

cheers and thanks

felic

Share this post


Link to post
Share on other sites

You could perhaps use OR-groups in the selector (untested):

$options = array(
  "level" => true,
  "max_levels" => 2,
  "selector_level2" => "(parent!=$lastpageid), (id=$items)"
);
  • Like 1

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...