Gossamer Forum
Home : Products : DBMan : Customization :

Dipslaying HTML

Quote Reply
Dipslaying HTML
Is this possible and if so could someone point me to how?

I am looking to print a categorized list of my db. It is a book list. I want to soft the html table by Author. So the first line would have the author and nothing else. The second line would have the first book. The third line would have the second book. Then I would like to break for a line and start in on the next author.

i.e.

Author1
Book1 field1, field2
Book2 field1, field2

Author2
Book1 field1, field2
Book2 field1, field2

Quote Reply
Re: Dipslaying HTML In reply to
Try using the short/long display mod, which is located at the following URL:

www.jpdeni.com/dbman/mods.html

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Dipslaying HTML In reply to
Got that in place, I just can't figure out how to stack my results:

Author1
<SPACE>Book1 field1, field2
<SPACE>Book2 field1, field2

Author2
<SPACE>Book1 field1, field2
<SPACE>Book2 field1, field2
Quote Reply
Re: Dipslaying HTML In reply to
If I understand what you're asking, you need to turn off the autogenerate line in sub html_record and type in how you want the record to display with html, like this:

sub html_record {
#----------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.

my (%rec) = @_; # Load any defaults to put in the VALUE field.

#Comment or delete the following line
#($db_auto_generate and print &build_html_record(%rec) and return);

my $font_color = 'Font Color=#000000';

print qq|

<$font>$rec{'Author'}</Font>
<ul>
<$font>$rec{'Book1'}</Font>,<$font>$rec{'field1'}</Font><$font>$rec{'field1'}</Font><br>
<$font>$rec{'Book2'}</Font>,<$font>$rec{'field2'}</Font><$font>$rec{'field2'}</Font><br>
</ul>
|;
}



Thats assuming that every author has one record listing all his/her books... right?

Quote Reply
Re: Dipslaying HTML In reply to
No that would make life too simple. One record per book. So I think I need some kind of look for each entry of author. Al least that is my uneducated guess. Each record looks like this in Short view now.

i.e.

Stephen King|Cujo|Unknown|$11.99
Stephen King|Pet Semetary|Unknown|$4.99
C.S. Lewis|God in the Docks|Unknown|$8.99
C.S. Lewis|Miracles|Unknown|$9.99

I Would like this to be:
Stephen King
Cujo
Pet Semetary

C.S. Lewis
God in the Docks
Miracles

Preferably Author could be sorted by Last Name as well.

The rest of the data would either go on the line with the title of the book or on the long display.

No asking much, just everything ;0)

joe
Quote Reply
Re: Dipslaying HTML In reply to
I figured it was something harder.

The only thing I can think of may or may not work for your purposes, and it would be a little more labor-intensive for you. Have an author field that is hidden from the display field. I don't know if you sort hidden fields alphabetically or not.

THEN, for the first alphabetical title by each author, you would have another field called "authordisplay" or something where it would have the author's name again. The field wouldn't show up if it was empty, so you would only have it filled in for one record per author- the with the first (alphabetically) book.

This would only work if the first book was always going to show up as a result. It wouldn't work if the searcher was to type in "Stephen King and less than $10" for example, where Stephen King books showed up, but not all of them.

There's probably another better solution, but I'm pretty new at this.
Quote Reply
Re: Dipslaying HTML In reply to
Maybe you should see if one of the grouping mods like list_categories, could be modified to do the job.
It could then group one field, the Author field, and the other book fields could be placed into an array ungrouped to be printed out.
Unfortunately my perl is not the best, so I carn't help you out, but if you ask the guys in the perl forum, they may give you a hand.

Bob