Recommended Posts

Note: this functionality is now built into AdminOnSteroids.

 

I'd hate to know how much accumulated time I have spent and how much eye-strain I have experienced over the last couple of years, hunting through the 675 icons in the "all icons" view for the one I want. Today I finally got around to doing something about it. :)

IconsFilter

Allows the "all icons" view in InputfieldIcon to be filtered by name.

Usage

Install the IconsFilter module.

When viewing "all icons" in InputfieldIcon (Advanced tab of field/template settings) you can filter the icons by name using the filter input at top right.

 

2017-05-30_210009.png.d2aaa88ed277f359aa5049a98e77ea58.png

 

https://github.com/Toutouwai/IconsFilter

 

@tpr, something that could be merged into AdminOnSteroids?

  • Like 10

Share this post


Link to post
Share on other sites

Sure, but I would take a different approach, namely Choices, see the "Single select input" example.

Share this post


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

Sure, but I would take a different approach, namely Choices, see the "Single select input" example.

But the idea is to filter the icons preview, not the select options.

Share this post


Link to post
Share on other sites

Yepp I noticed that after posting. Somehow mixing the two would be the best, having an autocomplete and preview too. Choices could use a callback to filter the icons too but it would overlap the icons. Using Choices with custom template that shows the icons in multiple columns could work  though (just tried it in devtools).

Share this post


Link to post
Share on other sites

This is great, thanks! May I have a suggestion too? Searching by name is one thing, but what if we could search by "tags"? I mean lots of icons can be used in different contexts, and most of the time I cannot even guess the name.

For example I use "Car" for the article excerpt/ledes (in a "leading the way" sense). More examples I use: Trophy => bagde, Fire => effects, Compass => sku, etc...

These associations could be (hard?) wired into the module, so that you can make search possible this way too. I would be happy to contribute, or even better, you could somehow make it possible for everyone to contribute.

  • Like 2

Share this post


Link to post
Share on other sites

jets looks great!

The icon selector's markup seems a bit overkill to me. The spans are unnecessary and the JS hover events could be replaced with a few lines of CSS. The markup for the .InputfieldIconAll div is 100+ kbytes which could be easily cut by half. I know it's not a big deal but still. Perhaps a facelift PR could be put together containing a filter update?

  • Like 1

Share this post


Link to post
Share on other sites

I played a bit with InputfieldIcon.js and CSS and a few improvements could be made:

  • use :active state to zoom the icons + show its name using CSS attr()
  • deselect an icon by clicking on it (instead of selecting the first option in the select box)
  • do not re-initialize the icons after re-open (click events are currently fired multiple times if so)
  • plus do not add those 675 spans :) 

 

icon-selector.gif

  • Like 3

Share this post


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

i've been using the enhanced icon select in my selectize template and field tags module, which has served well for the past year

Somehow I missed the enhanced icon select part of the module - damn, wish I found that earlier.

10 hours ago, tpr said:
  • do not re-initialize the icons after re-open (click events are currently fired multiple times if so)
  • plus do not add those 675 spans :) 

I take you mean to propose changes for that in the core, because it isn't possible to do in a module.

Share this post


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

I take you mean to propose changes for that in the core, because it isn't possible to do in a module.

Sure, and a filter part in AOS if Ryan wouldn't like it to be in the core.

Share this post


Link to post
Share on other sites

I've added Robin's code to AOS (unreleased yet) with some tweaks (use placeholder search character instead ::before pseudo, on enter select first match and do not submit the form, focus on expanding the icons and position the filter next to the Show all button instead floating. I've also posted a PR to the core InputfieldIcon.

  • Like 6

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 Anssi
      A simple module to enable easy navigation between the public and the admin side of the site. After installation a green bar will appear to the upper side of the screen, containing a few navigation elements and displaying the PW version number.
      Heavily inspired by @apeisa's great AdminBar (Thanks!). I needed a bit simpler tool for my projects and as a result, this was made. Available on GitHub .

    • By Sebi
      I've created a small module which lets you define a timestamp after which a page should be accessible. In addition you can define a timestamp when the release should end and the page should not be accessable any more.
      Github: https://github.com/Sebiworld/PageAccessReleasetime
      Usage
      PageAccessReleasetime can be installed like every other module in ProcessWire. Check the following guide for detailed information: How-To Install or Uninstall Modules
      After that, you will find checkboxes for activating the releasetime-fields at the settings-tab of each page. You don't need to add the fields to your templates manually.
      Check e.g. the checkbox "Activate Releasetime from?" and fill in a date in the future. The page will not be accessable for your users until the given date is reached.
      If you have $config->pagefileSecure = true, the module will protect files of unreleased pages as well.
      How it works
      This module hooks into Page::viewable to prevent users to access unreleased pages:
      public function hookPageViewable($event) { $page = $event->object; $viewable = $event->return; if($viewable){ // If the page would be viewable, additionally check Releasetime and User-Permission $viewable = $this->canUserSee($page); } $event->return = $viewable; } To prevent access to the files of unreleased pages, we hook into Page::isPublic and ProcessPageView::sendFile.
      public function hookPageIsPublic($e) { $page = $e->object; if($e->return && $this->isReleaseTimeSet($page)) { $e->return = false; } } The site/assets/files/ directory of pages, which isPublic() returns false, will get a '-' as prefix. This indicates ProcessWire (with activated $config->pagefileSecure) to check the file's permissions via PHP before delivering it to the client.
      The check wether a not-public file should be accessable happens in ProcessPageView::sendFile. We throw an 404 Exception if the current user must not see the file.
      public function hookProcessPageViewSendFile($e) { $page = $e->arguments[0]; if(!$this->canUserSee($page)) { throw new Wire404Exception('File not found'); } } Additionally we hook into ProcessPageEdit::buildForm to add the PageAccessReleasetime fields to each page and move them to the settings tab.
      Limitations
      In the current version, releasetime-protected pages will appear in wire('pages')->find() queries. If you want to display a list of pages, where pages could be releasetime-protected, you should double-check with $page->viewable() wether the page can be accessed. $page->viewable() returns false, if the page is not released yet.
      If you have an idea how unreleased pages can be filtered out of ProcessWire selector queries, feel free to write an issue, comment or make a pull request!
    • By David Karich
      Thanks to the great Pro module "RepeaterMatrix" I have the possibility to create complex repeater items. With it I have created a quite powerful page builder. Many different content modules, with many more possible design options. The RepeaterMatrix module supports the cloning of items, but only within the same page. Now I often have the case that very design-intensive pages and items are created. If you want to use this module on a different page (e.g. in the same design), you have to rebuild each item manually every time.
      With this proof of concept I have created a module which adds the feature to copy a repeater item to the clipboard so that you can paste this item to another page with the same repeater field. The module has been developed very rudimentarily so far. It is currently not possible to copy nested items. There is also no check of Min/Max. You can also only copy items that have the same field on different pages. And surely you can solve all this more elegantly with AJAX. But personally I lack the deeper understanding of the repeaters. Also missing on the Javascript side are event triggers for the repeaters, which would make it easier. Like e.g. RepeaterItemInitReady or similar.
      it would be great if @ryan would implement this functionality in the core of RepeaterMatrix. I think he has better ways to implement this. Or what do you think, Ryan?
      Everybody is welcome to work on this module and improve it, if it should not be integrated into the matrix core. Therefore I put it for testing and as download on GitHub: https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDublicate
      You can best see the functionality in the screencast: 
       
    • By anderson
      Hi,
      Please take a look at this:
      https://templatemag.com/demo/Good/
      The upper nav bar, including dropdowns like "pages" and "portfolios", what do you call this whole thing? At first I guess it's called "dropdown nav bar", but seems not.
      AND of course, what's the simplest way/module to achieve this in PW?
      Thanks in advance.
    • By Sebi2020
      Hey, I'm new and I created a simple module for tagging pages because I didn't found a module for it (sadly this is not a core feature). This module is licensed under the GPL3 and cames with absolutly no warranty at all. You should test the module before using it in production environments. Currently it's an alpha release. if you like the module or have ideas for improvements feel free to post a comment. Currently this fieldtype is only compatible with the Inputfield I've created to because I haven't found  an Inputfield yet, that returns arrays from a single html input.
      Greetings Sebi2020
      FieldtypeTags.zip.asc
      InputfieldTagify.zip
      InputfieldTagify.zip.asc
      FieldtypeTags.zip