This site shows a category ribbon along the top. The category ribbon has been manually created in a block, but the relevant css is present in the theme.
The code in the block is of the form:
<div id="cat-1" class="category">
<p><span class="cat_title">CategoryTitle</span>
<a href="#">Text that goes under the category title.</a></p></div>
Just place the above html in a block, set the input format to something that allows div elements and css styling (I used the full html input format after turning off the html corrector).
A full width region takes 5 of the categories to fill - in the above sample just replace "cat-1" with an appropriately numbered id (cat-2, cat-3...).
If anyone can think of a good way to automate this, have some gui for it, I am all ears.
The css for the category ribbon does not work perfectly on IE6 - the current behaviour is for the text and background colours to stay the same as before.
Comments
Anonymous (not verified)
Wed, 06/17/2009 - 19:43
Permalink
Make block "active"
Is there a way to make the block "active" when you're on the respective page?
That way if you're on that specific page, the block is "highlighted" with the same color when you hover over it.
Admin
Thu, 06/18/2009 - 16:47
Permalink
Re: Make category ribbon block "active"
Unfortunately, not as is.
It is possible, but it would require there to be some php code in the block (to detect what page the block is on), and that is generally a bad idea.
Anonymous (not verified)
Fri, 06/19/2009 - 16:30
Permalink
Okay, thanks for the quick
Okay, thanks for the quick response! I appreciate it and I LOVE this theme. It's amazing!
Anonymous (not verified)
Thu, 06/25/2009 - 23:26
Permalink
Images for Category Ribbon
I added code to make it an image instead of text and it wasn't working. Is this not doable for this code?
That would be awesome if it could be an image!
Admin
Tue, 06/30/2009 - 04:10
Permalink
Re: Images for Category Ribbon
I have not tried it with images, but (maybe with some css tweaking) this should be possible.
Do you have a picture of what you are doing or even the code so that I can test it/suggest fixes?
B van Leeuwen (not verified)
Wed, 07/15/2009 - 17:31
Permalink
Dynamic category ribbon
Hi
I created the content type: newsribbon and made a block, called newsribbon and placed it in the region: middle
The block contains the following code:
<?php
$qu = "'";
$nodetyp = 'newsribbon';
$query = 'SELECT nd.nid nid from node nd where';
$query .= ' nd.type = ' . $qu . $nodetyp . $qu;
$query .= ' order by nd.changed desc';
$results = db_query($query);
$i1 = 0;
while ($result = db_fetch_array($results)) {
$i1 = $i1 + 1;
if ($i1 < 6) {
$node = node_load($result['nid']);
$len = strlen($node->teaser);
if (strlen($node->teaser)>50) {
$tes = substr($node->teaser,0,50);
}
else {
$tes=$node->teaser;
}
if (strlen($node->title)>20) {
$tit = substr($node->title,1,20);
}
else {
$tit =$node->title;
}
/* print $options[i1]; */
$tekst = '';
$tekst .= '';
$tekst .= $tit . ' nid . '">';
$tekst .= $tes . ' ';
print $tekst;
}
}
/* catch if items are displayed and number of items < 5 */
if ($i1>0) {
while($i1 < 5) {
$i1 = $i1 +1;
$tekst = '';
$tekst .= '';
$tekst .= ' ' . ' ';
$tekst .= ' ' . ' ';
print $tekst;
}
}
?>
By the way: the code is stored in the table "boxes"
Dev (not verified)
Fri, 07/17/2009 - 18:26
Permalink
Just a quick that there's a
Just a quick that there's a typo in that code you posted with the span tag. :)
Anonymous (not verified)
Fri, 07/31/2009 - 04:26
Permalink
Cat boxes staggering...
Check out my page and see if you can figure this out:
http://www.uniters.net/
The Category boxes are for some reason staggering downward a few lines as they go from the left to the right.
What am I doing wrong here?
I cut and pasted the code from above... not sure what else I could be doing. Forgive me, I'm a fairly intermediate to novice with Drupal.
Admin
Fri, 07/31/2009 - 17:02
Permalink
Re: Cat boxes staggering...
Looking at the code generated by the page,m there seems to be no closing </span> tag after the title.
Anonymous (not verified)
Sat, 08/08/2009 - 21:26
Permalink
The is there, not sure why
The is there, not sure why you couldn't see it in the code. Is there possibly something I'm doing to block that from working in a setting somewhere/somehow?
Here is the code... its straight cut and pasted from above, with my content in what I think are the right places:
<?php
Groups
Click here to find, join and/or start a group in your local area.
?>
Any ideas?
Thanks for responding... I really dig the theme. Probably will upgrade to premium if we get this working.
Anonymous (not verified)
Sat, 08/08/2009 - 21:30
Permalink
Also, I corrected what looked
Also, I corrected what looked like a typo:
<?php
Anonymous (not verified)
Mon, 08/10/2009 - 20:27
Permalink
You clearly over looked a key
You clearly over looked a key instruction in the initial post. I'll leave it to you to help yourself by re-reading.
and yes, the 'span class' example has a typo.
Admin
Wed, 08/12/2009 - 06:43
Permalink
Re: Also, I corrected what looked
There still seems to be atleast one place that needs it fixing for. the same issue - in block 2. (two "pans" instead of span and also the latter is in the wrong place)
Also, I have not tested this with multiple blocks, but you will atleast need to torn off the block titles for the look to be correct.
Please note that the premium version is only available from the original author and for wordpress only - I ported the free version and added some features/enhancements.
Pedro (not verified)
Mon, 08/31/2009 - 11:52
Permalink
Re: Category Ribbon
Hi,
Can anyone tell me how to change the font size of the ribbon categories title? I've tried changing the font size in the cat_title class of the ribbon.css file, but the size doesn't change. If I insert a "font-size:" line in the category class, it works but it also changes the category text font size.
what I would like is exactly what can be seen on this site. For example, the first category has the title "arthemia free" with one font size and the text "A high quality theme originally released for wordpress with critical acclaim. There there was release two, improving some aspects of it to solidify its reputation." with a smaller font size.
Any help appreciated.
Best regards,
Pedro Meireles.
Pedro (not verified)
Mon, 08/31/2009 - 16:54
Permalink
Re: Category Ribbon
I've just figured it out. The problem is that the code found on this page is incorrect! Instead of span it has a pan tag. I just copy-pasted the text to my site and didn't notice that.
To the author of the site: please correct this so that it doesn't happen with anyone else.
Best regards.
Admin
Mon, 08/31/2009 - 17:25
Permalink
Re: Category Ribbon
oops - fixed. Sorry for all he trouble.
Anonymous (not verified)
Sun, 09/13/2009 - 20:49
Permalink
Re: Category Ribbon
I realize this is probably very basic stuff, but I'm new to all of this so please excuse my ignorance.
I managed to get the five boxes lined up properly (through blocks) but can't figure out how to link them to the pages I want displayed upon clicking on them. I'd appreciate any help on this. Please talk to me like I'm a first-grader.
Admin
Mon, 09/14/2009 - 06:40
Permalink
Re: Category Ribbon
I you look at the code, there is
in there. replace the # with the link that you want it to go to.Anonymous (not verified)
Mon, 09/14/2009 - 16:43
Permalink
Re: Category Ribbon
Thank you so very much for your quick response. It works like a charm now. I love Arthemia - thank you for sharing it.
Anonymous (not verified)
Sat, 09/19/2009 - 22:48
Permalink
Re: Dynamic category ribbon
Hi:
I am new to Drupal. Thank you for the excellent theme you produced. I am trying to use the news ribbon feature and get some warning messages.
"User warning: Table 'thrsiyf4_drp02.node' doesn't exist query: SELECT nd.nid nid from node nd where nd.type = 'newsribbon' order by nd.changed desc in /home4/thrsiyf4/public_html/entbi/includes/common.inc(1645) : eval()'d code on line 8."
I followed the steps you mentioned such as
1. created a content type
2. Created a block
How do I place contents on the 5 categories
Thanks
Raj
Anonymous (not verified)
Thu, 10/15/2009 - 22:24
Permalink
Re: Cat boxes staggering...
You need not enter the Title field for this to work. And only enter the title field within the block code.
cheers
ECT (not verified)
Fri, 11/27/2009 - 13:50
Permalink
Re: Category Ribbon
Hi, hoping someone can help with why my styling just disappeared on http://www.edinburghchristmastrees.com !!
The links you see at top Order online etc where styled horizontally using the ribbon.css file - it was working perfectly and then suddenly disappeared. Cannot for life of me figure out why?!
Any help much appreciated.
Thanks!
Ana (not verified)
Fri, 11/27/2009 - 14:35
Permalink
Re: Category Ribbon
This is a beautiful theme and I'm trying to use it for my site, but for some reason the drop down menu only works on select pages. It doesn't load on the main page for example... is it possible to make it show on all pages?
I've installed your hover module, but that doesn't seem to help.
Admin
Fri, 11/27/2009 - 15:34
Permalink
Re: Category Ribbon
@ECT - did you modify the arthemia_primary function in template.php, or install another module that modifies the menu system?
@ Ana - in the primary menu, please make sure that the "expanded" box is ticked next to the parent items and then the children should show on all pages.
Ana (not verified)
Sat, 11/28/2009 - 05:17
Permalink
Re: Category Ribbon
Works now, thankyou.
Angelo (not verified)
Thu, 02/04/2010 - 21:34
Permalink
Re: Category Ribbon
Hello,
You can display Category Ribbon via views module.
Here is my template:
content?>" class="category">
<?php echo $fields[title]->content ?>
<?php echo $fields[title]->teaser ?>
note that counter is an automatic field, that count result. So it increments category...
Angelo (not verified)
Thu, 02/04/2010 - 23:54
Permalink
Re: Category Ribbon
Just noticed a mistake.....
content?>" class="category">
<?php echo $fields[title]->content ?>
<?php echo $fields[teaser]->content ?>
note that counter is an automatic field, that count result. So it increments category...
Anonymous (not verified)
Sun, 03/28/2010 - 11:15
Permalink
Re: Category Ribbon
Hello,
Quick question: can someone tell me how to assign a color to each ribbon block? Thanks very much.
Admin
Sun, 03/28/2010 - 13:38
Permalink
Re: Category Ribbon
That is done in CSS - have a look at ribbon.css and copy one of the css declarations from there and modify the color value. (for allowing upgradeability, instad of editing in the file, copy and edit the relevant bit into local.css)
Anonymous (not verified)
Sun, 03/28/2010 - 20:24
Permalink
Re: Category Ribbon
Thank you for the fast reply, and thanks for this great template!