Page 1 of 1
how to know whether acual view mode is category overview!
Posted: Mon May 29, 2006 9:23 am
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
Re: how to know whether acual view mode is category overview
Posted: Mon May 29, 2006 10:44 am
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
Re: how to know whether acual view mode is category overview
Posted: Mon May 29, 2006 11:02 am
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
oh, thank you, didnt found that under css, fine!
tnx
snafu
Re: how to know whether acual view mode is category overview
Posted: Mon May 29, 2006 11:04 am
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
Re: how to know whether acual view mode is category overview
Posted: Mon May 29, 2006 12:56 pm
by snafu
garvinhicking wrote:Hi!
$category is not an array!
really? if i try this:
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
Re: how to know whether acual view mode is category overview
Posted: Mon May 29, 2006 1:31 pm
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
Re: how to know whether acual view mode is category overview
Posted: Mon May 29, 2006 1:43 pm
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
Re: how to know whether acual view mode is category overview
Posted: Mon May 29, 2006 1:53 pm
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
Re: how to know whether acual view mode is category overview
Posted: Mon May 29, 2006 2:41 pm
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
Re: how to know whether acual view mode is category overview
Posted: Mon May 29, 2006 5:51 pm
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