Community

How do I style a taxonomy term page by node type?

I need to style taxonomy term pages. The solution has to be specific to the taxonomy category. For example, I cannot use page--taxonomy.tpl.php or node--taxonomy.tpl.php because it will style my other taxonomy pages/nodes. I need this solution to be unique to my taxonomy category.

I need a class on the taxonomy category pages for blog_subjects which are set to a url alias at blog/[term:name]. The blank div is where I need the class.

<?php
<div class="region region-content">
<
section id="block-system-main" class="block block-system">
<
div>
<
div class="term-listing-heading">
?>

I have tried this solution (specific for drupal 6):
http://drupal.org/node/131039

I need a solution for drupal 7. I have spent three days on this. Thank you in advance for your help!

Comments

first make a condition to

first make a condition to determine what taxonomy category is present, then with that if that category is the one present you have to add a css class on your div..

on the php condition it is where you will put the class..

example:

<?php
if ($taxonomy->category == "category"):
?>

<?php
endif;
?>

<?php
if ($taxonomy->category != "category"):
?>

<?php
endif;
?>

hope i have help you

Marc Jones Dinero
Drupal Web Developer/Themer
Promet Solutions, Inc.
1802 W. Berteau Ave., Unit 209
Chicago, IL 60613

Mobile: +63 9494906965
YIM: dinero_marc
Skype: mjonesdinero

Drupal Web Development
Hosting
Online Marketing

Where do I put the div?

Where do I put the div? Where does the php go to indicate this for the taxonomy page view?

you put this php on your

you put this php on your template file for the taxonomy page.

then the div goes inside the ifelse statement

Marc Jones Dinero
Drupal Web Developer/Themer
Promet Solutions, Inc.
1802 W. Berteau Ave., Unit 209
Chicago, IL 60613

Mobile: +63 9494906965
YIM: dinero_marc
Skype: mjonesdinero

Drupal Web Development
Hosting
Online Marketing

The page is a view

The page is a view created from the taxonomy term using the ds module. Where would I find that template file for that specific term view?

o i see, when you are on that

o i see, when you are on that page

what is the class on the body tag?

because it can help you alot with your theming issue

please post it here

Marc Jones Dinero
Drupal Web Developer/Themer
Promet Solutions, Inc.
1802 W. Berteau Ave., Unit 209
Chicago, IL 60613

Mobile: +63 9494906965
YIM: dinero_marc
Skype: mjonesdinero

Drupal Web Development
Hosting
Online Marketing

Here is what I am look at

The problem is that I need to move the block containing categories on the right up to the top. I cannot style it because there are no unique classes called within the taxonomy view_mode page.

http://test.raymondhoffman.com/blog/design-and-development

Categories Design

Categories

is this the block you are referring?
and also is the category with taxonomy term id 82(page-taxonomy-term-82) is the only thing you want to have this kind of css?

Marc Jones Dinero
Drupal Web Developer/Themer
Promet Solutions, Inc.
1802 W. Berteau Ave., Unit 209
Chicago, IL 60613

Mobile: +63 9494906965
YIM: dinero_marc
Skype: mjonesdinero

Drupal Web Development
Hosting
Online Marketing

Also need the Categories block on other tag pages

Thank you Marc. I also need this block on other taxonomy pages. How would I style it to the top on all of the taxonomy pages, even if some are added later?

you can use of css, by adding

you can use of css, by adding the class of the body what like i have said above like the term-id class on the body, it will not affect other pages

Marc Jones Dinero
Drupal Web Developer/Themer
Promet Solutions, Inc.
1802 W. Berteau Ave., Unit 209
Chicago, IL 60613

Mobile: +63 9494906965
YIM: dinero_marc
Skype: mjonesdinero

Drupal Web Development
Hosting
Online Marketing

Other term id pages

how would I set block to show for all taxonomy pages so I do not need to custom stye new taxonomy terms that are added as pages later?

Is adding term ID onto the tlp.php the only way to do this?

you can use the class on the

you can use the class on the body

the page-taxonomy, in a body tag there is a unique class there..

Marc Jones Dinero
Drupal Web Developer/Themer
Promet Solutions, Inc.
1802 W. Berteau Ave., Unit 209
Chicago, IL 60613

Mobile: +63 9494906965
YIM: dinero_marc
Skype: mjonesdinero

Drupal Web Development
Hosting
Online Marketing

Already tried using that

I have already used page-taxonomy. The problem with that is I have other taxonomy pages throughout my site where I do not want this styling. For example, on my services pages, I do not want the taxonomy pages to be affect by my styling on the blog taxonomy pages.

final question.. what

final question.. what specific taxonomy terms do you want to redesign and on what specific pages do you want to not effect it?

Marc Jones Dinero
Drupal Web Developer/Themer
Promet Solutions, Inc.
1802 W. Berteau Ave., Unit 209
Chicago, IL 60613

Mobile: +63 9494906965
YIM: dinero_marc
Skype: mjonesdinero

Drupal Web Development
Hosting
Online Marketing