Hi, I'm trying to search a catalog and return a list of hits, and here is a code fragment: <dtml-in Catalog> <a href="<dtml-var "Catalog.getpath(data_record_id_)">"> <dtml-var title> </a> <dtml-var id><br> </dtml-in> This works ok, however, I understand that the catalog search does not actually return object references to the actual objects catalogued. I'd like to include some attributes from the actual objects (maybe by accessing the actual object via id, etc?) in the result list. Can someone let me know how to do that? I can of course include those attributes in the catalogue meta table so they would be returned with the search results, but I don't really want to do that unless there is no other way. Thanks for any info/help. Rgds Len
Leonard Chan wrote:
I'd like to include some attributes from the actual objects (maybe by accessing the actual object via id, etc?) in the result list.
You can get the actual object with: Catalog.getobject(data_record_id_) inside your dtml-in loop. This is supposedly a 'bad' thing to do but there's nothing better right now...
I can of course include those attributes in the catalogue meta table so they would be returned with the search results, but I don't really want to do that unless there is no other way.
Well, it might be the best way. Why? ...because otherwise you have to load up the whole object to get the attributes you want. If there's only a few attributes like this, which are small anyway, and your objects are large, then your wastign a load of RAM you don't need to be. HTH, cheers, Chris
participants (2)
-
Chris Withers -
Leonard Chan