Templates for Exporting

Does anyone know how to modify, or replace, the built-in templates that are provided when using the option to export a selection of entries as a Website? There doesn’t seem to be anything relevant in the Templates.noindex folder. Any help would be appreciated.
Thanks

That’s not yet possible without patching the website export plugin but we will add a possibility.

Thanks Christian - I use it a lot so it would be great to have that flexibility. At the moment I have to post-process the html after each export.

Over here in DTPO PB8 export as website does nothing except create the equivalent of export > files and folders. Regardless of template chosen. No index.html, no nothing that can be used as a “web site”.

Hi Korm - you are right, almost, - rtf files are converted to html in the process but otherwise it will look like a Files & Folders export. An extra step is needed to get an index.html and therefore a workable website. I have to select the files to be included in the website and then run the script Create Index for Select Items. This creates an index.rtf file that contain WikiLinks to the files that I selected. Export as Website then translates this to an index.html file that is hyperlinked to the others that were selected and exported. It is a workable but inflexible solution.

Hi – thanks for this information. Where would I find the script “Create Index for Select Items”? I have not found anything alike in my installation of DTPO, but it may just be that’s because I have a German language environment…

On the other hand, you may have written the script yourself – in which case my question is whether you would kindly share it?

Best wishes,

Andreas

Hmmm, it was in the DEVONacademy, but I see that the links there to access the scripts are greyed out. Perhaps shoot a note to Support and they can sort this out for you. (I hesitate to post official DTech scripts if DTech itself is not publishing them.)

The original script was posted here: viewtopic.php?f=20&t=2550

Many thanks! It works brilliantly! This is of great help to me. Now I can export relevant parts of my DTPO database (which at 3.9 GB and 22.6 mio words is substantial – I have been building it up for five years) and give the stuff to my collaborators.

A last wish: any possibility to put the date before or after the link on the index page? That would make orientation much easier for me as I will be mainly using this to create little policy histories of specific topics…

Thanks again!

Andreas

Well, that seems so easy even I could do it :wink:

So I now have a date – and the next question: how do I format the date? It spits out the day, the date with month name and the time. All I really need is the numerical date…

Last question, I promise :wink:

Best wishes,

Andreas

Currently the system-wide formats for dates/times are used, e.g. over here DD.MM.YYYY HH:MM:SS.

See System Preferences > Language & Text > Formats > Dates > Customize… it’s the “Medium” format.

Thanks for the hint. Alas, on my system, the long format is being used; I have tried to correct it by using the “Set date…” script you provided , so I have been able to get almost what I want – with the exception of “padding” the day and month numbers (01 instead of 1 etc.). Any idea where I could get some code to do the padding?

Many thanks for your help!

Andreas

OK, with a little experimenting and help from an online forum, I have managed to produce something that does what I want. Of course, here it is to share with you all.

Thanks for all the kind help I received! DTPO 2 is a great product indeed.

Andreas

-- Create index for selected items
-- Created by Christian Grunenberg on Wed Mar 15 2006.
-- Modified by AB to add display of date of record on Tue Mar 16 2010,
-- using "Set date..." script from Christian Grunenberg from 2006 + a little bit of own inspiration
-- Important: automatic WikiLinks need to be switched on in DTPO!
-- Copyright (c) 2006. All rights reserved.

tell application "DEVONthink Pro"
	try
		set theSelection to the selection
		if theSelection is {} then error "Please select some items."
		set theIndex to ""
		repeat with theRecord in theSelection
			set theDate to (date of theRecord)
			set theDay to texts -2 thru -1 of ("0" & the day in theDate as string)
			set theMonth to texts -2 thru -1 of ("0" & ((month in theDate) as integer) as string)
			set theYear to the year in theDate as string
			set newDate to theYear & "." & theMonth & "." & theDay as string
			set theIndex to theIndex & newDate & "	 | 	" & (name of theRecord) & return
		end repeat
		set theRecord to item 1 of theSelection
		if exists parent 1 of theRecord then
			create record with {name:"index", type:rtf, rich text:theIndex} in parent 1 of theRecord
		else
			create record with {name:"index", type:rtf, rich text:theIndex}
		end if
	on error error_message number error_number
		if the error_number is not -128 then
			try
				display alert "DEVONthink Pro" message error_message as warning
			on error number error_number
				if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1
			end try
		end if
	end try
end tell