Jump to content

ukyo

Members
  • Posts

    262
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by ukyo

  1. I don't know what I am doing wrong but I can't get this module to work.

    I tried it on a fresh install of processwire 2.5.3

    I just get as the image shows below. No way to pick an icon.

    attachicon.gifCapture.JPG

    I created Module with last dev version. Let me check for last stable version and i can see what is problem for oldest versions.

    Edit: Problem solved can you confirm after update to v0.0.5

    • Like 2
  2. My solution for simple forms : Validation Module

    I used GUMP validation library with my custom usage additions. You can check my usage additions : https://github.com/trk/Validation/blob/master/README.md#example-long-format

    Also i wrote recaptcha module for form security, but didn't publish it yet: https://github.com/trk/Recaptcha

    Usage:

    $recaptcha = wire('modules')->get('Recaptcha')->verifyResponse($_POST['g-recaptcha-response']);
    if(!$recaptcha) {
         echo 'reCAPTCHA validation not ok!';
    }
    

    You can add recaptcha as a rule to validation module like:

    'g-recaptcha-response' => array(
            'label'     => 'Security Question',
            'rule'      => 'required|boolean',
            'type'      => 'captcha'
        )
    
    • Like 1
  3. ok, this issue comes from the array notation!

    $array = array($foo, $bar); // is ok

    $array = [$foo, $bar]; // only php version 5.4+

    had this issue today with a different module so i thought it was not specific to this module and did some research...

    For compatibility, i will change [$foo, $bar] to array($foo, $bar).

    - Edit : Done. You can update module.

    • Like 1
  4. Z-index values looking ok, but how copyright informations coming up?

    When i check page render result with firebug, footer section looking ok, .container element inside footer section coming up of absolute element.

    My solution is hack #content element or #footer .container element by little jquery code. Add a z-index value when document ready to #content "z-index: 2;" or #footer .container "z-index: -1;". Problem solve with this method.


    You can change InputfieldFontIconPicker.module line 94 with this code, I will update repo also :
     
    $output .= "\n<script>
    		\n\tjQuery(document).ready(function($) {
    		\n\t\t$('#{$options['id']}').fontIconPicker({
    		\n\t\t\tsource: {$options['icons']},
    		\n\t\t\t{$settings}
    		\n\t\t});
    		\n\t\tif($('#content').length) {
    		\n\t\t\t$('#content').css('z-index', 2);
    		\n\t\t}
    		\n\t});
    		\n</script>";
    
  5. Having a small z-index problem

    attachicon.gifScreen Shot 2015-02-08 at 5.19.31 PM.png

    Thanks for your feedback!

    Z-index problem causing from content section ("<div id='content' class='content'>").

    Icon selector z-index value is "10000" and not effecting outside of "content" section, if you add z-index value = 2, to "<div id='content' class='content'>" element its looking ok.

    Need a hack for ("<div id='content' class='content'>") section by jquery or core team can add a z-index value for this section. If core team can do it, i don't need a hack for z-index. If they can't i can add a little hack for this problem. Will wait for core team answer.

  6. Yes, I submit it. Waiting for approve.

    Also if you can, can you correct the url of my dev profile

    False  -> /alt-ve-bir-bilisim-teknolojileri/ (Loosing small "ı")  ???

    True   -> /alti-ve-bir-bilisim-teknolojileri/ (Turkish characters ). ı -> i

    note: I added logo also again. When you make post on dev form profile, if validation is not ok fields coming as blank field.

    O0

  7. Great work - just playing with it now and it's really slick - thanks for the contribution!

    One thing I noticed - not a big deal, but when you search by text, with "From all categories" selected, it duplicates the matching icons.

    Also, out of interest, did you see this: http://processwire.com/blog/posts/processwire-core-updates-2.5.15/#new-icon-selection-module-in-the-core

    It's an Inputfield, but not a Fieldtype, so it can't be used in templates as is, but I wonder how these two modules could be consolidated, or maybe they should remain completely separate - just thinking out loud - I have no idea whether Ryan is planning a matching fieldtype for his module.

    Thanks for your feedback !

    I think, duplicate problem is not actually a problem. Why ? : I took all icons from font-awesome website by categorized and 1 icon may in more than 1 category.

    I see @Ryan module, i am trying to use always dev version of processwire and i can follow updates, new things better, but you can't use it on page as a field. @Ryan solution is good for templates and field icons select.

    If you think from customer side : Simple example, think you have links page for social network website. You need an icon for each link page and you can easily select icon from select list. you don't need to search icon class inside font-awesome website or inside a icon class guide. Just select it from list. Also its possible to limit icons from input setting tab by category.

  8. FieldtypeFontIconPicker

    This field-type allow to you easily pick icons from input-field. This module using jQuery fontIconPicker as icon selector. You can see supported icon libraries below. If you need to use custom fonts you can check below example.

    Supported Icon Libraries

    Cahangelog


    NOTE: Module store data without prefix, you need to add "prefix" when you want to show your icon on front-end, because some of front-end frameworks using font-awesome with different "prefix".


    Module will search site/modules/**/configs/IconPicker.*.php and site/templates/IconPicker.*.php paths for FieldtypeFontIconPicker config files.

    All config files need to return a PHP ARRAY like examples.


    Example config file : create your own icon set.

    File location is site/configs/IconPicker.example.php

    <?php
    
    namespace ProcessWire;
    
    /**
     * IconPicker : Custom Icons
     */
    return [
        "name" => "my-custom-icons",
        "title" => "My Custom Icon Set",
        "version" => "1.0.0",
        "styles" => array(
            wire("config")->urls->templates . "dist/css/my-custom-icons.css"
        ),
        "scripts" => array(
            wire("config")->urls->templates . "dist/js/my-custom-icons.js"
        ),
        "categorized" => true,
        "attributes" => array(),
        "icons" => array(
            "brand-icons" => array(
                "title" => "Brand Icons",
                "icons" => array(
                    "google", "facebook", "twitter", "instagram"
                )
            ),
            "flag-icons" => array(
                "title" => "Flag Icons",
                "icons" => array(
                    "tr", "gb", "us", "it", "de", "nl", "fr"
                )
            )
        )
    ];

    Example config file : use existing and extend it.

    File location is site/configs/IconPicker.altivebir.php

    <?php
    
    namespace ProcessWire;
    
    /**
     * IconPicker : Existing & Extend
     */
    
    $resource = include wire("config")->paths->siteModules . "FieldtypeFontIconPicker/configs/IconPicker.uikit.php";
    
    $url = wire("config")->urls->templates . "dist";
    
    $resource["scripts"] = array_merge($resource["scripts"], ["{$url}/js/Altivebir.Icon.min.js"]);
    
    $resource["icons"]["flag-icons"] = [
        "title" => "Flag Icons",
        "icons" => array("tr", "en", "fr", "us", "it", "de")
    ];
    
    $resource["icons"]["brand-icons"]["icons"] = array_merge($resource["icons"]["brand-icons"]["icons"], array(
        "altivebir"
    ));
    
    return $resource;

    After you add your custom config file, you will see your config file on library select box. Library Title (Location Folder Name).

    Library Select

    If your library categorized and if you have categorized icons set like uikit and fontawesome libraries, you will have category limitation options per icon field or leave it empty for allow all categories (default).

    Library Select


    Example : output

    if ($icon = $page->get("iconField")) {
        echo "<i class='prefix-{$icon}' />";
    }

    MarkupFontIconPicker Usage

    // MarkupFontIconPicker::render(YourIconField=string, Options=array)
    echo MarkupFontIconPicker::render($page->YourIconField, [
            'prefix' => 'uk-icon-', // Icon class prefix, if you have different prefix, default is : "fa fa-"
            'tag' => 'span', // Icon tag default is : "i"
            'class' => 'fa-lg', // If you have extra cutom classes, for example : icons sizes, Array or Sting value
            'style' => 'your custom styles if you have' // Array or String Value
        ]);

    Theme support

    Library Select

    Search support

    Library Select

    Category support

    Library Select

     

    • Like 13
  9. Nice module, how can I translate the error messages or change the default?

    You can use core translator for translate default "English" language.

    You will see "/modules/Validation/Libraries/gump.class.php" file when you want to make site translation. If you don't use multi language module you can directly edit this file, you will see lang terms, but for module updates its not good idea edit module file directly.

  10. Validation Module for ProcessWire, Validation module using GUMP standalone PHP data validation and filtering class. That makes validating any data easy and painless without the reliance on a framework. Usage almost same with original GUMP validation class. Extended original validation class for make it multi-language and added 2 new function 1 for field labels, 1 for set and get fields.

    Module Link

    • Like 12
×
×
  • Create New...