Gossamer Forum
Home : Products : DBMan : Customization :

Multiple html_view_success

Quote Reply
Multiple html_view_success
Can I have three html_view_success's, with a different one displaying, depending on what the user has searched for?

I have a button bar at the top of my results screen- I want the button bar to be different depanding on what the user searches for.

I searched the forums already. If its been posted already, I apologize.

thanks in advance!
Quote Reply
Re: Multiple html_view_success In reply to
Sigrid,

Anything is possible in the land of PERL. It's just a matter of how to do it. Smile

However, instead of three different html_view_success routines, I would suggest just a simple comparator in your current routine. I'm not sure what you mean by "what the user has searched for" -- are you talking about a category, or trying to translate what keywords they put in?

Anyway, a quick example of something like this is if they are using a drop-down with three options. You would put this in your html_view_success where you want your button bar to be displayed:

Code:
|;
print qq|... button bar code 1 ...| if ($in{'Field'} eq 'Option1');
print qq|... button bar code 2 ...| if ($in{'Field'} eq 'Option2');
print qq|... button bar code 3 ...| if ($in{'Field'} eq 'Option3');
print qq|

Hope this helps!

--Lee
Quote Reply
Re: Multiple html_view_success In reply to
Thank you so much!!

I haven't tried it yet, but that looks like exactly what I was trying to do- and its to easy too.

I really need to learn PERL (but then again, I have all you, why do I need to). hee hee.

thanks again, leisurelee

Quote Reply
Re: Multiple html_view_success In reply to
 
Quote:
I really need to learn PERL (but then again, I have all you, why do I need to). hee hee.

So, that you can de-bug your scripts, create custom features that fit your needs, and so that you can start thinking out of the box (codes) and be able to adapt codes provided in this forum into your DBMAN scripts.

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Multiple html_view_success In reply to
  I used <p>print qq| BUTTON BAR | if (($in{'Condition1'} eq 'True') | | ($in{'Condition2'}
eq 'True'));<p>to make it work for either or. I know to swith | | with && if I want to AND it instead of OR. I'm learning- eh?<p>But this doesn't work:<p><table><tr>
print qq| <td><a href="/hum/art.html ">Art and Images Subject Guide</a></td>| if ($in{'SubCategory'} eq 'Art');
</tr></table><p>Is there a way to make a table, but have certain cells appear only if conditions are met- I don't know why my code above isn't working.<p>thanks again!!<p>[This message has been edited by sigrid (edited April 28, 2000).]
Quote Reply
Re: Multiple html_view_success In reply to
How is it not working? What is happening?


------------------
JPD






Quote Reply
Re: Multiple html_view_success In reply to
Nothing displayed at all- I got a server error. Should that work?
Quote Reply
Re: Multiple html_view_success In reply to
Well, I notice that you have

Code:
<table><tr>
print qq| <td><a href="/hum/art.html ">Art and Images Subject Guide</a></td>| if ($in{'SubCategory'} eq 'Art');
</tr></table>

You need to tell the script to print the opening <table><tr> and closing </tr></table> tags, too. When I first looked at it, I thought it was just the snippet of code that you posted, but now I think there's an error. Smile

I can't be certain without knowing what comes before and after this code, but the following will make this bit of code work:

Code:
print "<table><tr>";
print qq| <td><a href="/hum/art.html ">Art and Images Subject Guide</a></td>| if ($in{'SubCategory'} eq 'Art');
print "</tr></table>";

Give that a try and see if it fixes your problem.


------------------
JPD






Quote Reply
Re: Multiple html_view_success In reply to
thanks JPDeni!! I'm in the middle of something else right now (trying to figure exporting into access). I'll try that in a few.

Quote Reply
Re: Multiple html_view_success In reply to
Yup, that worked. Thank you!!!

Sigrid
(one of my dbman sites: http://www.lib.lsu.edu/databases/)