English > Scripts and Templates
Export template: HTML List (English + German)
afrocuban:
Hello and thank you for this great template.
I don't know anything about Javascript, so I'm kindly asking you to explain to me where should I put, and which piece of code, in order to get "pvdid. Title" output in movie list in the left frame. I'd like to get the same for the chosen movie name in right frame.
I see <span class="pvdid"> (ID: {%value=num})</span> in "HTML Frames (English).ptm", but nowhere in the exported pages.
Thank you in advance!
svenne:
Hi!
I only had the IDs implemented to keep references/links vivid (those links that can be generated within PVD in description or other fields and set to point to other movies in the list: right mouse-click on the part of the text you want to become a link and choose "Create Hyperlink").
The exported IDs are hidden via CSS.
If you want to see them edit
\HTML Frames\main.css
Search für pvdid (it only occurs once in line 158)
delete #list ul li a span.pvdid, within that line.
To put the ID in front of the title edit
HTML Frames (English).ptm
Find the long line starting with %HEAD% (should be line 51).
Find <span class="pvdid"> (ID: {%value=num})</span> and put that in front of <span class="mtitle"> within the same line. It should read now
...target="movie"><span class="pvdid"> (ID: {%value=num})</span><span class="mtitle">{%value=title}...
Feel free to change the ID portion as you like, perhaps
<span class="pvdid">No {%value=num} - </span>
or
<span class="pvdid">{%value=num}. </span>
Count the characters in front of {%value=num}. Originally there were 6 (including spaces: " (ID: "). To keep references/links working, edit
\HTML Frames\frame.js
and change line 68:
--- Code: ---if (sl[i].firstChild && sl[i].className == "pvdid" && sl[i].firstChild.data.substring(6,(6+sx.length))==sx)
--- End code ---
As you see there is number 6 twice. Correct both. If you don't have any characters in front of {%value=num}, than it should be 0 here, of course:
--- Code: ---if (sl[i].firstChild && sl[i].className == "pvdid" && sl[i].firstChild.data.substring(0,(0+sx.length))==sx)
--- End code ---
Don't add {%value=num} to <h1 id="mtitle">...</h1> in file
\HTML Frames\movieiframe.ptm
It would break the javascript search function and certain filters.
You might add <h2 id="pvdid">{%value=num}</h2> to that line so it looks like...
--- Code: --- <h2 id="pvdid">{%value=num}</h2><h1 id="mtitle">{%value=title}</h1>{#StringReplace '{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=origtitle}' '</p>'}' '
<h2>Original Title</h2><p id="otitle">'}' '
<h2>Original Title</h2><p id="otitle">{%value=title}</p>' ''}
--- End code ---
Add the following code to \HTML Frames\frame.css and the ID will be inline and formatted the right way:
--- Code: ---#pvdid
{
float:left;
padding-right:0.5em;
margin:0px 0px 0.4em 0px;
padding:0px 0.5em 0px 0px;
font-size:1em;
}
#pvdid:after
{content:"";}
--- End code ---
afrocuban:
Dear svenne,
Thank you so much! This was best ever guide for dummies. I did it at first following your tips and it was exactly, exactly, exactly I was looking for. Thank you once again.
Now, I wouldn't want this to become a Javascript training course, but I did my best, using logic of course, to change movieiframe.ptm to change the order of fields that suits me best, but had no luck. I have succeeded with moving actors by simply cutting/pasting the line, but not with other fields.
May I kindly ask you (how) to arrange the code so I could achive this order of fields:
year, director, genre, imdb rating, orating, rating, duration, actors, description, comments, writers, composers, producers, filesize, video, audio, subtitles, category, tags
I promise, I won't bother you anymore after this. Thank you so much in advance.
svenne:
You may bother me whenever you want.
Just a short anwer for the time being. I can give more detailed code snippets later this week.
But perhaps this is already sufficient.
This is not JavaScript. It consists of PVD's own functions, see help section:
http://www.videodb.info/help/hlp_export.html
In movieiframe.ptm there are two kinds of code sections, one is very simple and looks like this:
--- Code: --- <h2>Country</h2><p id="country">{%value=country}</p>
--- End code ---
It starts with a newline.
It will always show up in the exported file, even if the country field in PVD is empty. In the latter case the exported source code will look like this:
--- Code: --- <h2>Country</h2><p id="country"></p>
--- End code ---
The other kind looks like this:
--- Code: ---{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=writers}' '</p>'}' '
<h2>Writer</h2><p id="writers">'}
--- End code ---
This code snippet always starts without newline with {#ConditionAddFirst... and ends with ...} in the following line (also without newline at the end).
It is used to omit fields completely if they are empty. The corresponding HTML tags are only written to the exported file (with ConditionAddFirst and ConditionAdd) if {%value=writers} is not empty. It looks more complicated than it is. The newline before <h2> is part of the statement, it is in quotation marks. See last character in the preceding line. This newline is within the ConditionAdd statement.
afrocuban:
Dear svenne,
As usual, great guide! Thank you so much and keep up good working.
I was just wondering ow is it possible to add custom fields to your template (namely, Rottentomatoes rating(s) and links to IMDb, AllMovie and Rottentomatoes), but it is a SF to me at the moment, so I'm asking Lastdino to upload his template so we could further customize it, if svenne has nothing against it of course.
This is for my family and friends who doesn't want to install PVD to see my collection, so once again many thanks to svenne.
Kind regards,
afrocuban
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version