Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Custom search results...

Quote Reply
Custom search results...
Obviously the basic search results form was not intended for use with a custom site, but not being any type of programmer, I've not been able to figure out how to customize mine. Also obviously, there is some way to plug variables into the code and have them get info from the database and print it out, but unfortunately my knowledge of Perl doesn't extend that far.

This is what I'd like it to look like. As you can see, I have the HTML generated already, I just don't know how to get the variables to print.


This is the template with the variable names in place, where I'd them to be. They've been colored red for better viewing


This is the template as I'd like to to look after a search. Again, the words that have been printed using variables are in red.
Quote Reply
Re: [Merrie] Custom search results... In reply to
Just simply use <%variable_name%> in your html code. To find out what tags you have available in your template, put the following in your template and load the page. <%GT::Template::dump%>

TheStone.


B.
Quote Reply
Re: [TheStone] Custom search results... In reply to
I actually did try that at the very first - and all that shows up is empty space where the variable should be. Is there any other code that I'd also need to include?
Quote Reply
Re: [Merrie] Custom search results... In reply to
Did you put them inside the loop:

<%loop search_results%>
<%variable%>
<%endloop%>

TheStone.

B.
Quote Reply
Re: [TheStone] Custom search results... In reply to
If I put them inside that loop, the whole thing just dissapears. As it currently stands, any value I place into the search form will show up in the corrcecr place on the results form, but none of the other data will. So, for example, if I search "1" in the ID form, all that shows up in the correct place on the results form is "1".
Quote Reply
Re: [Merrie] Custom search results... In reply to
Try <%GT::Template::dump%> to see if the search_results is available in the searh_results form

TheStone.


B.
Quote Reply
Re: [TheStone] Custom search results... In reply to
No, it isn't avaliable. There's nothing intitled 'search_results' anyway, just plain 'results'.
Quote Reply
Re: [Merrie] Custom search results... In reply to
Can you send me username and password to access the admin panel, I take a closer look at it?

TheStone.

B.
Quote Reply
Re: [TheStone] Custom search results... In reply to
No problem. I've sent them via PM, hope that's ok. Also, thanks so much for all the help you've been giving.
Quote Reply
Re: [Merrie] Custom search results... In reply to
Oops, search results should be returned in 'results' instead of 'search_results'. I.e:
<%loop results%>
<%column_name%>...
<%endloop%>

TheStone.

B.
Quote Reply
Re: [TheStone] Custom search results... In reply to
Thanks! It looks like it's actually working now, for the most part.