verbb / icon-picker

A Craft CMS field to select SVG or font icons from a folder for use in your content.
Other
17 stars 8 forks source link

Feature Request - multiple directories #2

Closed CreateSean closed 5 years ago

CreateSean commented 5 years ago

Description

In incon-picker.php I'd like to configure mulitple directories - this is what I tried, but I'm not a php dev so may be completely wrong in any case.

<?php

return [
    '*' => [
        'iconSetsPath' => [
          getenv('SITE_PATH') . '/public/svgicons/general/',
          getenv('SITE_PATH') . '/public/svgicons/tech/',
        ],
        'iconSetsUrl' => '/svgicons/general/',
    ]
];

Ideally in the field type each directory would be seperated perhaps by a hr

Steps to reproduce

1. 2.

Additional info

michaelroper commented 5 years ago

Hey @CreateSean , did you try pointing the path to just iconSetsPath to /public/svgicons? The plug will actually recognise that there are subfolders, and let you either restrict the field to a specific folder, or if you select the parent folder, it will divide the icons up by folder as well.. image

engram-design commented 5 years ago

@CreateSean As @michaelroper suggests, the correct scenario would be to use /public/svgicons as we'll include any folders in that directory as an 'icon set'.