ukyo

FieldtypeFontIconPicker

Recommended Posts

Hi! Awesome Module (pun intended) ;)

This would turn out very usefull for my next project, However I get some strange behaviour when leaving an edit page without changing anything on the icon. It gives me a confirm box saying there is unsaved content (see attachment). Does anybody have the same behaviour or knows what I do wrong here? 

Thanks for any suggestion. 

Sascha

Hi ukyo, did you find anything? ;)

Great extension! Very useful for a project of mine, thank you!

I have the same problem as saschapi. I save my page. Next I want to leave, I get a browser message (firefox) telling me that I have unsaved data.

Google translation from German:

"This page asks you to confirm that you want to leave the page - data you have entered will not be saved under certain circumstances."

I updated module, on my side i don't have this issue anymore ! Updated many things and changed methods for loading icon list etc..

Next step is use other font icons !

  • Like 3

Share this post


Link to post
Share on other sites

@ukyo

Thank you for updating your great module.

The update is not visible in ProcessUpgrade module so I would have to update manually. Is this intended?

My installed version is 0.0.7. Your github commit message for the module file itself says "FontAwesome updated to 4.4.0 and module updated to 0.0.7".

Shouldn't this be updated to 0.0.8 so that the ProcessUpgrade module can know that a new version is available?

Share this post


Link to post
Share on other sites

@ukyo

Thank you for updating your great module.

The update is not visible in ProcessUpgrade module so I would have to update manually. Is this intended?

My installed version is 0.0.7. Your github commit message for the module file itself says "FontAwesome updated to 4.4.0 and module updated to 0.0.7".

Shouldn't this be updated to 0.0.8 so that the ProcessUpgrade module can know that a new version is available?

Sorry i missed to update Fieldtype and Markup versions. But you need to wait for PorcesswireModuleDirectory update repos or you can make update by downloading files from github.

  • Like 1

Share this post


Link to post
Share on other sites
Sorry i missed to update Fieldtype and Markup versions. But you need to wait for PorcesswireModuleDirectory update repos or you can make update by downloading files from github.

You can always edit your module in the modules directory - simply open the edit mode and save - it will query Github and update the version number which will then make it available via the Upgrade module instantly.

  • Like 1

Share this post


Link to post
Share on other sites

Updated module on dev branch.

New features for v.0.0.9 dev branch :

  • Added hook method ___beforeRender(), you can check hook example for usage
  • Added multiple icons library use option
  • Added Ionicons Library
  • Now module using cdn for load icon fonts

Also if you need custom icon font options you can use berforeRender hook !

After some test i will update also master branch. if you want to make test, you need to download and update it manually.

  • Like 3

Share this post


Link to post
Share on other sites

I can also confirm that the error is gone with 0.0.8 on PW 2.7.0.

Thank you very much

Share this post


Link to post
Share on other sites

Hi,

I thought I'd try this module, but I got the following error:

Parse Error: 
syntax error, unexpected '[' (line 157 of /public_html/dev/site/modules/FieldtypeFontIconPicker/InputfieldFontIconPicker.module) 

PW 2.7.1

------------------

Edit: sorry, read the whole thread, seems dev-branche is working...

Kind regards.

Share this post


Link to post
Share on other sites

Your PHP version not supporting new array syntax, this is why you have this error message.

I updated module to ve 0.1.0 now i think module fully supporting old php versions.

New features for v.0.1.0 :

  • Custom CSS file url support
  • Added hook method ___beforeRender(), you can check hook example for usage
  • Added multiple icons library use option
  • Added Ionicons Library
  • Now module using cdn for load icon fonts
  • Like 1

Share this post


Link to post
Share on other sites

Hi! Thx for this cool module!
I want to use this with a costum Icon-Set and need some help. 
I did put an URL in the custom css field, but my Icons dont show up in the backend.
Is there anything else I have to do to get this to work?

 

Share this post


Link to post
Share on other sites
37 minutes ago, jploch said:

Hi! Thx for this cool module!
I want to use this with a costum Icon-Set and need some help. 
I did put an URL in the custom css field, but my Icons dont show up in the backend.
Is there anything else I have to do to get this to work?

 

css section is only for styling, you need to tell module what is your list of icons names ?

You need hook beforeRender event like on example. https://github.com/trk/FieldtypeFontIconPicker

You can create a file like : https://github.com/trk/FieldtypeFontIconPicker/blob/master/Icons/Ionicons.php

and you can include this file in your hook function, after include you can return your custom icons.

Share this post


Link to post
Share on other sites

Thx for your quick reply!

I made a custom.php file in MarkupFontIconPicker/Icons/ 
Now I have this in the admin.php in templates folder:

wire()->addHook('InputfieldFontIconPicker::beforeRender', function($event) {
    if(!$event->return) return;

    // Get Input Name (For specified input hook, if you want apply all InputfieldFontIconPicker remove inputName check)
    $inputName = "";
    if(isset($event->object->attributes['name'])) $inputName = $event->object->attributes['name'];

    // Get Input Name (For specified input hook, if you want apply all InputfieldFontIconPicker remove inputName check)
    if($inputName == 'icon_picker') {

        /**
        * Load your custom icons function file
        * Your array need to be same format with Icons/FontAwesome.php or Icons/Ionicons.php
        * Also you can pass directly an array
        */
        wireIncludeFile('http://projekte.janploch.de/fabricius/site/modules/MarkupFontIconPicker/Icons/custom.php');
        

        // Set icons as $icons variable
        $icons = MyCustomIconsArray();

        // Set your options
        $return = array(
            'attributes' => array(
                'category' => '',
                'theme' => 'fip-grey',
                'empty-icon' => 1,
                'empty-icon-value' => '',
                'icons-per-page' => 20,
                'has-search' => 1
            ),
            'icons' => $icons
        );

        // Return the event
        $event->return = $return;
    }

    $event->return;
});

In the Backend only the FontAwesome and Ionicicons library is showing. 

Custom File looks like this:
 

<?php
function InputfieldFontIconPickerIcons() {
    $icons = array(
        'title' => 'Custom',
        'version' => '2.0.1',
        'css' => 'http://projekte.janploch.de/fabricius/site/templates/fonts/icomoon/style.css',
        'categorised' => false,
        'prefix' => 'icon-icon-',
        'icons' => array(
           'doctor',
           'kita'
            )
     
    );

    return $icons;
}

 

Share this post


Link to post
Share on other sites

hey there great module,

but i have kind of an issue with it:


on creating a repeaterMatrix element with an icon-picker, i get a dropdown (create.PNG)
after closing the element and reopening it (with the little arrow on the right side) i get the icon picker. (closeReopen.PNG)

it seems so random, that i can't find an explanation for it.

ever got this issue ?

 

 

closeReopen.PNG

create.PNG

Share this post


Link to post
Share on other sites

After @ryan broke my hearth :'( here i added uikit icon support to my font icon picker module O0

58f7c3213e6a4_EkranResmi2017-04-1922_52_16.png.758edb32a529a34c716e94ff06823436.png

v.0.1.6

  • Fix FieldtypeFontIconPicker sanitizeValue()

v.0.1.5

  • Added uikit icon select support (required AdminThemeUikit), because uikit icons not working standalone.
  • Like 3

Share this post


Link to post
Share on other sites

Hello, I'm having this z-index problem within repeater any ideas how to solve this? I searched the forum but no luck.

aac52ea552db8854050ae915aafb578e.png

Outside repeater it works fine!

Thank you

R

Share this post


Link to post
Share on other sites

Hi ukyo,

thank you very much for this one - works like a charm!

I've set an additional library direct in the module, and all settings loaded right.

Is it possible to use a relative own CSS path...i've a icomoon set of licensed IconMind Icons...so i have to host them selve...

Kind Regards mr-fan

Share this post


Link to post
Share on other sites

All things sorted... everything is working fine!

Got this working with icomoon iconset - Thank you for your work on this!

 

Share this post


Link to post
Share on other sites

One Thing is missing . This Fieldtype is not working with RepeaterMatrix.

Could anybody jump in and could point me what i've to change that RepeaterMatrix could show the inputfield right...or is this something related to RepeaterMatrix itself?

Issue is that while adding a new item the scripts are not loaded...if i save all works again...

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 Robin S
      Breadcrumb Dropdowns
      Adds dropdown menus of page edit links to the breadcrumbs in Page Edit.

       
      Installation
      Install the Breadcrumb Dropdowns module. The module requires ProcessWire >= v3.0.83 and AdminThemeUikit.
      There is a checkbox option in the module config that determines if the breadcrumb dropdowns will include pages that the user does not have permission to edit.
      Features/details
      The module adds an additional breadcrumb item at the end for the currently edited page. That's because I think it's more intuitive for the dropdown under each breadcrumb item to show the item's sibling pages rather than the item's child pages. In the dropdown menus the current page and the current page's parents are highlighted in a crimson colour to make it easier to quickly locate them in case you want to edit the next or previous sibling page. If the option to include uneditable pages is selected then those pages are indicated by a reduced text opacity and the "not-allowed" cursor is shown on hover. There is a limit of 25 sibling pages per dropdown for performance reasons and to avoid the dropdown becoming unwieldy. Incompatibilities
      This module replaces the AdminThemeUikit::renderBreadcrumbs method so will potentially be incompatible with other modules that hook the same method.
       
      https://modules.processwire.com/modules/breadcrumb-dropdowns/
      https://github.com/Toutouwai/BreadcrumbDropdowns
    • By Macrura
      Field Descriptions Extended
      This module enables you to extend field descriptions by dividing short descriptions with a longer text that is revealed in a toggle.
      Modules Directory: http://modules.processwire.com/modules/field-descriptions-extended/
      Github: https://github.com/outflux3/FieldDescriptionsExtended
      Extending your field descriptions using the standard field's description field.
      Once this module is installed, it will automatically search your description field for the presence of 5 dashes (-----).
      Any content above the 5 dashes will be visible and the content below the dashes will be hidden. A 'More...' link will appear at the end of the short description which when clicked will reveal the rest of the description.
      Using Simple Markdown Editor with the description field
      If you have Simple Markdown Editor (InputfieldSimpleMDE) installed, you can enable the field description to have that editor.
      *When using Simple MDE, you can use the button (Insert Horizontal Line) instead of typing 5 dashes. More about SimpleMDE.
      Extending your field descriptions using content from a ProcessWire Page for the field description.
      You may use the content from a ProcessWire page as a field description. This would allow you to easily insert images, links, and use hanna codes.
      To use page content for your field descriptions, please follow these instructions:
      Install Select Fields module (FieldtypeFields) http://modules.processwire.com/modules/fieldtype-fields/ Create a new field using this field type, e.g. field_select. Add the field to any template you will be using for your field descriptions. Setup your help pages (for example under a settings branch) where you will store the field description content,using the template containing the Field Select. Add content to a page and select the field where that content should show. To show a short text before the link to the longer content, separate them with 5 dashes Be sure to update your settings on this page, first enable page content descriptions,then specify the name of the Select Fields field, template to search, and content field. If you create a field description using this method, please note that the description field must be blank for contexts where you want the page content to appear.
      You can freely use template context for field descriptions, but the Page Content method is not context sensitive and will display under all contexts where the description is blank.
      ----
      original post:
      This is a new module, hope to release soon, which allows extended field descriptions, in currently 2 ways.
      The main feature of the module is that you can have a short description and then a 'more...' link which drops down a longer block of text.
      This is achieved by separating the intro/visible text and the rest with 5 dashes.

      Example setup:

      the 2nd way is if you are using AdminThemeUiKit, you can show extended field instructions in a panel. The content of the panel is edited on a regular PW page. This use case would probably not be that common, but if you had a field that required some extended instructions for how to use, this could be useful; Also, since this allows you to target information and instructions down at the field level, it could reduce the amount of documentation needed on a global level, since it is a lot more context targeted.

    • By joshuag
      Hey guys, 
      Thought I would share a quick preview of Designme. A module we (Eduardo @elabx and I) are building for visually laying out your templates/edit screens. 🙂
      This is a really quick, zero polish screen grab. FYI. 
      Video #2 - UPDATE
      This new video shows the following features in Designme:
      Re-arranging fields via Drag & Drop Re-sizing fields via Dragging. Adjusting field settings - with live refresh. Working on "hidden" fields while Designme is active. Creating New fields. Deleting fields. Creating/Deleting Tabs. Dragging fields between tabs. Creating fieldsets. Tagging/Un-tagging fields. Fields without headers expand when hovered (like checkboxes). Live filtering of fields in the sidebar. Ability to adjust (all) Template settings without leaving Designme. Template File Tree Editing Template files source code with ACE Editor. Editing Multiple files with ACE Editor. (New Tabs) Saving files. Techie stuff Fields load their own js/css dependancies. *ready to use on creation (*most fields)  Everything happens via Ajax to ProcessPageEdit (via module + hooks). Designme has a JS api that you can use.  All actions trigger events.  We would love any detailed feedback on what you see so far. If you are interested in testing Designme. Let me know below. 🙂
       
       
      Video #1. 
       
    • By dreerr
      TemplateEnginePug (formally TemplateEngineJade)
       
      This module adds Pug templates to the TemplateEngineFactory. It uses https://github.com/pug-php/pug to render templates.
      doctype html html(lang='en') head meta(http-equiv='content-type', content='text/html; charset=utf-8') title= $page->title link(rel='stylesheet', type='text/css', href=$config->urls->templates . 'styles/main.css') body include header.pug h1= $page->title if $page->editable() p: a(href=$page->editURL) Edit Project on GitHub: github.com/dreerr/TemplateEnginePug
      Project in modules directory: modules.processwire.com/modules/template-engine-pug/
       
      For common problems/features/questions about the Factory, use the TemplateEngineFactory thread.
       
    • By tpr
      ProcessNetteTester
      Run Nette Tester tests within ProcessWire admin.
      (continued from here)

      Features
      AJAX interface for running Nette Tester tests, in bulk or manually display counter, error message and execution time in a table run all tests at once or launch single tests show formatted test error messages and report PHP syntax errors stop on first failed test (optional) hide passed tests (optional) display failed/total instead passed/total (optional) re-run failed tests only (optional) auto scroll (optional) include or exclude tests based on query parameters start/stop all tests with the spacebar reset one test or all tests (ctrl+click) https://modules.processwire.com/modules/process-nette-tester/
      https://github.com/rolandtoth/ProcessNetteTester