0

I used the CSS injector module to replace the default CSS. I applied that CSS for paths like node/*. How do I exclude node/add from that CSS (the one I created with the CSS injection module)?

2 Answers 2

0

This is the sort of thing that I'd do by code, but that's because that's just the way I roll.

In the template.php you will want something like:

function MYTHEME_preprocess_node($vars) {
  if (drupal_get_path_alias(current_path()) == 'node/add') {
    drupal_add_css(drupal_get_path('theme', 'MYTHEME') . "/css/foo.css");
  }
}

I hope this helps.. :)

7
  • foo.css is the one which contain default css?? Commented Jul 1, 2016 at 11:30
  • its a custom css file which you can use to style node/add page.
    – parth.k
    Commented Jul 1, 2016 at 11:32
  • i think u get wrong.i created lot of css injector file and applied that below path node/*. i just want do not apply that css for node/add thats all. i don't want other custom css file. Commented Jul 1, 2016 at 11:36
  • since you have added lots of css on the path node/*, node/add page will definately get affected. The purpose I present above code is you add some css in foo.css to display node/add as before.
    – parth.k
    Commented Jul 1, 2016 at 11:50
  • other option would be enter more specific paths in place of node/* so that way node/add wont get effects of other css and it would follow default css
    – parth.k
    Commented Jul 1, 2016 at 11:51
0

If you want to give particular styling to a particular node (or content type) you can use the native class appears very high in the DOM. No modules needed.

enter image description here

You could hide a whole region using the module Content which is better than hiding it with display:none; ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.