Author Topic: Export templates: variable for filename chosen in filter dialog  (Read 4540 times)

0 Members and 1 Guest are viewing this topic.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
A feature request for export template development (http://www.videodb.info/help/hlp_export.html)...

When developing export templates, in %OPTIONS% section there seems to be no way to access the filename that was chosen by the user in the "save as" dialog. It would be neat to have the filename without extension for additional processing:

As it is now, all static files (stylesheets, background images, etc.) may be copied to a subfolder (which can go by a name like "HTML-files" or whatever). The subfolder would be created along with the exported file. I'd like the name of this folder to depend on the name of the exported file. So what I want to do: If the user chooses "peter's database.html" as export filename, I'd like to copy all static files to a subfolder called "peter's database_files". Hence it would be obvious that both belong together. In addition to that, Windows would automatically link files and folders named that way and treat them as a pair:
http://paulelso.wordpress.com/2006/09/20/xp-folder-option-managing-pairs-of-web-pages-and-folders/

Maybe you can add a new variable for the %OPTIONS% section providing the users chosen filename without extension and perhaps, just in case, also a second one providing the full filename (or the extension alone)?

If %fname% would be the variable for the filename without extension, something like this shall work:
Code: [Select]
filter="HTML Files|*.html;*.htm"
copyfile="template\style.css<->"%fname%_files\style.css"
imagepath="%fname%_files\images\"

Would be really great.
And by the way, thanks a lot for all your efforts, of course!!

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export templates: variable for filename chosen in filter dialog
« Reply #1 on: June 13, 2010, 10:12:47 pm »
Added to TODO list
Gentlemen, you can’t fight in here! This is the War Room!

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export templates: variable for filename chosen in filter dialog
« Reply #2 on: August 17, 2010, 12:05:17 pm »
Great, I just saw that it made its way into the newest version of the export plugin!  :)

It works well with copyfile, but when used with recordfilename and imagepath no records or images are exported...  :'(
recordfilename="%fname%_files\movie%id%.html"
imagepath="%fname%_files\images\"

And I just didn't consider until now: I will need another thing to be able to use it properly...
I need to have access to %fname% outside the %OPTIONS%-part of the template, too. I need it for links to subpages and to be able to include the stylesheets, for example. Something like this:
<link rel="stylesheet" type="text/css" href="./{%value=fname}_files/css/main.css">

Would that be possible? Thanks in advance, of course!!
« Last Edit: August 17, 2010, 12:13:15 pm by svenne »

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export templates: variable for filename chosen in filter dialog
« Reply #3 on: August 17, 2010, 01:02:12 pm »
Quote
recordfilename="%fname%_files\movie%id%.html"

It is not support for recordfilename

Quote
imagepath="%fname%_files\images\"

Should work actually, but I will recheck it

Quote
And I just didn't consider until now: I will need another thing to be able to use it properly...
I need to have access to %fname% outside the %OPTIONS%-part of the template, too. I need it for links to subpages and to be able to include the stylesheets, for example. Something like this:
<link rel="stylesheet" type="text/css" href="./{%value=fname}_files/css/main.css">

Would that be possible? Thanks in advance, of course!!

No problem
Gentlemen, you can’t fight in here! This is the War Room!

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export templates: variable for filename chosen in filter dialog
« Reply #4 on: August 17, 2010, 01:30:45 pm »
Ok, just checked it... it works fine with imagepath!! Sorry...
It didn't work if used with both imagepath and recordfilename, but the problem was solely the use in recordfilename...

I just saw you didn't add %fname% to recordfilename but recordtemplate. I can't imagine any use in recordtemplate, because the path in recordtemplate is the source path in the Plugins\Templates folder of PVD and that can never be dependend on the filename chosen in the "save as" dialogue. Am I wrong?
Would be great to have that in recordfilename to be able to store all exported files in the subfolder "%fname%_files".
« Last Edit: August 17, 2010, 04:33:04 pm by svenne »

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export templates: variable for filename chosen in filter dialog
« Reply #5 on: August 19, 2010, 11:05:12 pm »
Done.

Now you can use %fname% and %fext% in recordfilename as well and you have special values
Code: [Select]
FileName {%value=233}
File Extension {%value=234}
Gentlemen, you can’t fight in here! This is the War Room!

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export templates: variable for filename chosen in filter dialog
« Reply #6 on: August 21, 2010, 01:05:50 pm »
Just perfect!  :D  Thanks!

I modified my export templates now...

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export templates: variable for filename chosen in filter dialog
« Reply #7 on: August 21, 2010, 03:02:54 pm »
You are welcome. Thx for the great templates ;)
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export templates: variable for filename chosen in filter dialog
« Reply #8 on: August 22, 2010, 01:56:24 am »
Quote
Thx for the great templates.

They are nice, aren't they? I think you should add a "Print" item to the File menu that simply calls HTML Print Layout. That will be the answer to any tree-killer who asks for a print capability. 8)

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export templates: variable for filename chosen in filter dialog
« Reply #9 on: August 22, 2010, 02:31:45 am »
You know what, why not. Maybe I will do this in 1.0 :)
Gentlemen, you can’t fight in here! This is the War Room!

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export templates: variable for filename chosen in filter dialog
« Reply #10 on: August 22, 2010, 07:29:54 pm »
That you like 'em that much truly feels good...  :-*

Maybe it would be strange if you click on "print" in PVD and a "save as..." dialogue opens up instead of a printer dialogue...
So if you decide to add a print item that calls my export template (would be kind of a great honour to me, of course ;)), you might want to override the "save as..." dialogue and just export the file to temporary files instead... after clicking "print" the page would pop up in the user's default browser. I added a "Print" button to the exported page to make things more obvious.

By the way, and completely apart from this, I almost can't await PVD version 1. I'm sure it's quite a lot of work, though...
« Last Edit: August 22, 2010, 07:31:45 pm by svenne »

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export templates: variable for filename chosen in filter dialog
« Reply #11 on: August 22, 2010, 07:33:45 pm »
Yes, I would need a special handling for your templates :)

Quote
By the way, and completely apart from this, I almost can't await PVD version 1. I'm sure it's quite a lot of work, though...

I hope it will be great. Unfortunately the work is not going too fast because of the lack of time :/
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export templates: variable for filename chosen in filter dialog
« Reply #12 on: August 22, 2010, 08:55:45 pm »
Quote
Yes, I would need a special handling for your templates

What have I started? :-X

I suggest the template configuration include a "Use as default print template" button. And yes, using the "Print" command should bypass the "save as" dialog and use a temporary location. The same template could still be used from the Export menu if one wants to print and save the report.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export templates: variable for filename chosen in filter dialog
« Reply #13 on: August 22, 2010, 11:18:54 pm »
Quote
What have I started? Lips sealed

As always :)
Gentlemen, you can’t fight in here! This is the War Room!