Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I am using 'item_list' for element in formatter_view() function. A part of the formatter_view() looks like this.

I am trying to add a custom CSS file like explained in the 'Drupal 7 Module Development' book where they explained how to add a custom css file to a block displaying list of nodes.

 $element = array(
   '#theme' => 'item_list',
   '#items' => $items ,
   '#pre_render' => array('event_webpages_item_list_child_render'
   ), 
  );
  drupal_add_css(drupal_get_path('module', 'event_webpages') . '/event-webpages.css');
 return $element;

In the book the custom css file looks like this

/* $Id$ */

.block-single-blog .content  ul {
 padding-left: 0; /* LTR */ 
}

.block-single-blog .content  ul li {
margin-bottom: 10px;
list-style-type: none;
 }

The above code is used in the book to give the list-style type as none but when i use it for my module 'event-webpages' it does not work exactly.

The css file i wrote for my field module 'event_webpages' is

/* $Id$ */

.field-event-webpages .element  ul {
  padding-left:0 ;
  }

.field-event-webpages .element  ul li {
  margin-bottom: 10px;
 list-style-type: none;
 }

Is is the problem with the naming convention ?

Does anyone if custom css files work with field modules ?

*Sorry if you are confused. See text below this *

I will explain with one example of what i am trying to do.

If you see this url (http://nick.dlib.vt.edu/drupal/?q=node/114), it has a page that shows some content in the form of a list.

I wrote my own module and i am printing the content using 'item_list' theme . This is very basic i am trying to make work and i have more plans on extending this once it works.

I want those bullets to be removed and also want to configure content with my own fonts and colors. This content is generated through a database, so i have to change the styles before content gets created and not through UI.

I am trying to follow an example and wrote this kind of css file to remove the bullets but it is not working.

Do you know any other way i can configure content style before it gets printed ?

Many Thanks

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.