Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Help With Global

Quote Reply
Help With Global
I have a simple global in and working now. I just want to jazz it up a bit.

Essentially, my problem is with alternate titles. I list them (things like possible English translations, alternate titles, etc) in a seperate field called "Eng_Title". In my database, I list all the alternate titles seperated by a "space-comma-space" delimiter, and this works fine. I have the global subsitite the "space-comma-space" with formatting- basically I italisize the entry, and put quote marks around it. Works fine. Here is my code:

sub {
use strict;
my ($rec) = @_;

my $short = $rec->{'Eng_Title'};
my $id = $rec->{'ID'};
$short =~ s/ , /<\/i>\", \"<i>/g;
return $short;
}

So here is what I want to do to spice things up. I would like the final subsitution in the list (if there is a list, sometimes I might only have one alt title) to be a '</i>" and "<i>'- adding an "and" in there. Not sure how to ONLY substitutre the last instance.

And I would also like to return a second variable- I do not care, a 1 and 0, a yes or no, I do not care, but some sort of flag to my template that says whether there is one or more than one item in the list, so I can add a "s" to the banner. So in the template, it would be: Alternate Title<%if flag%>s<%endif%>. Make sense?

If you want to see this in action, here is the page I have dummied up for testing:

Test Page

Look under the "Cartoon Production Information" banner for the results...

Thank You!

dave

Big Cartoon DataBase
Big Comic Book DataBase

Last edited by:

carfac: May 14, 2008, 9:14 AM
Subject Author Views Date
Thread; hot thread Help With Global carfac 14460 May 14, 2008, 9:11 AM
Thread; hot thread Re: [carfac] Help With Global
Andy 13328 May 14, 2008, 10:43 AM
Thread; hot thread Re: [Andy] Help With Global
carfac 13341 May 14, 2008, 11:02 AM
Thread; hot thread Re: [carfac] Help With Global
Andy 13347 May 14, 2008, 11:12 AM
Thread; hot thread Re: [Andy] Help With Global
eupos 13299 May 14, 2008, 11:26 AM
Post; hot thread Re: [eupos] Help With Global
Andy 13337 May 14, 2008, 11:49 AM
Thread; hot thread Re: [eupos] Help With Global
carfac 13316 May 14, 2008, 11:51 AM
Thread; hot thread Re: [carfac] Help With Global
Andy 13318 May 14, 2008, 11:54 AM
Thread; hot thread Re: [Andy] Help With Global
carfac 13305 May 14, 2008, 12:02 PM
Thread; hot thread Re: [carfac] Help With Global
Andy 13330 May 14, 2008, 12:09 PM
Thread; hot thread Re: [Andy] Help With Global
eupos 13318 May 14, 2008, 12:17 PM
Thread; hot thread Re: [eupos] Help With Global
Andy 13301 May 14, 2008, 12:19 PM
Thread; hot thread Re: [Andy] Help With Global
eupos 13354 May 14, 2008, 12:21 PM
Post; hot thread Re: [eupos] Help With Global
Andy 13341 May 14, 2008, 12:27 PM
Thread; hot thread Re: [eupos] Help With Global
carfac 13348 May 14, 2008, 12:27 PM
Thread; hot thread Re: [carfac] Help With Global
eupos 13297 May 14, 2008, 12:32 PM
Thread; hot thread Re: [eupos] Help With Global
carfac 13315 May 14, 2008, 12:52 PM
Thread; hot thread Re: [carfac] Help With Global
brewt 13280 May 14, 2008, 1:02 PM
Thread; hot thread Re: [brewt] Help With Global
carfac 13294 May 14, 2008, 1:04 PM
Thread; hot thread Re: [carfac] Help With Global
brewt 13323 May 14, 2008, 1:10 PM
Thread; hot thread Re: [brewt] Help With Global
carfac 13281 May 14, 2008, 1:22 PM
Thread; hot thread Re: [carfac] Help With Global
eupos 5038 May 14, 2008, 1:47 PM
Thread; hot thread Re: [eupos] Help With Global
carfac 4943 May 14, 2008, 2:39 PM
Thread; hot thread Re: [carfac] Help With Global
brewt 4997 May 14, 2008, 3:16 PM
Thread; hot thread Re: [brewt] Help With Global
carfac 4948 May 14, 2008, 3:40 PM
Thread; hot thread Re: [carfac] Help With Global
brewt 4987 May 14, 2008, 4:37 PM
Thread; hot thread Re: [brewt] Help With Global
carfac 5017 May 14, 2008, 5:21 PM
Thread; hot thread Re: [carfac] Help With Global
brewt 4970 May 14, 2008, 8:46 PM
Post; hot thread Re: [brewt] Help With Global
carfac 4952 May 14, 2008, 9:00 PM
Post; hot thread Re: [carfac] Help With Global
carfac 13300 May 14, 2008, 12:39 PM
Thread; hot thread Re: [carfac] Help With Global
carfac 13376 May 14, 2008, 11:15 AM
Post; hot thread Re: [carfac] Help With Global
carfac 13351 May 14, 2008, 11:16 AM
Post; hot thread Re: [carfac] Help With Global
brewt 13322 May 14, 2008, 11:55 AM