Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Don't Display Fields in search results

Quote Reply
Don't Display Fields in search results
I've been trying to find the solution to this but as yet haven't found it. In my search results I don't want all the feilds to be shown. Some of them are just for the admin's to keep track of. It seems like I used to know how to do this with DBMan a couple of years ago, but I'm lost with this problem now (and using DBMan SQL for the first time).

Any help would be appreciated!

-Chris
-----------
Crowe (crowe@lit.org)
Quote Reply
Re: [Crowe] Don't Display Fields in search results In reply to
Well, you could put the field inside a conditional statement in your search results template:
<%if admin_p%><%private_field%><%endif%>
Quote Reply
Re: [Halito] Don't Display Fields in search results In reply to
I think that's on the right track, but it doesn't work. I'll go into a little more detail.

I've got the search result fields open with no auth. So when a person comes to the db, they can view all, or search. It's those results that I want to *not* show a handful of fields. The code you posted sounds like it would work if users logged in, or even if they didn't, but the code didn't work. I'm going to post what I did below in case I fouled it up! Thanks for the help.

Here is the search results template..

Code:


<%include header.html%>
<p>
<center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="125">
<table bgcolor="#ffffff" border="0" width="500" valign="top">
<tr>
<td>
<p align="center"><%speedbar%></p><p>
<%loop results%>
<p><%Dbsql::HTML::generate_search_results%>
<%if admin_p%><%TitleID%><%endif%>
<%endloop%>
<%if speedbar%><p align="center"><%speedbar%></p><%endif%>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<p>
<%include footer.html%>
-----------
Crowe (crowe@lit.org)
Quote Reply
Re: [Crowe] Don't Display Fields in search results In reply to
Replace <%Dbsql::HTML::generate_search_results%> with your own HTML version of your search results and you can treat your <%TltleID%> tag, or any other tag, however you want. It shouldn't matter that regular users don't log in. The field shouldn't appear to users who haven't logged in if you use the conditional around it.

Good luck,
Hal
Quote Reply
Re: [Halito] Don't Display Fields in search results In reply to
Thanx a bunch. That was exactly what I needed! Perfect.

-Chris
-----------
Crowe (crowe@lit.org)