how to know whether acual view mode is category overview!

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
snafu
Regular
Posts: 108
Joined: Sat Dec 17, 2005 7:34 am

how to know whether acual view mode is category overview!

Post by snafu »

sorry, but have to know another item:

i wonder whether there is a variable like $is_single_entry that tells me, whether i have selected a category and have displayed all entrys of a certain category..

(i have to suppress a certain category in normal view of the blog and display it only, if this category is selected ..)

is there a list anywhere, which variables of s9y are available for smarty templating? (i think, there are extreme clever things to do with that smarty engine and s9y..!)


tnx!
snafu
Last edited by snafu on Mon May 29, 2006 12:56 pm, edited 1 time in total.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: how to know whether acual view mode is category overview

Post by garvinhicking »

Hi!

You can check {$category}, which contains the categoryid if the user is browsing a category...?
is there a list anywhere, which variables of s9y are available for smarty templating? (i think, there are extreme clever things to do with that smarty engine and s9y..!)
Have a look here: http://www.s9y.org/102.html

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/
snafu
Regular
Posts: 108
Joined: Sat Dec 17, 2005 7:34 am

Re: how to know whether acual view mode is category overview

Post by snafu »

garvinhicking wrote:Hi!
You can check {$category}, which contains the categoryid if the user is browsing a category...?
hm.
{$category} seems to be an array, and i tried to debug me this category id , but this did not work:

Code: Select all

category0 = {$category[0]}<br />
category1 = {$category[1]}<br />
category2 = {$category[2]}<br />
category3 = {$category[3]}<br />
(i expected to see some true or false resp. 1 / 0 bits there...?!)
i ask for some understanding for my lack of knowledge at this point
garvinhicking wrote: is there a list anywhere..
Have a look here: http://www.s9y.org/102.html
oh, thank you, didnt found that under css, fine!

tnx
snafu
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: how to know whether acual view mode is category overview

Post by garvinhicking »

Hi!

$category is not an array!

Check it with {$category|@print_r} (you might need to set $serendipity['smarty']->security = false; in your template'S config.inc.php).
oh, thank you, didnt found that under css, fine!
That might be because this document didn't exist until your posting. *g*

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/
snafu
Regular
Posts: 108
Joined: Sat Dec 17, 2005 7:34 am

Re: how to know whether acual view mode is category overview

Post by snafu »

garvinhicking wrote:Hi!
$category is not an array!
really? if i try this:

Code: Select all

category = {$category}<br />
i get shown:
category = Array

...1,2, testing ...

ok, got it:
{if $category.categoryid=="14"}
## kategorieansicht kleinanzeigen<br />
{/if}

$category.categoryid holds the number of category, if user is browsing category

oh, thank you, didnt found that under css, fine!
That might be because this document didn't exist until your posting. *g*
haha, documantation is mapped into user memory, if requested :-)


thank you!

snafu
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: how to know whether acual view mode is category overview

Post by garvinhicking »

Hi!

Hm, it really should not be an array, because inside include/functions_smarty.inc.php this is used:

Code: Select all

    if (isset($serendipity['GET']['category'])) {
        $category = (int)$serendipity['GET']['category'];
So the only way, "$category" might become an array if in your template you somewhere have a foreach loop or so, where $category is assigned on its own and overwrites the original smarty value.

In that case you should use {$category_info.categoryid} as your variable; else you might catch/use a wrong variable.

Which template and s9y version are you using?

Regard,s
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/
snafu
Regular
Posts: 108
Joined: Sat Dec 17, 2005 7:34 am

Re: how to know whether acual view mode is category overview

Post by snafu »

garvinhicking wrote:Hi!
So the only way, "$category" might become an array if in your template you somewhere have a foreach loop or so, where $category is assigned on its own and overwrites the original smarty value.
i never wrote anything like this...
garvinhicking wrote: Which template and s9y version are you using?
1.0-beta3 and a template of my own, based on somthin i cannot remember.

it is wierd, because i can get the right number out of this variable, so that i can select this entry ..

ill try it out a bit later, have to have an appointment right now...

tnx in advance!

snafu
snafu
Regular
Posts: 108
Joined: Sat Dec 17, 2005 7:34 am

Re: how to know whether acual view mode is category overview

Post by snafu »

{$category.categoryid|@print_r}

shows

Code: Select all

Array ( [entryid] => 121 [categoryid] => 7 [category_name] => Veranstaltungen [category_description] => [category_icon] => [parentid] => 0 [category_link] => http://xs4all.xs.funpic.de/cms1/index.php?/categories/7-Veranstaltungen ) 1
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: how to know whether acual view mode is category overview

Post by garvinhicking »

Hi!

Please search all your *.tpl files plus the one in "default" to see if there is any mention of "category" or "$category". I think this was a bug that has been fixed in either the 1.0 or the 1.1 branch and the default templates...

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/
snafu
Regular
Posts: 108
Joined: Sat Dec 17, 2005 7:34 am

Re: how to know whether acual view mode is category overview

Post by snafu »

garvinhicking wrote:Hi!

Please search all your *.tpl files plus the one in "default" to see if there is any mention of "category" or "$category". I think this was a bug that has been fixed in either the 1.0 or the 1.1 branch and the default templates...

Regards,
Garvin
there are some lines using this vatiable, like

<a href="{$category.category_link}"> ... and ..
{if $category.category_icon}


for instance.

i think, instead of debugging the templates, i will wait for the next release and write my template from scratch, as there are some more wishes from my users...

thank you so far!
snafu
Post Reply