Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find source directory #8

Closed
1stevengrant opened this issue Mar 20, 2019 · 9 comments

Comments

Projects
None yet
3 participants
@1stevengrant
Copy link

commented Mar 20, 2019

I added a bunch of SVGs into an icons directory at the web root level

/Users/steven/Sites/craftsandbox/public/icons/

defined the config

<?php

return [
    '*' => [
        'iconSetsPath' => '/Users/steven/Sites/craftsandbox/public/icons/',
        'iconSetsUrl' => '/icons/',
    ]
];

but when I try to define the field, it tells me

Unable to locate SVG Icons source directory.
Please ensure the directory /Users/steven/Sites/craftsandbox/public/icons/ exists.

What am I missing?

@engram-design

This comment has been minimized.

Copy link
Member

commented Mar 20, 2019

I've been using 'iconSetsPath' => CRAFT_BASE_PATH . '/public/icons/', locally (probably not a bad idea for multi-environment support), does that help at all?

Otherwise, what server setup and environment do you have? I'm going to assume that folder really, really exists 😁

@1stevengrant

This comment has been minimized.

Copy link
Author

commented Mar 20, 2019

Yeah I tried that as well - same thing

I'm using Laravel Valet locally. Haven't attempted on an actual server yet.

Yeah, really really exists 😂

@engram-design

This comment has been minimized.

Copy link
Member

commented Mar 20, 2019

I'll have a test locally with Valet just to make sure its not something specific.

@1stevengrant

This comment has been minimized.

Copy link
Author

commented Apr 4, 2019

Just checking in on this @engram-design anything coming imminently to resolve? Thanks.

@engram-design

This comment has been minimized.

Copy link
Member

commented Apr 7, 2019

Would you be able to give 1.0.5 a go?

@1stevengrant

This comment has been minimized.

Copy link
Author

commented Apr 11, 2019

Same thing at this point.

@knynkwl

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2019

I am getting the same errors with the documented configuration.

Craft CMS 3.1.22
Icon Picker 1.0.5

It's in trial mode when I get the error, I have not purchased it.

@knynkwl

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2019

I figured out the problem and I think it's due to the documentation OR the plugin needs to be updated to work differently based onthe documentation.

@1stevengrant basically this plugin is mimicking the assets field, so if you point iconSetsPath to the folder that contains the /icons/, you will be able to pick that folder in the field.

For example, I put my /icon folder in /web/assets/ and set iconSetsPath to CRAFT_BASE_PATH . '/web/assets/',

Screen Shot 2019-04-16 at 12 08 04 PM

I think the main problem is the documentation though. It says to set iconSetsPath to CRAFT_BASE_PATH . '/icons/' which one would assume that the svg icons should be in /icons, when in-fact it's looking inside /icons for a folder of svg icons e.g. /icons/base/icon.svg.

@engram-design

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

@knynkwl Firstly, the default folder behaviour should actually be CRAFT_BASE_PATH . '/web/icons/', which I have now changed in to. By default, it should point to a folder called icons in the root of your web root. This is called web by Craft so we'll follow suit.

CRAFT_BASE_PATH refers to the project root, not the web root, so that was incorrect on my part.

Of course, you can override this in your config setting, so it doesn't matter, but also added points to the docs about this, just so people can get 'up and running' quicker.

With regards to your second point, there was a bug I've fixed that wouldn't show single SVG icons that weren't in a folder, and required all icons to be placed in sub-folders. In your example, you should be using /web/assets/icons/ as your iconSetsPath.

Should be fixed in 1.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.