gorriecoe/silverstripe-linkicon

Adds an option to upload an icon to a link

Fund package maintenance!
Ko Fi

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

dev-master 2020-04-16 03:47 UTC

This package is auto-updated.

Last update: 2024-12-16 13:45:54 UTC


README

Adds an option to upload an icon to gorriecoe/silverstripe-link

Installation

Composer is the recommended way of installing SilverStripe modules.

composer require gorriecoe/silverstripe-linkicon

Requirements

Maintainers

Template

Add $Icon to your Link.ss file.

<% if LinkURL %>
    <a{$IDAttr}{$ClassAttr} href="{$LinkURL}"{$TargetAttr}>
        {$Icon}{$Title}
    </a>
<% end_if %>

Options

Define folder to store the icons assets into.

gorriecoe\Link\Models\Link:
  icon_asset_folder: 'SomeFolderName' // Defaults to 'Icons'

Defines tab to insert the icon_folder fields into.

gorriecoe\Link\Models\Link:
  icon_tab: 'SomeTabName' // Defaults to 'Settings'

Defines the allowed file extensions for the icon field.

gorriecoe\Link\Models\Link:
  icon_allowed_extensions:
    - 'gif'
    - 'jpeg'
    - 'jpg'
    - 'png'
    - 'bmp'
    - 'ico'