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

Adding an icon system to Omeka #967

Open
ebellempire opened this issue Oct 6, 2021 · 4 comments
Open

Adding an icon system to Omeka #967

ebellempire opened this issue Oct 6, 2021 · 4 comments

Comments

@ebellempire
Copy link
Contributor

I'm wondering if there's any interest in adding an icon system to Omeka. Rather than using Font Awesome, something like Ionicons (MIT licensed) could be a solution that would work for the admin UI, as well as for theme designers who want to minimize network requests.

In the example helper function below (from a theme I'm developing), I'm just reading the file contents from a directory of SVG files (there are three variants of each icon in the Ionicons set), and the output is just inline HTML.

function icon($name=null, $variant="sharp"){
  try{
    $file = physical_path_to('images/ionicons/'.$name.($variant ? '-'.$variant : null).'.svg');
    $svg = file_get_contents($file);
  }catch(exception $e){
    $svg = null;
  }
  return $svg ? '<span class="icon '.$name.'">'.$svg.'</span>' : null;
}

I think this approach would be more in line with current best practices, is very well-supported, and would be generally useful.

I'd be happy to submit a pull request if there's interest.

@DBinaghi
Copy link
Contributor

It's a good idea, Erin, and I'd be interested.
Only one issue (personal taste, I suppose): Font Awesome has got nicer icons than Ionicons, from what I can see :-)

@ebellempire
Copy link
Contributor Author

ebellempire commented Oct 11, 2021

Totally agree that FA icons are nicer looking. Plus, there are many more of them. They just come with some downsides (depending on one's priorities). Regardless, something like what I outlined could easily be updated to add more icons or replace the icon set at some later date if an appropriate alternative can be found (I honestly only looked at Ionicons, which seem similar in scope and quality to WordPress' Dashicons). I think having something built into Omeka that can be easily accessed with a simple helper function would be nice for developers who might miss the fact that Omeka ships with FA (at least on the admin UI) and/or who might have reasons not to use FA in the first place. Just a thought really.

@DBinaghi
Copy link
Contributor

Agreed. We would surely need good documentation for that, as developers should not have to try all options before getting the right icon.

@kimisgold
Copy link
Member

Yes, this is something we're interested in. We're currently thinking this icon system would exist alongside Font Awesome, not as a replacement: we have too many themes and modules that rely on the packaged iconfont. We would probably provide this new icon system as an alternative option for developers to use.

If we do go in this direction, implementation and rollout will take some time. As you've noted, few open source icon sets match the breadth that Font Awesome includes. We'll explore and weigh the options, as well as strategize a way to fill the gaps. This would likely involve creating our own custom glyphs.

In the meantime, @ebellempire feel free to submit your pull request. We'll also see about providing documentation for Omeka's existing iconography.

@ebellempire ebellempire mentioned this issue Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants