![]() ![]() If a new brand is added to the Simple Icons project but does not appear as an option in the Drupal field then raise an issue and I will update icon-data.json and tag a new release.If a brand updates its icon, and the Simple Icons project has updated to use the new icon, then update the copy of Simple Icons in your libraries/simple-icons directory and the new icon should become available.A list of all the available icons can be found in icon-data.json in the module's root.What icons are available/can I add an icon? AccessibilityĪ element is contained within each SVG with the name of the brand that is represented by the icon. Need to add an CSS class to the icons provided by this module? Override the template provided by this module and you can edit the markup of the element that wraps the icons. There is currently no need for configuration. Once the Simple Icons library is in the correct location (see Requirements) then you can install this module as normal.Īfter installation you will have a 'Simple Icons icon' field type and field formatter available, as well as the Twig function mentioned above. Once you have done this, running the following command from your Drupal site's webroot should return SVG markup:Ĭat libraries/simple-icons/icons/drupal.svg Installation Follow this guide then run the following Composer command: The string is a data string for defining an SVG path. My preferred way of doing this is via Asset Packagist. <'fill-rule'> The filling rule for the interior of the path.Make sure that you have extracted the contents of the Simple Icons repo to libraries/simple-icons. The slugs can be found in the icon-data.json file found in the module root. The Twig function accepts a single argument of the slug that represents each icon. No more support tickets to ' Add a link to X in the footer'!Īs a convenience and for non-CMS managed content a Twig function is provided to output a single icon: So, even though the membership base has dwindled as I stopped adding new content, it also has stayed relatively strong, especially for a product that hasnt been updated in over 5 years. Then, if a client wanted to add a new social media profile they could do it all themselves, including supplying an icon. The tutorials on BuildAModule have stayed oddly relevant, even today, due to large organizations standardizing on older versions of Drupal. Or use Config Pages and a Paragraph type to do a similar thing (outputting the Config Pages entity as a block, just like a menu). If your client has a list of social media profiles in their footer then you could build it as a Drupal menu, install the Menu Item Extras module, and then add a Simple Icons icon field to the menu. This module allows your CMS users to use almost any major brand icon that they like, without you having to source, optimize, and upload these logos yourself. The icon is output as raw SVG markup so it can be easily styled with CSS, but the markup is sanitized before being output for security (just in case!)Įach icon is monochrome so fits easily into most designs and has been optimised for performance. tpl.php file.Simple Icons provides a field widget/field formatter and Twig function to output one of 789+ brand icons from the Simple Icons project. tpl.php files though icon_preprocess() (I think that's the name of the hook). Icon module should provide convenient variables to. ![]() Icon module should provide the default markup for outputting an icon by supplying the default theme_icon() function. The by reading in the active icon pack, the icon.module will generate a dynamic CSS file mapping all the active icons to the classes defined by modules and the active theme. If both a module and theme define the same unique icon name, the theme should take precedence. The icon.module needs to read in all the info files for all modules, and the active theme, collecting the defined class names for icons. Look more closely, Drupal 8 and 9 are almost interchangeable so most modules for 8 work with 9. For the contrib version, we might make it so that individual icons can be mixed and matched from any installed icon set. In the core implementation, it should provide a way to use a single icon pack across the site per theme. The icon.module is responsible for actually swapping out icon packs. Note: should we flip the array order so that it's icon name first then size? Core Icon Module Implementation The list is formatted with the size of the icon first, such as 16 or 32 pixels, then the generic name for the icon. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |