Printing Template with link info (DVDpedia)

Any trouble you encounter with the Pedias, here's the place to ask for help.
Post Reply
tailwheel
Contributor
Contributor
Posts: 6
Joined: Tue Mar 16, 2010 5:20 pm

Printing Template with link info (DVDpedia)

Post by tailwheel »

I'm modifying a Printing Template (PrintingSmallCovers duplicated as PrintingMySmallCovers) to include information about linked files for each movie. Here's my current code:

Code: Select all

<!--BeginRepeat-->
<div class="movie">

<img  src="[key:localCoverImageURL]" border="0"  class="image" />
<div class="movieTitle">[key:title]</div>
<div class="director">[key:director]</div>
<!--IFlinks
[linksBegin]
<div class="director">[link:name]</div>
[linksEnd]
ENDlinks-->

</div>  <!-- Movie -->
I can't seem to produce any output about the links. In my code, I piggy-back on the "director" class for formatting. During my testing, I've inserted characters to determine how the code is being interpreted and it appears that I can't get into the "IFlinks" block of code.

As far as I can tell, the Links tags (http://bruji.com/howto/creating_templat ... html#links) should work with printing templates in DVDpedia.

Anyone know what the heck I'm doing wrong?

Thanks.
User avatar
Conor
Top Dog
Posts: 5346
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Printing Template with link info (DVDpedia)

Post by Conor »

Your links are must likely local links (to files on your drive) that are not included during the whole export process (that the printing relies on). To include local links add the following to the top of your template:

Code: Select all

<meta name="includeLocalLinks" content="yes" />
You can find more info about template meta setting on a companion page to the tags page. If they are still not being exported after that change let us know.
tailwheel
Contributor
Contributor
Posts: 6
Joined: Tue Mar 16, 2010 5:20 pm

Re: Printing Template with link info (DVDpedia)

Post by tailwheel »

Yep, my files are stored on a couple of local servers. I tried the changes you suggested without realizing the full impact of what you said. That is that copies of the linked files were being created (after waiting for quite a while for the template to print).

My goal in creating a new printing template is a printed list of files contained within a collection, with some indication as to which ones have links to video files, and which ones don't.

Maybe there's a better way to deal with this and I'm barking up the wrong tree... Any further ideas?

Thanks
User avatar
Conor
Top Dog
Posts: 5346
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Printing Template with link info (DVDpedia)

Post by Conor »

I forgot to mention the copy, as that command is meant to be used for export templates it creates the folder with the files for upload as well. The printing function does delete the entire temp folder after it's done, but that would mean a very long time to wait and a lot of information copied and deleted, depending on the size of your collection. If your only interested in knowing if a DVD has a movie file linked you can use the following key.

Code: Select all

[key:hasMovieLink]
This will print out the word "Yes" for all the movies that have at least one movie link. This is actually not listed on our possible tags page since it is an internal value that DVDpedia uses to cache that information in order not to have to process the possible type of links when display that the QuickTime icon in the status column.

Hope this information is helpful.
tailwheel
Contributor
Contributor
Posts: 6
Joined: Tue Mar 16, 2010 5:20 pm

Re: Printing Template with link info (DVDpedia)

Post by tailwheel »

That solves my problem. Here's the code I modified within the "PrintingSmallCovers" template:

Code: Select all

<!--BeginRepeat-->
<div class="movie">
<img  src="[key:localCoverImageURL]" border="0"  class="image" />
<div class="movieTitle">[key:title]</div>
<div class="director">[key:director]</div>

<div class="director">
<script type="text/javascript">if ("[key:hasMovieLink]"=="Yes") { document.write("••••••••••"); }</script>
</div>

</div>  <!-- Movie -->
<!--EndRepeat-->
Thanks!
User avatar
Conor
Top Dog
Posts: 5346
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Printing Template with link info (DVDpedia)

Post by Conor »

Thank you for sharing the JavaScript, I am sure it will be copied and pasted often as users are always looking to do that with other fields.

Code: Select all

<script type="text/javascript">
var director = "[key:director]";
if (director=="Michael Bay") { document.write('<img src="imageOfExplosion.png">'); }
if (director=="Nora Ephron") { document.write('<img src="imageOfBabyChicken.png">'); }
</script>
Post Reply