Gossamer Forum
Home : Products : DBMan : Customization :

Trying to create two different short displays...

Quote Reply
Trying to create two different short displays...
I have created a real estate database and am trying to create two different short displays depending on the parameters of the search.

The search is structured in a way that the user can only search by property type (Houses, Commercial Property, Subdivisions, Mobile Homes etc...) using hard links, not a fill in form.

I am trying to structure the short display to return a different format depending on which property type the user searches. My question is, how do I do this?

An example of the two different formats and a link to the database is located at:

http://www.webtuneup.com/impactproperties/index2.html

I realize that one option is to break this up into different database's. I am trying to avoid that if possible and just manipulate the html.pl file to get it to do what I need it to.

Any help would be greatly appreciated by this perl newbie.

Thanks,
Rob







[This message has been edited by RSBlack (edited October 17, 1999).]
Quote Reply
Re: Trying to create two different short displays... In reply to
I am confused about what you mean by the following statement:

Quote:
The search is structured in a way that the user can only search by property type (Houses, Commercial Property, Subdivisions, Mobile Homes etc...) using hard links, not a
fill in form.

What do you mean by hard links? From the example you provided it looks like the links are dynamic and built-in with the short/long display mod.

From the looks of your example, all you need to do is apply the Short/Long Mod to your DBMAN. This mod is located at the following URL:

www.jpdeni.com/dbman/mods.html

Regards.

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Trying to create two different short displays... In reply to
By "hard links" do you mean "pre-defined searches"? If so, could you give me an example of one of your links?


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





Quote Reply
Re: Trying to create two different short displays... In reply to
You are exactly right, when I am referring to "hard links" I mean pre-defined searches.

An example is:
http://www.webtuneup.com/cgi-bin/dbman/db.cgi?db=default&uid=default&PropertyType=Houses&keyword=&mh=50&sb=---&so=ascend&view_records=View+R ecords


I have already implemented the short/long mod. If you follow the link above you will see it in action. I am trying to use a different short format if the user follows a different pre-defined search. There are several predefined searches set up and linked at the bottom of each page.

Quote Reply
Re: Trying to create two different short displays... In reply to
First, you don't need to have quite so much in your predefined search link. (What you have won't matter, but it's extra size to the file and extra typing.) You can just use:

Code:
http://www.webtuneup.com/cgi-bin/dbman/db.cgi?db=default&uid=default&PropertyType=Houses&view_records=1

That's a small thing, but it makes it easier for me to follow this way.

Second, for your links to Commercial Property, Mobile Homes, or anything that has a space in it, be sure to replace the space with a + --
Commercial+Property
Mobile+Homes

Now for the different displays. In sub html_view_success, instead of

Code:
&html_record (&array_to_hash($_, @hits));

use something like

Code:
if ($in{'PropertyType'} eq 'Houses') {
&html_record_house(&array_to_hash($_, @hits));
}
elsif ($in{'PropertyType'} eq 'Commercial Property') {
&html_record_commercial(&array_to_hash($_, @hits));
}
elsif ($in{'PropertyType'} eq 'Mobile Home') {
&html_record_mobile(&array_to_hash($_, @hits));
}

Make sense?


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





Quote Reply
Re: Trying to create two different short displays... In reply to
Ok, I see how that part works now. That solves part of my problem. The other portion of the problem is I believe in the the sub html_view_success.

Within the sub html_view_success I have placed html code for the header row of the data that I am trying to display in the sub html_record (so it will only show up once at the top of the page).

Depending on weather the user follows a pre-defined search for Homes or Commercial or any other type of property I need that html code in the html_view_success be different.

How do I do this? I have posted the html.pl code at the following url:

http://www.webtuneup.com/impactproperties/html_pl.txt

the sub I am referring to begins on line 566

Rob

Quote Reply
Re: Trying to create two different short displays... In reply to
You would do something similar to the previous code:

Code:
if ($in{'PropertyType'} eq 'Houses') {
print qq|table headers for houses|;
}
elsif ($in{'PropertyType'} eq 'Commercial Property') {
print qq|table headers for commercial|;
}
elsif ($in{'PropertyType'} eq 'Mobile Home') {
print qq|table headers for mobiles|;
}

This would go after

Code:
if ($db_next_hits) { print "<br><$font>Pages: $db_next_hits</font>"; }




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





Quote Reply
Re: Trying to create two different short displays... In reply to
Just a quick note to say thank you. With the tech support you've given me everything is working great. Smile

DBMan is a great product. You can view the database in action at:

http://www.webtuneup.com/impactproperties/

We're just about ready to go live.

Thanks again.