
joejac
Posts: 242
|
| Posted: 04/04/2008, 8:19 AM |
|
Hello,
I want to change a css class when a menu category changes and have an Active link on the current page, so I have this HTML code for the menu:
<div id="menu1">
<!-- BEGIN Grid categorias -->
<!-- BEGIN Row -->
<input type="hidden" name="{categoria_no_Name}" id="categoriascategoria_no{categorias:rowNumber}" value="{categoria_no}" />
<a href="{categoria_nombre_Src}" id="categoriascategoria_nombre{categorias:rowNumber}" class="{activelink}">{categoria_nombre}</a>
<!-- END Row -->
<!-- BEGIN NoRecords -->
<p>No records</p>
<!-- END NoRecords --><!-- END Grid categorias -->
</div>
In Before Show event I have:
global $Tpl;
global $categorias;
$Categoria_number=$categorias->ds->f("categoria_no");
echo $Categoria_number;
if (CCGetParam("categoria_tope","") == $Categoria_number) {
$Tpl->SetVar("activelink", "active");
}
else {
$Tpl->SetVar("activelink", "noactive");
}
But I get the error:
Fatal error: Call to a member function f() on a non-object in W:\www\customer\Header_events.php on line 17
If I change line 17: $Categoria_number=$categorias->ds->f("categoria_no");
for this one: $Categoria_number=$categorias->categoria_no->GetValue();
I get this other error:
Fatal error: Call to a member function GetValue() on a non-object in W:\www\customer\Header_events.php on line 17
Please help, What am I doing wrong?
Regards
joejac
|
 |
 |
joejac
Posts: 242
|
| Posted: 04/07/2008, 9:03 AM |
|
Hello,
Support helped me with this, the problem is that I was working with an includable page (Header) and it needs the exact reference, this works perfect:
$Categoria_number=$Header->categorias->categoria_no->GetValue();
In general:
$Includable_Page_Name->form_name->field_name->GetValue();
Regards
joejac
|
 |
 |
|

|
|
|
|