INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Displaying lists in track info field  (Read 1875 times)

Marra

  • Regular Member
  • World Citizen
  • ***
  • Posts: 160
Displaying lists in track info field
« on: March 06, 2006, 12:33:21 pm »

I have created several custom fields - list (semicolon delimited) and would like to display them as a list rather than a single line of text

-  XXXXX
-  XXXXX
-  XXXXX

rather than XXXXX;XXXXX;XXXXX;

Is there a way to do this? TIA
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: Displaying lists in track info field
« Reply #1 on: March 06, 2006, 01:02:09 pm »

well you can go to action window for a large data field

and input

xxxxx
xxxxx
xxxxx
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

Marra

  • Regular Member
  • World Citizen
  • ***
  • Posts: 160
Re: Displaying lists in track info field
« Reply #2 on: March 06, 2006, 08:05:33 pm »

King,

Sorry if I misled you.  I have the data already (thanks to atagger RIP!) but would like to display it as a list in a track info page that I'm looking at developing.

Any ideas?  TIA
Logged

PollyQ

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 65
Re: Displaying lists in track info field
« Reply #3 on: March 07, 2006, 03:46:18 pm »

If you just want to replace the semicolons with line breaks, you can use this:

Code: [Select]
<script>document.write("TrackInfo_Insert(Keywords)".replace(/;/g,"<br>"));</script>
If you'd like a nicely formatted HTML list, you can do something like this:

Code: [Select]
<html><head>

<script type="text/javascript" language="javascript">
function Semi2List(sWithSemis) {
if (sWithSemis.length == 0) {
return "";
} else {
// Strip extra semicolons from end of string
var reTrimSemis = new RegExp("([^;]*);*$")
sTrimmed = sWithSemis.replace(reTrimSemis,"$1");

// Convert semicolons to list tags
var sWithLIs = "<ul><li>"+sTrimmed.replace(/;/g,"</li><li>");+"</li></ul>"

return sWithLIs;
}
}
</script>

</head>
<body>

<p><script>document.write(Semi2List("TrackInfo_Insert(Keywords)"));</script></p>

</head></html>

Hope this helps!  8)
Logged

Marra

  • Regular Member
  • World Citizen
  • ***
  • Posts: 160
Re: Displaying lists in track info field
« Reply #4 on: March 07, 2006, 10:40:22 pm »

Thanks again PollyQ for your help.
Logged
Pages: [1]   Go Up