[Solved] fontawesome-icons for file-fields

2 years 7 months ago - 2 years 7 months ago #61637 by kath
hi there,

here's how you can have fontawesome-icons in your flexicontent-file-fields instead of the default file-type-images.
This method is update-save and hack-free.
  1. copy file "value_InlineBoxes.php"
    from /plugins/flexicontent_fields/file/tmpl/value_InlineBoxes.php
    to /templates/<mytemplate>/html/flexicontent_fields/file/value_InlineBoxes.php
  2. edit the copied file in /templates/... .
  3. near line 60, replace
    $icon = JHTML::image($file_data->icon, $file_data->ext, 'class="fcicon-mime hasTooltip" title="'.JHtml::tooltipText($_tooltip_title, $_tooltip_content, 1, 0).'"');
    $icon = '<span class="fcfile_mime">'.$icon.'</span>';
    with
    $aFileTypes = array(
     
    	'pdf' => 'pdf-o',
     
    	'xls' => 'excel-o',
    	'xlsx' => 'excel-o',
    	'ods' => 'excel-o',
     
    	'ppt' => 'powerpoint-o',
    	'pptx' => 'powerpoint-o',
     
    	'doc' => 'word-o',
    	'docx' => 'word-o',
     
    	'default' => 'file-o',
    );
    $sFileType = (isset($aFileTypes[$file_data->ext])) ? $aFileTypes[$file_data->ext] : $aFileTypes['default'];
    $icon = '<i class="fa fa-file-'.$sFileType.'"></i>';
  4. tweak as you like, enjoy fontawsome-icons

Please Log in or Create an account to join the conversation.

2 years 7 months ago #61648 by ggppdk
Hello

i am thinking we can buy a developer license and use font-awesome for FLEXIcontent default icons


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.