Category Colors

Register an Account
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old 07-13-2007, 08:12 AM
beatniak's Avatar
Pligg Donor
 
Join Date: Apr 2006
Location: NL - 52.100863;5.108356
Posts: 197
Don't know about yget, because Receptencocktail / Nieuw op Receptencocktail is 100% my own template (a heavy mod of the mollio-beat template i made last year). On my site only the headlines are category colored, not the stars.
Reply With Quote
  #12 (permalink)  
Old 07-13-2007, 11:44 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
Thanks a lot, beatnik!

To be honest: I understood it in the same way as keksler that the colorization of the background is template-independent. I´ve tried it as you mentioned with yget (pligg.tpl includes main.css and catcolors.css) but I got only black headlines without links.

I´ve "researched" a little bit as a dummy and found out that the story headline call the main.css section of toptitle

/* Headline */
.top {padding:0 0 0 5px;margin-left:60px;}
.top h4 {margin:0;padding-left:4px;font-size:160%;font-weight:normal}
.top h4 a:link, .top h4 a:visited {color:#36c; font-weight:bold}
.top h4 a:hover {color:#000;}
.toptitle {margin:0;font-size:16px;font-weight:normal;}
.toptitle a:link, .toptitle a:visited {color:#774525; font-weight:bold}
.toptitle a:hover {color:#333;}

So I guess the different cats have to be here, right? Is it the same with nav-secondary of categories?

EDIT: Maybe some CSS specialists have an answer. I see a small possibility to use the structure of this code to change the font color of the headline even though I really like beatniak´s coloured bars.

Last edited by tbones; 07-13-2007 at 01:35 PM.
Reply With Quote
  #13 (permalink)  
Old 07-13-2007, 08:23 PM
beatniak's Avatar
Pligg Donor
 
Join Date: Apr 2006
Location: NL - 52.100863;5.108356
Posts: 197
look at Receptencocktail for the solution.

css code is:
Code:
/* Headline */
.top {padding:0px 5px;margin-left:5px;}
.top h1  {clear:both;padding:0 5px;margin:0px -5px;height:28px;line-height:26px;}
.top h1 a, .top h1 a:visited {color:#fff;text-decoration:none;margin-left:-3px;padding:0 5px;font-size:17px;}
.top h1 a:hover {color:#cf0;text-decoration:underline;}
link_summary.tpl code is:
Code:
    <div class="top">
    
        <h1 id="ls_title-{$link_shakebox_index}" class="cat{$category_id}">
        {if $use_title_as_link eq true}{if $url_short neq "http://" && $url_short neq "://"}<a href="{$url}" {if $open_in_new_window eq true} target="_blank"{/if}>{$title_short}</a>
              {else}<a href="{$story_url}">{$title_short}</a>
              {/if}
      {else}<a href="{$story_url}">{$title_short}</a>
            {/if}
    </h1>
And it uses catcolors.css for the cat background colors.

That's it.

Want different colors instead of background colors, just change the CSS in the catcolors.css file. You don't have to be a CSS geek for that. Or am I weird for being abled to code and style a website on a napkin?

Last edited by beatniak; 07-13-2007 at 08:27 PM.
Reply With Quote
  #14 (permalink)  
Old 07-14-2007, 03:14 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
Beatniak, you´re my man!
That´s so great!

I couldn´t have done it in a thousand years. Just a small wish left:

I would prefer the sidebar category as you done it at Numarketing / Populair nieuws. Just a small rectangular colour information to the left with or without padding, I don´t mind.

EDIT: This is also a nice implementation of a category colour underline: News Heat / Hot Political News

Last edited by tbones; 07-15-2007 at 08:49 AM.
Reply With Quote
  #15 (permalink)  
Old 07-14-2007, 01:06 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
I just noticed that your categories.tpl code is unable to to show upcoming stories by category.

I couldn´t explain myself how to insert the extra-code of you into v9.5 standard code therfore if´ve copied the whole div-segment into my file.
Reply With Quote
  #16 (permalink)  
Old 07-15-2007, 03:34 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
I did some extensive trail´n´error and found this code for categories.tpl:

Code:
<div class="tlb">
	{php}
		echo "<span><a onclick=\"new Effect.toggle('cats','blind', {queue: 'end'}); \"> <img src=\"".my_pligg_base."/templates/".The_Template."/images/expand.png\"></a></span>";
	{/php}
	<a href="#">{#PLIGG_Visual_Category_Title#}</a>
</div>

<div id="cats" style="padding-bottom:1px">
	<ul id="nav-secondary">
      {section name=thecat loop=$cat_array start=1}
          {if $cat_array[thecat].auto_id neq 0}
          
            {if $cat_array[thecat].spacercount lt $lastspacer}{$cat_array[thecat].spacerdiff|repeat_count:'</ul>'}{/if}
	    {if $cat_array[thecat].spacercount gt $lastspacer}<ul style="padding-left:12px">{/if}          
            
            <a href="{$URL_rsscategory, $cat_array[thecat].auto_id}" target="_blank" style="border:none;"> 	 
  	        <img src="{$my_pligg_base}/templates/{$the_template}/images/rss.gif" border="0" style="float:right;padding-right:10px;"></a>
          
                {if $cat_array[thecat].safename eq $request_category}
                      <li id="huidig" class="cat{$cat_array[thecat].auto_id}">
                  {else}<li class="cat{$cat_array[thecat].auto_id}">
                {/if}
                
                {if $pagename eq "published"}
			 <a href="{$URL_maincategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a></li>
		  {else}
			<a href="{$URL_queuedcategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a></li>
					      {/if}    
          {/if}
      {/section}
	</ul>
The subcategories are still wrong but the upcoming view and the rss link works.

Edit: Tested on FF, IE 7 look is very artistic *g*

Last edited by tbones; 07-15-2007 at 04:14 AM.
Reply With Quote
  #17 (permalink)  
Old 12-13-2009, 08:07 AM
princevio's Avatar
Casual Pligger
Pligg Version: 1.0.2
Pligg Template: wistie
 
Join Date: Nov 2009
Posts: 76
Hi,
Can anyone help me to display categories like this site on home page "kreativenews.com"



Link: Doomic.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control of meta description - categories Divisive Cotton Questions and Comments 71 03-29-2011 10:03 PM
Pligg Categories Yankidank Wiki Articles 1 12-17-2008 11:10 AM
How to show category keywords as text on the site? gnalkit Questions and Comments 4 11-26-2008 06:17 AM
Category colors in Ver 9.0 fjcaceres Questions and Comments 5 07-15-2007 04:32 PM
Changing category colors? gilgalad Questions and Comments 1 05-07-2007 06:17 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development