You are here

function hook_entity_print_css in Entity Print 7

This hook is provided to allow modules to add their own CSS files.

Note, you can also manage the CSS files from your theme.

Parameters

string $entity_type: The entity type of the entity we're rendering.

object $entity: The entity we're rending.

See also

https://www.drupal.org/node/2430561#from-your-theme

2 functions implement hook_entity_print_css()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_print_commerce_order_entity_print_css in modules/entity_print_commerce_order/entity_print_commerce_order.module
Implements hook_entity_print_css().
entity_print_test_entity_print_css in tests/entity_print_test.module
Implements hook_entity_print_css().
1 invocation of hook_entity_print_css()
_entity_print_get_css in ./entity_print.module
Inject the relevant css for the template.

File

./entity_print.api.php, line 23
This file exists only to provide examples of using the Entity Print API's.

Code

function hook_entity_print_css($entity_type, $entity) {

  // An example of adding two stylesheets for any commerce_order entity.
  if ($entity_type === 'commerce_order') {
    $path = drupal_get_path('module', 'entity_print_commerce_order');
    entity_print_add_css($path . '/css/table.css');
    entity_print_add_css($path . '/css/commerce-order.css');
  }
}