Hi,
When I am viewing the entries of a category the title bar displays CATEGORY - BLOGTITLE. If I then go to the archives I only get entries of that category. So far so good, I would expect that behaviour.
The problem is that, in such a case, I am consulting the archives of a particular category but that doesn't reflect on the title bar which changes to BLOGTITLE - ARCHIVE MONTH/YEAR, and I lose track of the category I'm in (even worse, a user that is not aware of that feature might think that there are only entries of that type for the refered months).
Is there a way to change the title to CATEGORY - ARCHIVE MONTH/YEAR in such situations?
Thank you,
nbar
title bar behaviour of archive consulting within a category
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: title bar behaviour of archive consulting within a categ
Hi!
Yes, that should be possible.
Whenever you're in "category" viewing mode, those Smarty variables are set:
$category holds the ID of the current category. {$category_info} is an array that holds the keys {$category.info.category_name} for example.
So with that you should be able to patch up your index.tpl file?
If you have more questions, please ask!
Regards,
Garvin
Yes, that should be possible.
Whenever you're in "category" viewing mode, those Smarty variables are set:
Code: Select all
{$category_info}
{$category}
So with that you should be able to patch up your index.tpl file?
If you have more questions, please ask!
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
So here is my solution. But first i need to state the problem clearly.
I want the following behaviour on the banner titles:
- the blog title is always the Head Title (HT)
- in a category the category name is Head Subtitle (HST)
- in an archive the category name is HST (if we are within a category) and the month-year is beneath it (the month-year appears as HST if we are not in a category archive)
- in a static page the name of the page is HST
- in an article its category is HST (no article name as title)
The soluiton I came up with is a bit clumsy but works. I've checked in each situations which variables were defined and used that trick to get what I wanted... Here is the code:
There is certainly a much clever way of handling all the if_then_else but I needed a fast solution. I would also like a nicer way of doing all this by defining directly the HT and HST variables... just for the sake of nice programming!
Thank you,
nbar
I want the following behaviour on the banner titles:
- the blog title is always the Head Title (HT)
- in a category the category name is Head Subtitle (HST)
- in an archive the category name is HST (if we are within a category) and the month-year is beneath it (the month-year appears as HST if we are not in a category archive)
- in a static page the name of the page is HST
- in an article its category is HST (no article name as title)
The soluiton I came up with is a bit clumsy but works. I've checked in each situations which variables were defined and used that trick to get what I wanted... Here is the code:
Code: Select all
<!-- if it's the blog title then i want the usual behaviour reversed-->
{if $head_subtitle == $blogTitle and ($staticpage_headline or $category_info.category_name)}
<a class="homelink1" href="{$serendipityBaseURL}">{$head_subtitle}</a><br>
<a class="homelink2" href="{$serendipityBaseURL}">{$head_title}</a>
{else}
<!-- if it's defined and it's not the blog title then it's and archive date -->
{if $head_subtitle and $head_subtitle != $blogTitle}
<!-- check if it's an archive within a category -->
{if $category_info.category_name}
<a class="homelink1" href="{$serendipityBaseURL}">{$blogTitle}</a><br>
<a class="homelink2" href="{$serendipityBaseURL}">{ $category_info.category_name}</a><br>
<a class="homelink2" href="{$serendipityBaseURL}">_{$head_subtitle}</a>
<!-- archive without category -->
{else}
<a class="homelink1" href="{$serendipityBaseURL}">{$blogTitle}</a><br>
<a class="homelink2" href="{$serendipityBaseURL}">_{$head_subtitle}</a>
{/if}
<!-- there is no date to show -->
{else}
<!-- but there might be a category name -->
{if $category_info.category_name}
<a class="homelink1"href="{$serendipityBaseURL}">{$head_subtitle|@default:$blogTitle}</a><br>
<a class="homelink2" href="{$serendipityBaseURL}">_{ $category_info.category_name}</a>
{else}
<a class="homelink1" href="{$serendipityBaseURL}">{$head_subtitle|@default:$blogTitle}</a>
{/if}
{/if}
{/if}
Thank you,
nbar
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
You might want to look at the new "{$view}" smarty variable that was introcduced to recent 1.0 and 1.1 versions (snapshots only, though - the actuall release will be made later next week).
This variable contains "archive" or "categories" or whatever else and indicates the page you are currently viewing...
Best regards,
Garvin
You might want to look at the new "{$view}" smarty variable that was introcduced to recent 1.0 and 1.1 versions (snapshots only, though - the actuall release will be made later next week).
This variable contains "archive" or "categories" or whatever else and indicates the page you are currently viewing...
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/