⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Can you change the action icons?



Jamie Clarke

Jamie Clarke
  • profile picture
  • Member

Posted 20 November 2014 - 15:27 PM

Hi,

 

I was wondering if it is possible to change the default icons used for View, Edit & Delete functions?

 

I am adding a new action in the table and I would like to keep all the icons uniform if possible with Bootstrap images.

 

I tried recreating all the actions as "add_action" and unset the default ones but then mapping to the URL /read , /add etc.. doesn't display anything.

 

$crud->add_action('Project Tasks', '', 'main/tasks', 'glyphicon glyphicon-list');
$crud->add_action('Edit Project', '', 'main/projects/edit', 'glyphicon glyphicon-pencil');
$crud->add_action('View Project', '', 'main/projects/read', 'glyphicon glyphicon-search');
 
$crud->unset_edit();
$crud->unset_read();

 

 

Many thanks

 

Jamie


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 21 November 2014 - 04:18 AM

i believe u can using CSS ...just need to set it right with it. the icons are not set exclusively using image path.. but are assigned using the class currently.. hence u can set it correctly creating custom css


samusaki

samusaki
  • profile picture
  • Member

Posted 20 April 2015 - 05:09 AM

Just in case some one from google is trying to get quick solution :
 

Just type in your php code :

$css_class = 'fa-eye';
$crud->add_action( string $label,  string $image_url , string $link_url , string $css_class ,  mixed $url_callback);

Or whatever ICON name like this : "fa-" + "icon_name". You can get icon names from :
http://fortawesome.github.io/Font-Awesome/icons/

Or check css file in your dir. :

"/themes/bootstrap/css/font-awesome/css/font-awesome.min.css"

 

 

If that amount of icons is not enough :

 

"./application/controllers/mycontroller.php" inside php :

$crud->add_action( '',  '' , '' , 'icon' ,'');

style.css <- example

.icon{
//yourcss
}