By skullJ on
How can i add css class into theme('item_list',$items) ?
i want to generate a list like:
if(count($items)) {
print theme('item_list',$items);
}
but i want to use a css class for listing.
How can i add css class into theme('item_list',$items) ?
i want to generate a list like:
if(count($items)) {
print theme('item_list',$items);
}
but i want to use a css class for listing.
Comments
Do you want to add a class name to the whole list
Do you want to add a class name to the whole list or individual menu items?
to whole list
to whole list!!!!
i think the theme('item_list',$items) generate a normal < ul >< li >1st item< /li >< /ul > without any ul class,right?
I tried to take a div like:
if(count($items)) {
print '
';
}
and its work!But can i add a class into ul?
Yes, you just need to pass more arguments to the theme function
So in this case something like
will work.
You can find more information on the function at http://api.drupal.org/api/function/theme_item_list/5
working!! thank you!!! :D
working!!
thank you!!! :D
Changing font size
Does anyone know how I can change the font size of the items in a list when I use the statement
print theme('item_list', $items);
Below is the full code.
Thanks in advance!
If you use the above
If you use the above suggestion to give the list a class you can then use css to change the font size.
Font size
I added two lines to the code and it is working but I do not understand how the second line works .
$class = "valu";
print '' . theme('item_list',$items, NULL, 'strong', array('class' => $class)) . '';
See
See http://api.drupal.org/api/function/theme_item_list/5 for information on using the theme function. Where you have 'strong' it really should be 'ul' or ''ol' (other values may produced unexpected results). The last part,
array('class' => $class), allows yo to set html attributes for the outer tag, in this case setting the class to the value you have specified.Font size
How do I use CSS to change the font size? Do you mean style.css? Please help out I'm a newbie. Thanks.
Correct you can add an
Correct you can add an appropriate ccs rule in style.css, if you class is 'valu' something like this will work.
Values less than 1 will decrease the font size, values greater than one will increase the font size.
Thanks. When I have the line
Thanks. When I have the line below
print '' . theme('item_list',$items, NULL, 'ul', array('class' => $class)) . '';
and add
.valu {
font-size: 0.8em;
}
to the CSS it doesn't seem to work. When I change the font size nothing changes in the display. But, when I replace the 'ul' with 'strong' or 'bold' then I can see changes when I change the font size in the CSS.
Please help
In my style.css I have
.valam {
font-weight: bold;
font-size: 10.8em;
font-family: Verdana;
}
and my theme list looks like this
When I make changes to the font size in style.css I don't see any changes. I must be doing something wrong.
The firebug extension for
The firebug extension for Firefox would be useful for figuring this out. It would allow you to inspect the html and see what css is actually be applies. You could check to see the class is being added to the ul tag and also if there is any other css that is overriding your css.
Thanks
Thanks will take a look at it. There must be something overiding my css.
Taking bullets out
Is there any way to not display the bullets/numbering when the items are listed?
Yes set the css properties
Yes set the css properties list-style-image and/or list-style-type to none.
CSS properties
Where do I change these properties? I see CSS class and CSS id in the panels for each of the category. I entered none in both but it the bullets are still there.
Generally you would add the
Generally you would add the css to a themes style.css file.
may know what is this
hi Dear
May i know what is this theam('item_list') ?
Any idea about this !!!!!!!!!!!!!!!!!!!
Urgent
Are you sure is
Are you sure is theam('item_list') ???
Check the right syntactic in api: http://api.drupal.org/api/function/theme/5
__________________
www.skull.gr
theme !!!
can plz tell me each parameter explation for theme....
am
using this theme in pagination...
when i click the list..
the 5 content will display and balance is display in the next page ..
but u see when there is no records..on that time also the pagination is displayed with three page...
this is the code..
Any idea plz share
I'm trying to add class and
I'm trying to add class and style to the ul and li tags issued from the agregator module when displayed in a block.
Apparently the module generate a basic
Line 417 in agregator.module.
How can i add class and style to the ul and li tags?
Adding class to theme('item_list')
So in this case something like
$class = "your-class-name-here";
print '' . theme('item_list',$items, NULL, 'ul', 'attributes' => array('class' => $class)) . '';
array()
I'm thinking $class should be an array.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.