Skip to content

Document on how to add custom icons to settings page #325

@sharidas

Description

@sharidas

There is a small change made to the settings panel to add custom icons (owncloud/core#29358)
Prior to this change, a user can specify the icons residing at core/core/img location. Now it has been updated.

An app developer can have their own icons located at core/apps/$(appname)/img. img is the folder name. Just place it in that location and then use the old API. For example, lets take a look at the snippet: https://github.com/owncloud/core/blob/master/lib/private/Settings/SettingsManager.php#L204
In this example encryption section gets the password icon from core.

Now, let's say user places an icon gnu.svg inside the encryption app folder as img/gnu.svg. Then the user can use: new Section('encryption', $this->l->t('Encryption'), 85, 'gnu') to get the gnu image displayed in the panel.

If the user follows something like this to create the settings: https://github.com/owncloud/firewall/blob/master/lib/AdminSection.php#L33
Then just return the name of the svg file excluding the extension. Just like: return 'gnu';

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions