| | [HTML Templates] - Help/Examples/Tricks | |
|
|
| Author | Message |
|---|
Pr.Sinister Junior Member

Posts: 24 Join date: 2009-07-01 Location: Montreal, Canada
 | Subject: [HTML Templates] - Help/Examples/Tricks Tue Nov 24, 2009 3:44 am | |
| Hi Everyone, Some of you may not know this but the addition of HTML Templates is HUGE! Plenty of commercial software have the ability to generate nice reports and HTML templates but none of them offer the ease of scraping data like Media Companion and EMM do. All those commercial softwares have you enter the movies manually one by one and the ones that let you import from hard drives have you click ok for every single entry!!! Anyway... i digress... I would like to make this thread a sticky for people to come to and find nice templates and help on creating their own. So i will contribute one to get the ball rolling.... Screenshot :  Instructions : 1. Save the following code as a text file into the html_templates directory of Media Companion | Code: | <title>Movie Card</title> <<MC HTML Page>> <<header>> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> <link href="moviecard.css" rel="stylesheet" type="text/css"> <</header>> <<body>> <table align="center" border="0" width="800" bgcolor="#e0e0e0" cellspacing="10" cellpadding="5"> <tr> <td bgcolor="#ffffff"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr><td colspan="2" bgcolor="#000000" width="100%" height="1"></td></tr> <tr><td colspan="2" width="100%" height="5"></td></tr> <tr>
<!-- Cover Image Start (left) -->
<td width="160" align="center" valign="top"> <table border="0" width="150" cellspacing="0" cellpadding="0"> <tr> <td width="150"><img src="img/<<imdb_url>>.jpg" width="150"></td> </tr> </table> </td>
<!-- Cover Image End -->
<!-- Movie Details Start (right) --> <td width="610" align="left" valign="top"> <table border="0" width="100%" cellspacing="8" cellpadding="0"> <tr><td colspan="2" width="100%" bgcolor="#000000"><font color="#ffffff" class="headingfont"><b> <<title>></b></font></td></tr> <tr><td colspan="2" width="100%" bgcolor="#000000" height="1"></td></tr> <tr class="smallfont"> <td width="45%" align="left" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr><td width="30%">Year:</td><td><b><<movieyear>></b></td></tr> <tr><td width="30%">Genre:</td><td><b><<moviegenre>></b></td></tr> <tr><td width="30%">Rating:</td><td><b><<rating>></b></td></tr> </table> </td>
<td width="55%" align="left" valign="top"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr><td width="30%">Director:</td><td><b><<director>></b></td></tr> <tr><td width="30%">Writer:</td><td><b><<writer>></b></td></tr> <tr><td width="30%">Duration:</td><td><b><<runtime>></b></td></tr> </table> </td> </tr> <tr><td colspan="2" width="100%" bgcolor="#000000" height="1"></td></tr>
<tr class="bigfont"> <td colspan="2" width="100%"> <b>Description:</b><br> <<outline>> </td> </tr> </table> </td> <!-- Movie Details End -->
</tr> <tr><td colspan="2" width="100%" height="5"></td></tr> <tr><td colspan="2" bgcolor="#000000" width="100%" height="1"></td></tr> </table> </td> </tr> <</body>> <<footer>><</footer>> <</MC HTML Page>>
|
2. Save the following code as moviecard.css to a folder (eg. C:\MyMovieList)
| Code: | @charset "utf-8"; .smallfont { font-family: Arial, Helvetica, sans-serif; font-size: 14px; } .bigfont { font-family: Arial, Helvetica, sans-serif; font-size: 16px; } .headingfont { font-size: 26px; }
|
3. As you can see, i have images in here. The trick is to go to the wall view so MC generates the thumbnails and then you can go to the settings\postercache folder and copy all .jpg from there. Put them in another folder under img (eg. C:\MyMovieList\img)
4. Next, generate the list and save the HTML in the root folder where your image folder is (eg. C:\MyMovieList)
5. Open the HTML in a text editor. You are now going to do 2 find and replace.
Find all instances of :
| Code: | http://www.imdb.com/title/ |
Replace with nothing (basically delete the text)
Then, find all instances of :
Replace with :
Now hopefully this step will be obsolete once Billy adds functionality for images in the templates!
P.S. Some of you may recognize the template from the All My Movies software. Yes i pretty much copied it from there. All credit goes to the original author.
-Pr.
P.P.S I forgot to mention that i also added tags for moviegenre, director, and writer. They are not implemented yet but i fully expect they will be real soon. |
|
 | |
paybac Media Companion Supporter


Posts: 155 Join date: 2009-08-31 Location: New Zealand
 | Subject: Re: [HTML Templates] - Help/Examples/Tricks Tue Nov 24, 2009 5:38 am | |
| Thats fricking awesome sinister. |
|
 | |
StormyKnight VIP

Posts: 556 Join date: 2008-10-08 Location: Australia
 | Subject: Re: [HTML Templates] - Help/Examples/Tricks Tue Nov 24, 2009 7:47 am | |
| This really IS thinking outside the square.....
It's really what I hope for. People with the capability & interest to play with the provided tokens to create html magic!
Cheers & Thanks for posting! |
|
 | |
dbareis Senior Member


Posts: 223 Join date: 2008-12-08
 | Subject: Re: [HTML Templates] - Help/Examples/Tricks Tue Nov 24, 2009 7:49 am | |
| | paybac wrote: |
Thats fricking awesome sinister. |
It occurs to me now that we may want to have multiple sets of templates available (probably one set per subdir in template root dir) and select which one we wish to use... |
|
 | |
paybac Media Companion Supporter


Posts: 155 Join date: 2009-08-31 Location: New Zealand
 | Subject: Re: [HTML Templates] - Help/Examples/Tricks Tue Nov 24, 2009 8:06 am | |
| | StormyKnight wrote: | This really IS thinking outside the square.....
It's really what I hope for. People with the capability & interest to play with the provided tokens to create html magic!
Cheers & Thanks for posting! |
Hmmmm now if someone could just write the HTML template that sends the document to Stormy's color printing business for printing then posts it back to us  |
|
 | |
StormyKnight VIP

Posts: 556 Join date: 2008-10-08 Location: Australia
 | Subject: Re: [HTML Templates] - Help/Examples/Tricks Tue Nov 24, 2009 8:15 am | |
| .....just to add for anyone using this script..... I have about 330 movies & the search/replace is taking ages in notepad  So if you think notepad has locked up, just be patient....my speed about 1 search replace per second.... I may need a replacent for notepad unless Billy can add the extra tokens .... Cheers |
|
 | |
StormyKnight VIP

Posts: 556 Join date: 2008-10-08 Location: Australia
 | |
 | |
dbareis Senior Member


Posts: 223 Join date: 2008-12-08
 | Subject: Re: [HTML Templates] - Help/Examples/Tricks Tue Nov 24, 2009 8:34 am | |
| | StormyKnight wrote: | | I may need a replacent for notepad |
If you do want to look, I found many editors promise that they handle large files (they don't, they read the whole file into virtual memory, not "page" the file) the only one I found was "WinVI" (http://makemsi-manual.dennisbareis.com/winvi.htm). I only use it for huge files and use JEDIT for anything else except for very quick trivial changes in notepad. |
|
 | |
StormyKnight VIP

Posts: 556 Join date: 2008-10-08 Location: Australia
 | Subject: Re: [HTML Templates] - Help/Examples/Tricks Tue Nov 24, 2009 10:40 am | |
| Anyone able to shed some light on how to get this html output to print nicely without splitting the tables? I have tried adding the following to the css sheet .break { page-break-inside: avoid; } & then adding to the table class="break", plus I tried <div> & <p> too! unfortunately this doesn't work on IE, Firefox, Chrome OR Opera The only way I can see it working is if we have a tag that defines when MC adds a tag when the <<count>>div 4 = 0 for example...i.e every 4 movies add this text to the html - that text being a forced page break which does seem to work 100% in IE8, not so well in firefox...(some of the table border is printed on the wrong page) So in essence, you will get 4 movies per page in this example.... I'm open to suggestions.....html was never really designed to print nicely afterall...  |
|
 | |
ZACH New User

Posts: 4 Join date: 2008-12-08
 | |
 | |
Pr.Sinister Junior Member

Posts: 24 Join date: 2009-07-01 Location: Montreal, Canada
 | |
 | |
Pr.Sinister Junior Member

Posts: 24 Join date: 2009-07-01 Location: Montreal, Canada
 | Subject: Re: [HTML Templates] - Help/Examples/Tricks Tue Nov 24, 2009 3:44 pm | |
| | StormyKnight wrote: | Anyone able to shed some light on how to get this html output to print nicely without splitting the tables?
I have tried adding the following to the css sheet
.break { page-break-inside: avoid; }
& then adding to the table class="break", plus I tried <div> & <p> too!
unfortunately this doesn't work on IE, Firefox, Chrome OR Opera
The only way I can see it working is if we have a tag that defines when MC adds a tag when the <<count>>div 4 = 0 for example...i.e every 4 movies add this text to the html - that text being a forced page break which does seem to work 100% in IE8, not so well in firefox...(some of the table border is printed on the wrong page)
So in essence, you will get 4 movies per page in this example....
I'm open to suggestions.....html was never really designed to print nicely afterall...  |
That's weird cause when i print in FireFox v3.5.5, I get 4 Movies per page no problem. No splitting or anything... Did you add/change anything in the template (such as using fullplot instead of outline)?
I think that once the footer functionality is added, we probably will have the option of having a footer on every page instead of at the end and that may help us close the tags better.
Of course having the ability to limit the amount of movies per page and/or the amount of lines from the fullplot to display would be a great addition. |
|
 | |
Wizerd Media Companion Supporter


Posts: 125 Join date: 2008-09-22 Location: Ontario, Cananda
 | |
 | |
Wizerd Media Companion Supporter


Posts: 125 Join date: 2008-09-22 Location: Ontario, Cananda
 | Subject: Re: [HTML Templates] - Help/Examples/Tricks Tue Nov 24, 2009 4:58 pm | |
| Pr.Sinister - excellent work. This is what I was looking for (with my crude attempt at tables). With the attidion of the new tags (hint hint Billy) you could get some very detailed visual layouts. Kudos! |
|
 | |
AnthonyB Senior Member

Posts: 122 Join date: 2008-11-08 Location: Sydney, Australia
 | Subject: Re: [HTML Templates] - Help/Examples/Tricks Wed Nov 25, 2009 12:04 am | |
| Wow. This is very cool. I've been using Ant Movie Catalog for years to create a simple HTML output of my movie collection. The reasons I've stuck with it are: - It's free
- The app also uses media info.dll so it gets the data by simply dragging the file/s onto the app window
- There are scripts to scrape movie info from a massive number of sites. Most importantly for me, the IMDB is kept up to date by community so it ALWAYS works
- The HTML output templates were extremely simple to tweak with limited HTML skill to get the desired fields into the web page.
Looks like I might finally have found a replacement in MC! So fields I'd like to see implemented are: Director, Genre, Poster file name, Media Info (e.g. Video Format, Video Resolution, Audio Format, No of files, Size of file/s) plus some generic fields like <<todaydate>> (to date stamp the web page). it would also be nice if the output remembered the folder location (currently does) and file name it is outputting to to avoi dhaving to re-enter it each time. I've made some minor tweaks to Pr.Sinister's template (made all poster images and movie titles clicky link to relevant IMDB entry, Added page header with link back to MC, added total movie count) which can be seen on-line here - http://anthonyb.dyndns.org/movielist/index.htm The template and .CSS file are zipped and here if anyone wants to download - http://anthonyb.dyndns.org/rich_template.zip |
|
 | |
| | [HTML Templates] - Help/Examples/Tricks | |
|