Jump to content
adrian

Admin Restrict Branch

Recommended Posts

Hi everyone,

Some critical updates this morning:

1) The module stopped doing anything in recent versions of PW 3 - I don't exactly when, but this is now fixed.

2) I also added support for restricting the new Pages > Tree dropdown menu that was added in 3.0.55

Please let me know if you find any problems with these changes or if you find any other situations where the module is no longer working. Given the rapid development of new ways to access the page tree that are being added to PW, I strongly recommend thoroughly testing your site if this module is protecting critical info from certain users. Hopefully everything is already taken care of for the current PW dev version, but with the UiKit admin theme, there could be possible breaks.

Thanks for testing and letting me know!

  • Like 3

Share this post


Link to post
Share on other sites
6 hours ago, PWaddict said:

@adrian Is it possible with this module to hide specific pages under home or I should stay with the hardcoded HideOtherUserPages module?

This module is for restricting users to a single branch of the page tree rather than hiding various ones throughout the entire tree. You'll need one of those other options for that. Maybe a module could be put together with more flexibility, but there are lots more issues when hiding specific pages.

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

This module is for restricting users to a single branch of the page tree rather than hiding various ones throughout the entire tree. You'll need one of those other options for that. Maybe a module could be put together with more flexibility, but there are lots more issues when hiding specific pages.

I selected Specified Branch Parent and then on the user's profile field I selected the Home branch. Then on the Branch edit exclusions I selected a page under the Home that I want to hide but it's still visible. What am I missing?

Share this post


Link to post
Share on other sites
5 minutes ago, PWaddict said:

I selected Specified Branch Parent and then on the user's profile field I selected the Home branch. Then on the Branch edit exclusions I selected a page under the Home that I want to hide but it's still visible. What am I missing?

Sorry, I think you have misunderstood how this works. If you are using the "Specified Branch Parent" - that is where you select the branch that you want the user restricted to. The "Branch Edit Exclusions" are just for things like external PageTable branches etc that the user still needs edit access to, even though they are outside their restricted branch.

Does that clear things up?

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

Sorry, I think you have misunderstood how this works. If you are using the "Specified Branch Parent" - that is where you select the branch that you want the user restricted to. The "Branch Edit Exclusions" are just for things like external PageTable branches etc that the user still needs edit access to, even though they are outside their restricted branch.

Does that clear things up?

Ok now I understand, thanks. I will stay then with the hardcoded HideOtherUserPages module.

Share this post


Link to post
Share on other sites

@adrian

I am working on a multisite project using single database. I forked multisite.module by Antti and another fork by Soma and started to adapt it for my needs. Luckily I found your module. I tried it out and it fits 90% to my needs and already saved a lot of work. Thanks for this great module. :rolleyes:

To get it working properly I need to make some changes. I think these changes could also be an enhancement of your module and you maybe want to take it.

First of all I need an option to set  branchRootParentId via hook which is currently not possible since the related function isn't hookable and private too.
It would be nice if you could change the visibility of the function getBranchRootParentId() to protected and make it hookable.
As far I can see there is no reason (security) to refrain from this.

Furthermore there are 2 unexpected behaviours or potential issues:

  1. In Processwire the breadcrumb 'Pages' is prepended to breadcrumbs in the PageEdit area of the root page only. @see ProcessPageEdit::setupBreadcrumbs()
    This behaviour is different in your module. The breadcrumb is prepended in any Editor not only for the branchRootParent since $this->wire('breadcrumbs')->count() returns always 0. Is this wanted like that?
    I would prefer the default behavior here. I found a working solution. If you like I could post an issue on github.
     
  2. The BranchRootParent is not prepended to the Pagetree under PagesTab.
    ProcessPageList::executeNavJSON() doesn't prepend branchRootParent here. This couldn't be solved inside your module.
    I can see a PW issue here. ProcessPageList::executeNavJSON() should use $config->rootPageID instead of hardcoded 1

    Possible Solution
    // in ProcessPageList::executeNavJSON
    // Line 489 from
    if(!$parentID) $parentID = 1;
    // to 
    if(!$parentID) $parentID = $config->rootPageID;
    
    // Line 494 from
    if($parentID === 1 && $parentViewable) $items->prepend($parent);
    // to
    if($parentID === $config->rootPageID && $parentViewable) $items->prepend($parent);
    
    // Line 523 from
    $numChildren = $id > 1 ? $page->numChildren : 0;
    // to
    $numChildren = $id != $config->rootPageID ? $page->numChildren : 0;
    
    // Line 551 from
    if($page->id > 1 && $page->numChildren) {
    // to
    if($page->id != $config->rootPageID && $page->numChildren) {
    
    //in your module
    public function ready() {
    $this->wire('config')->rootPageID = $this->branchRootParentId;
    // ...
    }

 

  • Like 2

Share this post


Link to post
Share on other sites
On 5/7/2017 at 5:34 AM, kixe said:

@adrian

I am working on a multisite project using single database. I forked multisite.module by Antti and another fork by Soma and started to adapt it for my needs. Luckily I found your module. I tried it out and it fits 90% to my needs and already saved a lot of work. Thanks for this great module. :rolleyes:

 

Working on a similar project, a kind of site parameterised site cloner. All in one PW install for maintenance commodity. Would love to see the outcome of this discussion :)

Share this post


Link to post
Share on other sites

Hi @kixe - thanks for all your thoughts here. Hopefully you know that I have been away and not just ignoring your post!

On 5/7/2017 at 3:34 AM, kixe said:

First of all I need an option to set  branchRootParentId via hook which is currently not possible since the related function isn't hookable and private too.
It would be nice if you could change the visibility of the function getBranchRootParentId() to protected and make it hookable.

The latest version has the getBranchRootParentId function hookable.

 

On 5/7/2017 at 3:34 AM, kixe said:

In Processwire the breadcrumb 'Pages' is prepended to breadcrumbs in the PageEdit area of the root page only. @see ProcessPageEdit::setupBreadcrumbs()
This behaviour is different in your module. The breadcrumb is prepended in any Editor not only for the branchRootParent since $this->wire('breadcrumbs')->count() returns always 0. Is this wanted like that?
I would prefer the default behavior here. I found a working solution. If you like I could post an issue on github.

The reason I did this is because when a user is restricted to a branch of the page tree, there is no "Home" breadcrumb, so I added this to give them easy access back to the root of the pages they have access to. I am curious about the working solution you have though - maybe it takes care of what we both want?

 

On 5/7/2017 at 3:34 AM, kixe said:

The BranchRootParent is not prepended to the Pagetree under PagesTab.
ProcessPageList::executeNavJSON() doesn't prepend branchRootParent here. This couldn't be solved inside your module.
I can see a PW issue here. ProcessPageList::executeNavJSON() should use $config->rootPageID instead of hardcoded 1

I think that regardless of the interaction with this, module those "1" values shouldn't be hardcoded in the PW as you noted - maybe you could submit a PR to Ryan to fix those? As for the actual prepending of BranchRootParent to the Pagetree under PagesTab, do you mean here:

595d410885623_ScreenShot2017-07-05at12_41_40PM.png.c958f147dce322a2066dd0a1bfe6c4a7.png

Test One and Test Two and children of the BranchRootParent and as you note, the BranchRootParent itself is not shown. Not critical, but I agree it would be nicer if it was, but from some quick looking around I don't think it's going to be possible at the moment without manually prepending the BranchRootParent to the markup returned by  ProcessPageList::executeNavJSON - certainly possible, but not pretty.

Any thoughts on my comments?

I'd certainly like to help as much as possible for you on this, so just let me know.

Cheers,
Adrian

 

  • Like 1

Share this post


Link to post
Share on other sites

@adrian First of all: Welcome back!

5 hours ago, adrian said:

The latest version has the getBranchRootParentId function hookable.

Great, Thanks!

Check out my fork to see the changes I made.
https://github.com/kixe/AdminRestrictBranch/tree/kixe

Everything is working pretty good together with the small changes in ProcessPageList::executeNavJSON()

6 hours ago, adrian said:

I think that regardless of the interaction with this, module those "1" values shouldn't be hardcoded in the PW as you noted - maybe you could submit a PR to Ryan to fix those?

Ryan is very busy and there are some other unsolved issues I am interested in. Furthermore there are many other places in the core where '1' is used instead of $config->rootPageID. I think it should be consistent but its not so easy to change this.

 

Share this post


Link to post
Share on other sites

@adrian Thanks for this awesome module!

Until now, I didn't have a real use-case for this module, but for an upcoming project I think I might use it.

Is it possible to define more than one single branch tree? Let's say I have three areas (parents) I want to allow user x to see/edit, would I define this via "Branch parent to restrict access to"? Is that the way to go?

Share this post


Link to post
Share on other sites
Just now, dragan said:

Is it possible to define more than one single branch tree? Let's say I have three areas (parents) I want to allow user x to see/edit, would I define this via "Branch parent to restrict access to"? Is that the way to go?

Unfortunately that's not possible with the way this module works.

There is lots of discussion floating around about why it's difficult to hide parts of the page tree - have a read starting here: https://processwire.com/talk/topic/1176-hiding-uneditable-pages-from-users/?do=findComment&comment=84916 - there are links to some different gists that might be helpful for you.

  • Like 1

Share this post


Link to post
Share on other sites

Great module @adrian.

For the Custom PHP Code option, can you make it also have access to the $pages variable (in addition to just the $user variable)?  I have a use case for it and it would be helpful.  I modified the module to include it and it worked fine for me.

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, Jonathan Lahijani said:

Great module @adrian.

For the Custom PHP Code option, can you make it also has access to the $pages variable (in addition to just the $user variable)?  I have a use case for it and it would be helpful.  I modified the module to include it and it worked fine for me.

Glad you like it 🙂

I don't see any reason not to. Would you mind submitting a PR? Please bump the version number as well so I can just accept and it's done.

Thanks!

  • Like 1

Share this post


Link to post
Share on other sites
25 minutes ago, adrian said:

I don't see any reason not to.

Using the fuctions API would be one reason 😛😉 

Share this post


Link to post
Share on other sites
14 minutes ago, bernhard said:

Using the fuctions API would be one reason 😛😉 

I guess that is a way around needing to make $pages available. I just haven't got into using it yet - maybe I should?

Share this post


Link to post
Share on other sites

I was not totally serious and it was more targeting @Jonathan Lahijani and meaning something like: Why not use the functions api when it is only one setting away and does not need any modifications to any module? $config->useFunctionsAPI = true, that's it.

22 minutes ago, adrian said:

I just haven't got into using it yet - maybe I should?

Of course that's everybody's own decision, but I also started using it quite late and now I really like it. It makes things easier, shorter and better to read:

  public function executeTransactions() {
    $form = $this->modules->get('InputfieldForm');

    $f = $this->modules->get('InputfieldRockGrid');
    $f->name = 'transactions';
    $f->label = 'Overview of Transactions';
    $f->ajax = true;
    $form->add($f);

    return $form->render();
  }

I also prefer the array syntax now for adding fields:

  public function executeEfforts() {
    $form = modules('InputfieldForm');

    $form->add([
      'type' => 'RockGrid',
      'name' => 'efforts',
      'label' => 'Overview of Efforts',
      'ajax' => true,
    ]);

    return $form->render();
  }

To answer your question: If you've ever come across errors like "$pages/$modules/$users is not defined" or the like I'd suggest trying it out 😉 

Using VSCode + Intelephense I also get very nice code completion, so I don't see any reason not to use it. Only thing bothering me is when I am developing public modules I need to remember not to use the functions API as I can't assume everybody is using it.
iKum9eU.png 

zobNtEC.png 

ynKTA8F.png that's a lot worse IMHO 🙂 

  • Like 1

Share this post


Link to post
Share on other sites
On 9/25/2018 at 7:24 PM, adrian said:

I just haven't got into using it yet - maybe I should?

Another snippet promoting the functions api 😉

GPgNvNY.png41JBNEU.png

  • Like 1

Share this post


Link to post
Share on other sites
On 1/19/2016 at 2:26 AM, adrian said:

Sorry it's taken so long to get to, but the latest version of the module now has a new config setting to optionally exclude pages outside the restricted branch from the search results of pages.

I tried the latest version of this wonderful module today: I activated the module's config setting "Restrict from search results". After that, I logged in with a user who is restricted to a certain branch and tried to find some pages outside the restricted branch.

I used the search box in the upper right corner of the PW admin and was surprised to see that results are found outside the restricted branch.

The quoted sentence above is related to a search by Lister, I guess?

Share this post


Link to post
Share on other sites

@titanium - this used to work as expected - ie these pages could not be found via the search. I just took a look and it appears that relatively recent changes to this live search feature means that now other results are returned, but note that the links from these results go to view the returned pages, rather than allowing the user to edit them. So I think the main functionality has not been compromised.

Remember that this module is not designed to control view permissions, just editing.

  • Thanks 1

Share this post


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

I just took a look and it appears that relatively recent changes to this live search feature means that now other results are returned, but note that the links from these results go to view the returned pages, rather than allowing the user to edit them.

Yeah, these view links are not helpful IMO. Related request: https://github.com/processwire/processwire-requests/issues/274

Edit: just noticed that you already thumbs-upped that. 🙂

  • Like 1

Share this post


Link to post
Share on other sites

IMPORTANT NOTICE!!!

Hi everyone. I just discovered something pretty important with this module.

If you are using the Role Name or Custom PHP Code option and matching a page name or path, you MUST be sure to check "No Access" for the "If no match, give all access or no access?" setting. If you don't do this, a site editor could change the name of their branch parent, which would result in no match and hence they could gain access to the entire page tree.

I am tempted to actually remove these two matching options to improve security - is anyone using them?

To make life easier, I have added a new "Role Specified Branch Parent" option which allows you to select a branch parent on a per role basis, rather than per user. I think in most cases this is the best option to use.

image.png.3d9d6575574a6ba68e4c8487707c25cf.png

Please be sure to check your settings and if you can please switch to the "Role specified" or "User specified" options in the new version.

Let me know if you have any questions or concerns.

Thanks,
Adrian

  • Like 3

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 teppo
      Hey folks!
      Took a couple of late nights, but managed to turn this old gist of mine into a proper module. The name is SearchEngine, and currently it provides support for indexing page contents (into a hidden textarea field created automatically), and also includes a helper feature ("Finder") for querying said contents. No fancy features like stemming here yet, but something along those lines might be added later if it seems useful (and if I find a decent implementation to integrate).
      Though the API and selector engine make it really easy to create site search pages, I pretty much always end up duplicating the same features from site to site. Also – since it takes a bit of extra time – it's tempting to skip over some accessibility related things, and leave features like text highlighting out. Overall I think it makes sense to bundle all that into a module, which can then be reused over and over again 🙂
      Note: markup generation is not yet built into the module, which is why the examples below use PageArray::render() method to produce a simple list of results. This will be added later on, as a part of the same module or a separate Markup module. There's also no fancy JS API or anything like that (yet).
      This is an early release, so be kind – I got the find feature working last night (or perhaps this morning), and some final tweaks and updates were made just an hour ago 😅
      GitHub repository: https://github.com/teppokoivula/SearchEngine Modules directory: https://modules.processwire.com/modules/search-engine/ Usage
      Install SearchEngine module. Note: the module will automatically create an index field install time, so be sure to define a custom field (via site config) before installation if you don't want it to be called "search_index". You can change the field name later as well, but you'll have to update the "index_field" option in site config or module settings (in Admin) after renaming it.
      Add the site search index field to templates you want to make searchable. Use selectors to query values in site search index. Note: you can use any operator for your selectors, you will likely find the '=' and '%=' operators most useful here. You can read more about selector operators from ProcessWire's documentation.
      Options
      By default the module will create a search index field called 'search_index' and store values from Page fields title, headline, summary, and body to said index field when a page is saved. You can modify this behaviour (field name and/or indexed page fields) either via the Module config screen in the PocessWire Admin, or by defining $config->SearchEngine array in your site config file or other applicable location:
      $config->SearchEngine = [ 'index_field' => 'search_index', 'indexed_fields' => [ 'title', 'headline', 'summary', 'body', ], 'prefixes' => [ 'link' => 'link:', ], 'find_args' => [ 'limit' => 25, 'sort' => 'sort', 'operator' => '%=', 'query_param' => null, 'selector_extra' => '', ], ]; You can access the search index field just like any other ProcessWire field with selectors:
      if ($q = $sanitizer->selectorValue($input->get->q)) { $results = $pages->find('search_index%=' . $query_string . ', limit=25'); echo $results->render(); echo $results->renderPager(); } Alternatively you can delegate the find operation to the SearchEngine module as well:
      $query = $modules->get('SearchEngine')->find($input->get->q); echo $query->resultsString; // alias for $query->results->render() echo $query->pager; // alias for $query->results->renderPager() Requirements
      ProcessWire >= 3.0.112 PHP >= 7.1.0 Note: later versions of the module may require Composer, or alternatively some additional features may require installing via Composer. This is still under consideration – so far there's nothing here that would really depend on it, but advanced features like stemming most likely would.
      Installing
      It's the usual thing: download or clone the SearchEngine directory into your /site/modules/ directory and install via Admin. Alternatively you can install SearchEngine with Composer by executing composer require teppokoivula/search-engine in your site directory.
    • By teppo
      MarkupMenu is a markup module for generating menu trees. When provided a root page as a starting point, it generates a navigation tree (by default as a HTML "<ul>" element wrapped by a "<nav>" element) from that point onwards. If you've also provided it with current (active) page, the menu will be rendered accordingly, with current item highlighted and items rendered up to that item and its children (unless you disable the "collapsed" option, in which case the full page tree will be rendered instead).
      Modules directory: https://modules.processwire.com/modules/markup-menu/ GitHub repository: https://github.com/teppokoivula/MarkupMenu Usage
      As a markup module, MarkupMenu is intended for front-end use, but you can of course use it in a module as well. Typically you'll only need the render() method, which takes an array of options as its only argument:
      echo $modules->get('MarkupMenu')->render([ 'root_page' => $pages->get(1), 'current_page' => $page, ]); Note: if you omit root_page, site root page is used by default. If you omit current_page, the menu will be rendered, but current (active) page won't be highlighted etc.
      A slightly more complex example, based on what I'm using on one of my own sites to render a (single-level) top menu:
      echo $modules->get('MarkupMenu')->render([ 'current_page' => $page, 'templates' => [ 'nav' => '<nav class="{classes} menu--{menu_class_modifier}" aria-label="{aria_label}">%s</nav>', 'item_current' => '<a class="menu__item menu__item--current" href="{item.url}" tabindex="0" aria-label="Current page: {item.title}">{item.title}</a>', ], 'placeholders' => [ 'menu_class_modifier' => 'top', 'aria_label' => 'Main navigation', ], 'include' => [ 'root_page' => true, ], 'exclude' => [ 'level_greater_than' => 1, ], ]); Note: some things you see above may not be entirely sensible, such as the use of {menu_class_modifier} and {aria_label} placeholders. On the actual site the "nav" template is defined in site config, so I can define just these parts on a case-by-case basis while actual nav markup is maintained in one place.
      Please check out the README file for available render options. I'd very much prefer not to keep this list up to date in multiple places. Basically there are settings for defining "templates" for different parts of the menu (list, item, etc.), include array for defining rules for including in the menu and exclude array for the opposite effect, classes and placeholders arrays for overriding default classes and injecting custom placeholders, etc. 🙂
      MarkupMenu vs. MarkupSimpleNavigation
      TL;DR: this is another take on the same concept. There are many similarities, but also some differences – especially when it comes to the supported options and syntax. If you're currently using MarkupSimpleNavigation then there's probably no reason to switch over.
      I'd be surprised if someone didn't draw lines between this module and Soma's awesome MarkupSimpleNavigation. Simply put I've been using MSN (...) for years, and it's been great – but there are some issues with it, particularly in the markup generation area, and it also does some things in a way that doesn't quite work for me – the xtemplates thing being one of these. In some ways less about features, and more about style, I guess 🙂
      Anyhow, in MarkupMenu I've tried to correct those little hiccups, modernise the default markup, and allow for more flexibility with placeholder variables and additional / different options. MarkupMenu was built for ProcessWire 3.0.112+ and with PHP 7.1+ in mind, it's installable with Composer, and I have a few additional ideas (such as conditional placeholders) still on my todo list.
      One more small(ish) difference is that MarkupMenu supports overriding default options via $config->MarkupMenu. I find myself redefining the default markup for every site, which until now meant that each site had a wrapper function for MarkupSimpleNavigation (to avoid code / config repetition), and this way I've been able to leave that out 🙂
      Requirements
      ProcessWire >= 3.0.112 PHP >= 7.1.0 If you're working on an earlier version of ProcessWire or PHP, use MarkupSimpleNavigation instead.
    • By teppo
      Hey folks!
      I'm happy to finally introduce a project I've been working on for quite a while now: it's called Wireframe, and it is an output framework for ProcessWire.
      Note that I'm posting this in the module development area, maily because this project is still in rather early stage. I've built a couple of sites with it myself, and parts of the codebase have been powering some pretty big and complex sites for many years now, but this should still be considered a soft launch 🙂
      --
      Long story short, Wireframe is a module that provides the "backbone" for building sites (and apps) with ProcessWire using an MVC (or perhaps MVVM – one of those three or four letter abbreviations anyway) inspired methodology. You could say that it's an output strategy, but I prefer the term "output framework" since in my mind the word "strategy" means something less tangible. A way of doing things, rather than a tool that actually does things.
      Wireframe (the module) provides a basic implementation for some familiar MVC concepts, such as Controllers and a View layer – the latter of which consists of layouts, partials, and template-specific views. There's no "model" layer, since in this context ProcessWire is the model. As a module Wireframe is actually quite simple – not even nearly the biggest one I've built – but there's still quite a bit of stuff to "get", so I've put together a demo & documentation site for it at https://wireframe-framework.com/.
      In addition to the core module, I'm also working on a couple of site profiles based on it. My current idea is actually to keep the module very light-weight, and implement most of the "opinionated" stuff in site profiles and/or companion modules. For an example MarkupMenu (which I released a while ago) was developed as one of those "companion modules" when I needed a menu module to use on the site profiles.
      Currently there are two public site profiles based on Wireframe:
      site-wireframe-docs is the demo&docs site mentioned above, just with placeholder content replaced with placeholder content. It's not a particularly complex site, but I believe it's still a pretty nice way to dig into the Wireframe module. site-wireframe-boilerplate is a boilerplate (or starter) site profile based on the docs site. This is still very much a work in progress, but essentially I'm trying to build a flexible yet full-featured starter profile you can just grab and start building upon. There will be a proper build process for resources, it will include most of the basic features one tends to need from site to site, etc. --
      Requirements and getting started:
      Wireframe can be installed just like any ProcessWire module. Just clone or download it to your site/modules/ directory and install. It doesn't, though, do a whole lot of stuff on itself – please check out the documentation site for a step-by-step guide on setting up the directory structure, adding the "bootstrap file", etc. You may find it easier to install one of the site profiles mentioned above, but note that this process involves the use of Composer. In the case of the site profiles you can install ProcessWire as usual and download or clone the site profile directory into your setup, but after that you should run "composer install" to get all the dependencies – including the Wireframe module – in place. Hard requirements for Wireframe are ProcessWire 3.0.112 and PHP 7.1+. The codebase is authored with current PHP versions in mind, and while running it on 7.0 may be possible, anything below that definitely won't work. A feature I added just today to the Wireframe module is that in case ProcessWire has write access to your site/templates/ directory, you can use the module settings screen to create the expected directories automatically. Currently that's all, and the module won't – for an example – create Controllers or layouts for you, so you should check out the site profiles for examples on these. (I'm probably going to include some additional helper features in the near future.)
      --
      This project is loosely based on an earlier project called pw-mvc, i.e. the main concepts (such as Controllers and the View layer) are very similar. That being said, Wireframe is a major upgrade in terms of both functionality and architecture: namespaces and autoloader support are now baked in, the codebase requires PHP 7, Controllers are classes extending \Wireframe\Controller (instead of regular "flat" PHP files), implementation based on a module instead of a collection of drop-in files, etc.
      While Wireframe is indeed still in a relatively early stage (0.3.0 was launched today, in case version numbers matter) for the most part I'm happy with the way it works, and likely won't change it too drastically anytime soon – so feel free to give it a try, and if you do, please let me know how it went. I will continue building upon this project, and I am also constantly working on various side projects, such as the site profiles and a few unannounced helper modules.
      I should probably add that while Wireframe is not hard to use, it is more geared towards those interested in "software development" type methodology. With future updates to the module, the site profiles, and the docs I hope to lower the learning curve, but certain level of "developer focus" will remain. Although of course the optimal outcome would be if I could use this project to lure more folks towards that end of the spectrum... 🙂
      --
      Please let me know what you think – and thanks in advance!
    • By Robin S
      After forgetting the class name of the wonderful AdminPageFieldEditLinks module for what feels like the 100th time I decided I needed to give my failing memory a helping hand...
      Autocomplete Module Class Name
      Provides class name autocomplete suggestions for the "Add Module From Directory" and "Add Module From URL" fields at Modules > New.
      Requires ProcessWire >= v3.0.16.
      Screencast

      Installation
      Install the Autocomplete Module Class Name module.
      Configuration
      Add Module From Directory
      Choose the type of autocomplete suggestions list: "Module class names from directory" or "Custom list of module class names". The latter could be useful if you regularly install some modules and would prefer a shorter list of autocomplete suggestions. The list of class names in the modules directory is generated when the Autocomplete Module Class Name module is installed. It doesn't update automatically (because the retrieval of the class names is quite slow), but you can use the button underneath when you want to retrieve an updated list of class names from the directory. Add Module From URL
      If you want to see autocomplete suggestions for the "Add Module From URL" field then enter them in the following format:
      [autocomplete suggestion] > [module ZIP url]
      Example: RepeaterImages > https://github.com/Toutouwai/RepeaterImages/archive/master.zip Awesomplete options
      The "fuzzy search" option uses custom filter and item functions for Awesomplete so that the characters you type just have to exist in the autocomplete suggestion item and occur after preceding matches but do not need to be contiguous. Uncheck this option if you prefer the standard Awesomplete matching. Custom settings for Awesomplete can be entered in the "Awesomplete options" field if needed. See the Awesomplete documentation for more information.  
      https://github.com/Toutouwai/AutocompleteModuleClassName
      https://modules.processwire.com/modules/autocomplete-module-class-name/
    • By Robin S
      Repeater Images
      Adds options to modify Repeater fields to make them convenient for "page-per-image" usage. Using a page-per-image approach allows for additional fields to be associated with each image, to record things such as photographer, date, license, links, etc.
      When Repeater Images is enabled for a Repeater field the module changes the appearance of the Repeater inputfield to be similar (but not identical) to an Images field. The collapsed view shows a thumbnail for each Repeater item, and items can be expanded for field editing.
      Screencast

      Installation
      Install the Repeater Images module.
      Setup
      Create an image field to use in the Repeater field. Recommended settings for the image field are "Maximum files allowed" set to 1 and "Formatted value" set to "Single item (null if empty)". Create a Repeater field. Add the image field to the Repeater. If you want additional fields in the Repeater create and add these also. Repeater Images configuration
      Tick the "Activate Repeater Images for this Repeater field" checkbox. In the "Image field within Repeater" dropdown select the single image field. You must save the Repeater field settings to see any newly added Image fields in the dropdown. Adjust the image thumbnail height if you want (unlike the core Images field there is no slider to change thumbnail height within Page Edit). Note: the depth option for Repeater fields is not compatible with the Repeater Images module.
      Image uploads feature
      There is a checkbox to activate image uploads. This feature allows users to quickly and easily add images to the Repeater Images field by uploading them to an adjacent "upload" field.
      To use this feature you must add the image field selected in the Repeater Images config to the template of the page containing the Repeater Images field - immediately above or below the Repeater Images field would be a good position.
      It's recommended to set the label for this field in template context to "Upload images" or similar, and set the visibility of the field to "Closed" so that it takes up less room when it's not being used. Note that when you drag images to a closed Images field it will automatically open. You don't need to worry about the "Maximum files allowed" setting because the Repeater Images module overrides this for the upload field.
      New Repeater items will be created from the images uploaded to the upload field when the page is saved. The user can add descriptions and tags to the images while they are still in the upload field and these will be retained in the Repeater items. Images are automatically deleted from the upload field when the page is saved.
      Tips
      The "Use accordion mode?" option in the Repeater field settings is useful for keeping the inputfield compact, with only one image item open for editing at a time. The "Repeater item labels" setting determines what is shown in the thumbnail overlay on hover. Example for an image field named "image": {image.basename} ({image.width}x{image.height})  
      https://github.com/Toutouwai/RepeaterImages
      https://modules.processwire.com/modules/repeater-images/
×
×
  • Create New...