added 288 characters in body
Source Link
Hicham
  • 57
  • 1
  • 10

I'm trying to add a css to a view, through the preprocess view as below

function mytheme_preprocess_views_view(&$vars) {
 $view = &$vars['view'];
if ($view->name == 'gallery_view') {
drupal_add_js(drupal_get_path('theme', 'mytheme') . '/assets/js/responsive-image-gallery/gallery.js');
drupal_add_css(drupal_get_path('theme', 'mytheme') .'/assets/css/responsive-image-gallery/style.css');
 }
}

The Following code above is inserting the js file but not the css. Is there a reason why? Or other way to insert css file in certain view?

I have tried the following and its being inserted:

drupal_add_js(drupal_get_path('theme', 'zenon') .'/assets/css/responsive-image-gallery/style.css');

So is there something missing in the drupal_add_css function or it doesnt have read access on the server, is that possible?

I'm trying to add a css to a view, through the preprocess view as below

function mytheme_preprocess_views_view(&$vars) {
 $view = &$vars['view'];
if ($view->name == 'gallery_view') {
drupal_add_js(drupal_get_path('theme', 'mytheme') . '/assets/js/responsive-image-gallery/gallery.js');
drupal_add_css(drupal_get_path('theme', 'mytheme') .'/assets/css/responsive-image-gallery/style.css');
 }
}

The Following code above is inserting the js file but not the css. Is there a reason why? Or other way to insert css file in certain view?

I'm trying to add a css to a view, through the preprocess view as below

function mytheme_preprocess_views_view(&$vars) {
 $view = &$vars['view'];
if ($view->name == 'gallery_view') {
drupal_add_js(drupal_get_path('theme', 'mytheme') . '/assets/js/responsive-image-gallery/gallery.js');
drupal_add_css(drupal_get_path('theme', 'mytheme') .'/assets/css/responsive-image-gallery/style.css');
 }
}

The Following code above is inserting the js file but not the css. Is there a reason why? Or other way to insert css file in certain view?

I have tried the following and its being inserted:

drupal_add_js(drupal_get_path('theme', 'zenon') .'/assets/css/responsive-image-gallery/style.css');

So is there something missing in the drupal_add_css function or it doesnt have read access on the server, is that possible?

added 30 characters in body
Source Link
Hicham
  • 57
  • 1
  • 10

I'm trying to add a css to a view, through the preprocess view as below

function mytheme_preprocess_views_view(&$vars) {
 $view = &$vars['view'];
if ($view->name == 'gallery_view') {
drupal_add_js(drupal_get_path('theme', 'mytheme') . '../../../themes/mytheme/assets/js/responsive-image-gallery/gallery.js');
drupal_add_css(drupal_get_path('theme', 'mytheme') .'../../../themes/mytheme/assets/css/responsive-image-gallery/css/style.css');
 }
}

The Following code above is inserting the js file but not the css. Is there a reason why? Or other way to insert css file in certain view?

I'm trying to add a css to a view, through the preprocess view as below

function mytheme_preprocess_views_view(&$vars) {
if ($view->name == 'gallery_view') {
drupal_add_js(drupal_get_path('theme', 'mytheme') . '../../../themes/mytheme/assets/js/image-gallery/gallery.js');
drupal_add_css(drupal_get_path('theme', 'mytheme') .'../../../themes/mytheme/assets/css/image-gallery/css/style.css');
 }
}

The Following code above is inserting the js file but not the css. Is there a reason why? Or other way to insert css file in certain view?

I'm trying to add a css to a view, through the preprocess view as below

function mytheme_preprocess_views_view(&$vars) {
 $view = &$vars['view'];
if ($view->name == 'gallery_view') {
drupal_add_js(drupal_get_path('theme', 'mytheme') . '/assets/js/responsive-image-gallery/gallery.js');
drupal_add_css(drupal_get_path('theme', 'mytheme') .'/assets/css/responsive-image-gallery/style.css');
 }
}

The Following code above is inserting the js file but not the css. Is there a reason why? Or other way to insert css file in certain view?

Source Link
Hicham
  • 57
  • 1
  • 10

Adding a css in preprocess view not woking

I'm trying to add a css to a view, through the preprocess view as below

function mytheme_preprocess_views_view(&$vars) {
if ($view->name == 'gallery_view') {
drupal_add_js(drupal_get_path('theme', 'mytheme') . '../../../themes/mytheme/assets/js/image-gallery/gallery.js');
drupal_add_css(drupal_get_path('theme', 'mytheme') .'../../../themes/mytheme/assets/css/image-gallery/css/style.css');
 }
}

The Following code above is inserting the js file but not the css. Is there a reason why? Or other way to insert css file in certain view?