Author Topic: Export template: HTML List (English + German)  (Read 187337 times)

0 Members and 1 Guest are viewing this topic.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Quote
Something different: Within the template, in %OPTIONS%-area: is it possible to get the filename that was chosen by the user in the filter dialog, with and without extension? Something like %filename%?

Not that I'm aware of. I assumed there would be an HTML variable for getting the filename of a page, but maybe that's a bit strange.  ::)

Quote
I tried a different approach now to provide full control over the title apart from the filename...

Yes, that's a better idea.
« Last Edit: June 06, 2010, 10:46:42 pm by rick.ca »

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Nostra implemented some special values you can use within the rest of the template (outside of the %OPTIONS% part), documented here (if anyone wonders): http://www.videodb.info/help/hlp_export.html
There are
{%value="206"} - Path to the first page (HTML)
{%value="207"} - Path to the index file for the current record (HTML)
{%value="215"} - Path to the current record's file (HTML)
{%value="220"} - Path to the index file for the current record
just to name a few. And there are functions to extract a filename (without path) from these values or its extension, and in combination with StringReplace you can have the filename without its extension. So your suggestion to take the filename (without extension) as headline would not be that difficult to achieve.
But I was thinking of something else already: If the user decides to name the exported file "statlersmoviecollection.html" it would be nice to name the subdirectory containing all the accompanying files (like CSS stylesheets and poster images) "statlersmoviecollection_files" instead of "htmlprintfiles". Not only that the user would immediately see that both file and folder belong together, Windows also would recognize this and treat them as if they were glued together. For example, if you moved the html file to a different location, the subdirectory would automatically move too, etc.
« Last Edit: June 07, 2010, 12:39:35 am by svenne »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Quote
So your suggestion to take the filename (without extension) as headline would not be that difficult to achieve.

I still like what you've done better, but I suppose it would be cool if the filename was used as the default heading. It would also go nicely with your idea of linking the subdirectory. If one does want to copy or move the files, that will obviously make them easy to identify, and that operation less error-prone.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
I made the database filename the default heading, so if you (in PVD) go to File->Save as and save your database as "Rick's Movies.PVD", all export templates I wrote would use "Rick's Movies" as default heading... bad idea?

Quote
idea of linking the subdirectory
I will post a feature request, perhaps Nostra will find the time to add a variable handing over the filename from the "save"-dialog in the %OPTIONS% section.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Quote
all export templates I wrote would use "Rick's Movies" as default heading... bad idea?

I think it's a good idea—as long as you're retaining the editable "headline." In other words, it will default to the filename, but can still be changed in the browser.

Quote
I will post a feature request, perhaps Nostra will find the time to add a variable handing over the filename from the "save"-dialog in the %OPTIONS% section.

OIC. I guess you can't use the filename after-the-fact to create the directory. :-\

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Quote
I guess you can't use the filename after-the-fact to create the directory.
Yes. I will change that as soon as Nostra has implemented the variables necessary.

I managed to add support for hyperlink types "Title" and "Original Title" now (to templates "HTML Frames" and "HTML List"). So supported hyperlink types now are "ID" (= mid = "Database Record ID", see here!), "URL", "Title" and "Original Title".
« Last Edit: July 11, 2010, 04:33:31 pm by svenne »

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
I added a new feature to the "HTML Frames" template:
You can choose now wether you want to see all exported entries or only the newest ones. If you export your database to share it with friends: now it is easier for them to keep track of new additions, even if you export your whole database.
« Last Edit: July 25, 2010, 11:52:39 am by svenne »

Offline wannytje

  • Member
  • *
  • Posts: 2
    • View Profile
Hi,

I'm new at this.

I would like to print out a list (summary) of all the childeren DVD's (I assigned a category "kids" to those movies).  I would like to print the poster too, as my children can not read yet.

How do I go about to do this?  The HTML-stuff looks a bit complicated....

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Ok, that should be an easy task, but if anything stays unclear, feel free to ask...
So here we go:

1) Do a search for "kids" in "Category":

In Personal Video Database click on the button next to "Search" that says "Title + Original Title + Aka" and change it to "Category" (it is somewhwere in the lower part of the long, long list you will see).

Enter your search term ("kids") into the "Search:"-field

All movies that do not fit the search term will be invisible now. (You can undo/reset your search later by clicking onto the curled green arrow next to the search field)

2) After doing the search, choose "HTML print layout" from the "Export"-menu... and you're (almost) done.

3) Just in case: If you want to have bigger posters, edit the file "main.css" (in subfolder htmlprintfiles\css\ in the folder you exported to) with Notepad. You will see the following code quite at the top of this file:

Code: [Select]
div.poster
{
  max-width:170pt;
  float:right;
  clear:both;
  padding:0.3em;
  margin:1em;
  border:1px dotted black;
}

Change "max-width:170pt;" to "max-width:250pt;", save main.css and reload the exported HTML-file in your browser: now posters should be almost half the page wide (if the original poster images are big enough, cause small images won't be enlarged)...

4) Print the exported list with your browser's print feature.
« Last Edit: July 25, 2010, 12:14:33 pm by svenne »

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
And something was wrong with the ZIP-Archive containing the HTML print layout template. Stylesheets were missing...  :-[

So these are the newest and complete versions:
« Last Edit: August 17, 2010, 03:53:00 am by svenne »

Offline Sefdik

  • Member
  • *
  • Posts: 7
  • Those were the days ...
    • View Profile
empty.html does not display correctly
« Reply #50 on: August 07, 2010, 11:18:09 am »
Ah but ..... next problem.
Should this be a new post or a bug post?  ???

I am learning, I am using the HTML Frames (English) that came with PVD.  I have modified this and have found /plugins/templates/frames movieframe.ptm and empty.html and modified them to suit my purposes.

However empty.html does not display correctly.   It works OK the first time but subsequent modifications are NOT reflected.   If I delete the empty.html from the destination directory it works OK again.

So it would appear that if there is an existing empty.html in the destination directory then it DOES NOT get overwritten.

Any ideas ....

Seth, Burgundy France (where it is still not raining but not as hot as Moscow).
« Last Edit: August 07, 2010, 08:10:31 pm by rick.ca »
/0^0\ - The failures of humanity are those who were too proud or too shy to admit that they did not know - so nobody told them!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #51 on: August 07, 2010, 08:21:13 pm »
Svenne is the author of these templates. I've moved your post to his support topic.

Quote
If I delete the empty.html from the destination directory it works OK again.

I don't know why the old file would not be overwritten, but why don't you just do this? More generally, I would think clearing the destination folder or using a new one would be a prudent thing to do after making any changes to a template.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #52 on: August 08, 2010, 11:18:16 am »
Hi Seth, hi Rick, I'm unsure if it's a feature or a bug... ;-) Existing files in destination folder are not overwritten when copied via template (copyfile="source<->target"). This is not only the case with my template, but with templates in general. It may be intended to prevent accidental overwrites. In contrast, exported images and exported movie pages are overwritten (after prompting for confirmation to overwrite the main/index file). I'd guess it's a (minor) bug...
So if you modify a template and want to test it, you should always empty the destination folder first.

Perhaps we should tell Nostra. I'd guess that he can change that behaviour with little effort.
« Last Edit: August 08, 2010, 11:20:11 am by svenne »

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export template: HTML List (English + German)
« Reply #53 on: August 08, 2010, 11:35:34 am »
Yes, it is a minor bug. I will fix it in the next plugin update.
Gentlemen, you can’t fight in here! This is the War Room!

Offline Sefdik

  • Member
  • *
  • Posts: 7
  • Those were the days ...
    • View Profile
Re: Export template: HTML List (English + German)
« Reply #54 on: August 16, 2010, 01:46:51 pm »
To me it seems inconsistent, I want to export my data, I have modified it, add, deleted or changed records and I have modified the templates, therefore I want it to use the new template.

It's no real hassle having to delete the empty.html first but it is inconsistent.

Maybe Nostra can give us a choice.   If I knew how to modify (copyfile="source<->target") or whatever to effect an overwrite, I could do it myself.

Seth, Burgundy France (where at Long last it is raining and has been for 2 days).
/0^0\ - The failures of humanity are those who were too proud or too shy to admit that they did not know - so nobody told them!

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export template: HTML List (English + German)
« Reply #55 on: August 16, 2010, 07:18:51 pm »
The new version of the plugin should overwrite existing files using copyfile option.
Gentlemen, you can’t fight in here! This is the War Room!

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export templates: HTML List/Frames (English + German) + Print Layout
« Reply #56 on: August 17, 2010, 03:51:55 am »
Just fetched the latest updates (in PVD: "Help" -> "Check for updates") and it's fine now. I surely appreciate the fix, thanks!

New versions of my export templates... For all those who tend to collect their favourite soap operas...  ;)
- episodes will be taken into account by all three templates now. Episodes will be listed below the description field of the corresponding main entry...

Some minor changes:
- the quality field will only be shown if it is not empty (same with some other fields)
- internal links will only be active if the movie entry they point to was not excluded from export. This was not the case for link type "ID" (= mid = "Database Record ID") until now
- there are some other tiny changes/bugfixes, but i can't remember what they were actually... ::)
« Last Edit: August 21, 2010, 12:30:58 pm by svenne »

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export templates: HTML List/Frames (English + German) + Print Layout
« Reply #57 on: August 21, 2010, 12:58:55 pm »
I modified the templates again, taking advantage of a new feature Nostra implemented...

If export templates don't generate a single file but multiple files instead (several html pages + stylesheet files + images, etc.), these files now can be stored in a folder named similar to the main file.

An example:
if you advise the "HTML Frames" template to export your database to a file named mymovies.html, now all additional files that are generated during the process will be stored in a folder named mymovies_files. Hence it will be more obvious which folder belongs to a corresponding html file, especially if you do several different exports (like different selections, your movie list altered by filters, or whatever). Windows users will also benefit from this feature ("pairs of web pages and folders"):
http://paulelso.wordpress.com/2006/09/20/xp-folder-option-managing-pairs-of-web-pages-and-folders/
« Last Edit: August 22, 2010, 06:59:29 pm by svenne »

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export templates: HTML List/Frames (English + German) + Print Layout
« Reply #58 on: August 22, 2010, 06:59:13 pm »
- added a little bit more details for audio streams
- added "Subtitles" field (will only show up if not empty)
- added a "Print" button (to HTML Print Layout)
- did some minor tweaks
« Last Edit: September 26, 2010, 01:08:45 pm by svenne »

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export templates: HTML List/Frames (English + German) + Print Layout
« Reply #59 on: September 25, 2010, 01:37:59 am »
There is a minor problem when using the template functions replace/#StringReplace to replace quotation marks (' or "): When there is a PVD-link in the exported field things get messed up. Since I excluded empty fields from export with the aid of some nested #StringReplace and #ConditionAdd commands, this became an issue here for fields that contain PVD-links. For sure it's a bug in PVD, but it's complicated to explain how and when these heavily nested commands trigger it and I'm sure it's complicated to solve... and that would be for the benefit of maybe only one or two people (already including me)...  ;)
Since removing this bug (that most likely no other one would ever stumble upon while developing templates) would surely delay release of PVD 1.0 I won't mention this never ever again... ;)
So I reconsidered my strategy and added some simple javascript to get a workaround... and it works. Fields with links are exported nicely and empty fields are not displayed. Here are the new versions of my templates...
« Last Edit: November 15, 2010, 09:19:39 pm by svenne »

 

anything