Forum
Change site's logo on post.php depending on witch category is selected on post.h...
On post.php I have header's <h1>Site Title</h1>
and also <?php perch_blog_post(perch_get('s')); ?>
on main body.
On post.html template I have created two category sets.:
1) blog's default category set:
<perch:categories id="categories" set="blog" label="Kind" required="true" />
2) Who
set:
<perch:categories id="who" set="who" label="Who design it?" required="true" />
I am looking to add a class to header's h1 class="peter"
or class="michael"
depending on who
category is selected. Any idea?
You can get the catTitle from within the template via
<perch:category id="catTitle" />
. You may also be able to useformat="LC"
to ensure the output is lowercase for use in a HTML class.Hi Mathew, thanks for answering. That works good with main category set. I am trying to do it with
who
category. How could I filter it?Can you be more specific?
Hi Drew, I using two category sets on blog post:
I need to get
catTitle
fromwho
category set, but is giving me mainblog
set. How can I getwho
's set?logo.html
From what I know, you will need to access it via the below markup - not the self closing category tag.
You could then have that within the markup for the
class="
on your header.Hi Mathew, it's not getting anything editing
logo.html
Sorry, remove the
suppress="true"
nothing...
Any idea?
If you're using your own category set, you need to use the standard category functions to access it.