Welcome to the Invelos forums. Please read the forum rules before posting.

Read access to our public forums is open to everyone. To post messages, a free registration is required.

If you have an Invelos account, sign in to post.

    Invelos Forums->DVD Profiler: Layouts and Reports Page: 1  Previous   Next
Displaying tag name in HTML window?
Author Message
DVD Profiler Unlimited RegistrantStar ContributorSpikeX
Still thinking...
Registered: April 10, 2007
United Kingdom Posts: 51
Posted:
PM this userDirect link to this postReply with quote
Hi,

Is it possible to display a tag name, if it is checked, in a HTML window?

I have sorted my DVD's into sections, say S1, S2, S3. I also have three tags S1, S2, S3. Depending on where the DVD is located, one of the tags will be checked. Is there a way to display that this tag has been checked.

I only want one of these three to be displayed. For example, if I had another tag TO WATCH which is also checked, I would not want this displayed in the window.

Any help on this would be greatly appreciatied. I'm not sure if it's a mammoth task or not 

Thanks, Spike
DVD Profiler Unlimited RegistrantStar ContributorTomGaines
Registered Sept. 24, 2001
Registered: March 13, 2007
Reputation: High Rating
Germany Posts: 2,005
Posted:
PM this userEmail this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote
Something like this should do the trick:

Quote:

<HTML>
<HEAD>

<SCRIPT TYPE="text/javascript">
<!--
<DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False">
//-->
</SCRIPT>

</HEAD>
<BODY>
<SCRIPT TYPE="text/javascript">
for (x in DP_Tags) {
var tag=DP_Tags[x];
if (tag=="S1" || tag=="S2" || tag=="S3") document.write(tag);
}
</SCRIPT>

</BODY>
</HTML>



 Last edited: by TomGaines
DVD Profiler Unlimited RegistrantStar ContributorSpikeX
Still thinking...
Registered: April 10, 2007
United Kingdom Posts: 51
Posted:
PM this userDirect link to this postReply with quote
It works. Thank you! 
DVD Profiler Desktop and Mobile RegistrantMarEll
Registered: June 9, 2007
United Kingdom Posts: 1,208
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
That's great Tom, but is there any way of inserting a comma and space between each displayed tag?
DVD Profiler Unlimited RegistrantFredLooks
phpDVDProfilerDude D5/7/2
Registered: March 13, 2007
Canada Posts: 350
Posted:
PM this userEmail this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote
where it says "document.write(tag);" change it to "document.write(tag+', ');"

and yes, that will leave a trailing comma space after the last tag.
-fred
 Last edited: by FredLooks
DVD Profiler Desktop and Mobile RegistrantMarEll
Registered: June 9, 2007
United Kingdom Posts: 1,208
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Of course, can't believe that didn't occur to me 

Cheers Fred.
DVD Profiler Unlimited RegistrantStar ContributorSpikeX
Still thinking...
Registered: April 10, 2007
United Kingdom Posts: 51
Posted:
PM this userDirect link to this postReply with quote
What if S1, S2 and S3 are child tags of Location?

Is this still possible?

Thanks
DVD Profiler Unlimited RegistrantStar ContributorTomGaines
Registered Sept. 24, 2001
Registered: March 13, 2007
Reputation: High Rating
Germany Posts: 2,005
Posted:
PM this userEmail this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote
Quoting SpikeX:
Quote:
What if S1, S2 and S3 are child tags of Location?

Is this still possible?

Thanks


Change it to

if (tag=="Location/S1" || tag=="Location/S2" || tag=="Location/S3") document.write(tag);


or better

if (tag.match("Location/") document.write(tag);


 Last edited: by TomGaines
DVD Profiler Desktop and Mobile RegistrantMarEll
Registered: June 9, 2007
United Kingdom Posts: 1,208
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Quoting TomGaines:
Quote:
[...]
or better

if (tag.match("Location/") document.write(tag);


I had to add in another ) to get that to work Tom.
if (tag.match("Location/")) document.write(tag);

Great work though, certainly is easier than specifiying each tag.  I have a question though, is it possible to prevent the parent tag being displayed with every child tag?
 Last edited: by MarEll
DVD Profiler Unlimited RegistrantStar ContributorTomGaines
Registered Sept. 24, 2001
Registered: March 13, 2007
Reputation: High Rating
Germany Posts: 2,005
Posted:
PM this userEmail this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote
Quoting MarEll:
Quote:
I have a question though, is it possible to prevent the parent tag being displayed with every child tag?


Somthing like this should do the trick:

if (tag.match("Contributions/")) document.write(tag.substring(tag.lastIndexOf("/")+1));


DVD Profiler Desktop and Mobile RegistrantMarEll
Registered: June 9, 2007
United Kingdom Posts: 1,208
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Awesome.  Cheers again Tom 
DVD Profiler Unlimited RegistrantStar ContributorSpikeX
Still thinking...
Registered: April 10, 2007
United Kingdom Posts: 51
Posted:
PM this userDirect link to this postReply with quote
Thank you again! 
DVD Profiler Desktop and Mobile Registrantjuanlaviana
Registered: January 5, 2009
Spain Posts: 6
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
i, I'm trying to make a layout that shows awards icons/images. I have award tags,... but, I don't know how to make a script that connect images and tags

any suggestions?

Thanks
DVD Profiler Unlimited RegistrantStar Contributorhydr0x
Registered: April 4, 2007
Germany Posts: 884
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Quoting TomGaines:
Quote:
Quoting MarEll:
Quote:
I have a question though, is it possible to prevent the parent tag being displayed with every child tag?


Somthing like this should do the trick:

if (tag.match("Contributions/")) document.write(tag.substring(tag.lastIndexOf("/")+1));


Tom, your post is basically the only mention I find of DP_Tags. Is there a complete list of the header vars somewhere, or can it maybe be generated within DVDP?

Edit: AH, found it! It's in the generated HTML.
- Jan
 Last edited: by hydr0x
    Invelos Forums->DVD Profiler: Layouts and Reports Page: 1  Previous   Next