Hi,
I have the following listview:
<we:listview type="object" name="kandidaatlist" categories="/Noord-Holland/Aalsmeer" classid="9">
I would like to use a dynamic categorie instead of pre-defining the categorie. It would take to much templates this way.
So something like categories="$category"
Can anyone help me out with this one?
Thanks,
Japio
dynamic categories
-
- Senior Member
- Beiträge: 919
- Registriert: Fr 22. Mai 2009, 21:40
- Wohnort: Berlin
- Kontaktdaten:
Re: dynamic categories
Hi Japio,
sure, just add a slash before the $ to escape it.
categories="\$category"
Regards,
Daniel
sure, just add a slash before the $ to escape it.
categories="\$category"
Regards,
Daniel
Re: dynamic categories
Daniel,
Thanks for the quick reply. The document has a category assigned to it. How can i display only the objects with this category?
Thanks for the quick reply. The document has a category assigned to it. How can i display only the objects with this category?
Re: dynamic categories
Sorry, allready fixed it.
Re: dynamic categories
It looks like it's not working the same in all listviews. I used the following code to determine the categorie assigned to a document:
<?php
$categories = (string) $GLOBALS['we_doc']->Category;
$a_categories = explode(',', $categories);
$aa_categories = array_slice($a_categories, 1, -1);
$categories = $a_categories['1'];
$sql = (string) "SELECT Path FROM tblCategorys WHERE ID = '$categories'";
$ThisCat = (string) f($sql, 'Path', $GLOBALS['DB_WE']);
?>
And this is my listview:
<we:listview type="object" name="kandidaatlist" categories="\$ThisCat" classid="9">
Some pages display the right amount of objects and others don't. What could be the problem?
Thanks,
Japio
<?php
$categories = (string) $GLOBALS['we_doc']->Category;
$a_categories = explode(',', $categories);
$aa_categories = array_slice($a_categories, 1, -1);
$categories = $a_categories['1'];
$sql = (string) "SELECT Path FROM tblCategorys WHERE ID = '$categories'";
$ThisCat = (string) f($sql, 'Path', $GLOBALS['DB_WE']);
?>
And this is my listview:
<we:listview type="object" name="kandidaatlist" categories="\$ThisCat" classid="9">
Some pages display the right amount of objects and others don't. What could be the problem?
Thanks,
Japio
Re: dynamic categories
Are ther objects with multiple categories?!
If so, the option catOr="true|false" may help, i think the default behavior is catOr="false"
If so, the option catOr="true|false" may help, i think the default behavior is catOr="false"
Gruß Liquid
Wer ist online?
Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste