Forskel mellem versioner af "Folios"

(Remove duplicate arguments in template call. Finally he hopes.)
 
(684 mellemliggende versioner af 7 andre brugere ikke vist)
Linje 1: Linje 1:
 +
#REDIRECT [[Showfolio Mod]]
 +
{{Obsolete
 +
|notes = The Folios on this page for TNGv9 and TNGv10 are no longer supported. Please use the [[Showfolio Mod]] instead.  It works with existing folios and all version of TNG from TNGv9 thru TNGv11.0 and later.
 +
}}
 +
{{TNGmod
 +
| mod_name        = Folio
 +
| mod_summary    = Multipage images and documents facility
 +
| mod_validation  =
 +
 +
| download_link  =
 +
 +
<div  style="display:inline-block;width:95%;">
 +
'''TNG Mod version for TNGv10.1+'''
 +
<hr />
 +
</div>
 +
 +
<div    style="display:inline-block;width:95%;">[http://ccount.bisbeefamily.com/click.php?id=73      version 10.1.0.10.zip]<div    style="float:right;">{{Tv1010}}</div></div>
 +
<!-- http://tng.lythgoes.net/wiki/images/8/84/Folio_v10.1.0.10.zip -->
 +
 +
<div  style="display:inline-block;width:95%;">
 +
'''TNG Add-on version for TNGv9 & 10.0'''
 +
<hr />
 +
</div>
 +
 +
<div  style="display:inline-block;width:95%;">
 +
[http://ccount.bisbeefamily.com/click.php?id=34  version 9009.zip]<div    style="float:right;">{{Tv90}}</div></div>
 +
<!-- http://tng.lythgoes.net/wiki/images/6/6c/Folio_v9009.zip -->
 +
 +
| download_stats = [http://ccount.bisbeefamily.com/index.php?action=stats&id=73-34 view statistics]
 +
 +
| mod_author      = [[User:kazooter|Rick Bisbee]]
 +
| mod_url        = [[Folios]] (This page)
 +
| mod_support    = Rick Bisbee
 +
| mod_contact =
 +
[http://www.bisbeefamily.com/mod_support.php Support for Folios]
 +
| mod_version    = 10.1.0.10
 +
| min_TNG_ver    = 10.1.0
 +
| max_TNG_ver    = 10.1
 +
| TNG_file_list  =
 +
| related_mods    = [[Showfolio Mod]]
 +
 +
<div      style="display:inline-block;width:95%;">[http://ccount.bisbeefamily.com/click.php?id=75      tmpl_index_fix_v10.1.0.0.zip]<div      style="float:right;"></div></div>
 +
<!-- http://tng.lythgoes.net/wiki/images/c/c0/Template_index_fix.zip -->
 +
 +
<div      style="display:inline-block;width:95%;">[http://ccount.bisbeefamily.com/click.php?id=76  media_icons_mod_v10.1.0.1.zip]<div      style="float:right;"></div></div>
 +
<!-- http://tng.lythgoes.net/wiki/images/3/38/Media_icons_mod_v10.1.0.1.zip -->
 +
 +
| notes          = Handles jpg, gif, png, htm, html, and php. 
 +
}}
 
{|align=right
 
{|align=right
 
|__TOC__
 
|__TOC__
 
|}
 
|}
 +
<br style="clear:both" />
 +
'''''The latest Mod Manager version of the folio method is called [[Showfolio Mod]]. It works with all versions of TNG from TNGv9 onward and is completely compatible with existing folios.'''''
  
<font color=red><div align="center" style="text-align: center;font-size: 150%; font-weight: bold; margin: 10px auto;"> '' Script Under User Acceptance Testing '' </div></font>
+
With TNGv10.1.0, Folio is offered as a mod for TNGv10.0.  Options can be set with the Mod Manager editor after it is installed.  See '''[[Showfolio Mod]]''' for a better implementation.
  
::Check the TNG Forum thread for any changes and to provide feedback.
+
The Folio addon works with TNGv9 thru TNGv10.0. It is plug and play and has its own setup and options page.
  
The following is an Easy Multipage Documents approach copied from [[User:Kazooter|Kazooter's]] [http://www.tngforum.us/index.php?showtopic=5048 post in the TNG Forum] on 4 October 2009
+
 +
== Introduction ==
 +
A  folio simulates a multipage document handled as if it were a single TNG  media object. Opening a folio displays a cover page (optional) and page  navigation links to the rest of the pages (images or html/php), all  using your website's TNG styling. Folios does not modify any native TNG  files or structure the database.
  
I notice a number of people looking for an easy way to display multipage documents in tng. I have attached a script that does that. It implements a media type I call Folios, and defines a folio as any collection of related documentsA folio consists of an abstract or summary page with a link button to "View Original Documents." Clicking on the link displays the first document image (page number 1) in the folio, and provides page navigation buttons for the rest. There is no practical limit on the number of pages a folio may contain. Each document page has the site title and normal site navigation.  Closing the documents returns the user to the abstract page.
+
Possible    uses for a folio might  include Civil War pension files, probate  files,  land records, diaries, letters, or a collection of personal  records  pertaining to a  single individual or family. Only one folio needs to be  linked to an individual or family, rather than creating  each page as a   TNG document and linking them all separately.
  
 
== Folios Concept ==  
 
== Folios Concept ==  
 +
Folios    is a method, not a document type.  A folio folder contains page files    (jpg, gif, png, htm, html, and/or php) named so they will alpha-sort  in  the order you want them displayed.  Page files are added or deleted    simply by adding or deleting them from the folder.  In addition to  the  page files, each folder contains an index.php control file that is  registered in TNG as a media file.  When a folio is selected for  viewing, index.php sets some options  specific to that individual  folio, then grabs folio.php from the TNG root directory to display the  contents of the folder page-by-page.
 +
 +
<span  style="color:#990000">'''Note 1'''</span>: ''Folio images are displayed in their native size/resolution. For best viewing image widths should not exceed 800-900 pixels.  Height can be whatever is needed. Faster load times can be achieved by using 72-100px resolution.''
  
Folios are a TNG media collection based on HistoriesThe Folio page can be used as a summary, transcription or table of contentsWhen a document page is selected, a processing script creates a sorted list of all the images in the folio, constructs a navigation bar, and displays the requested documentTNG media records do not need to be created for page images. A page is added to a folio by dropping its image into the folder. It is deleted by removing it.  
+
<span  style="color:#990000">'''Note 2'''</span>: ''TNG templates 8  and 12 have a quirk in which they consider any file named index.php to be the home page and styles them accordinglyThis results in dark text  on dark backgrounds (unreadable). If your website uses one of these  templates, a related mod, [http://ccount.bisbeefamily.com/click.php?id=75 '''tmpl_index_fix'''], should be installed to allow folio control files to be styled as secondary pages.''
  
== Folio Cover Page ==
+
<span  style="color:#990000">'''Note 3'''</span>: ''Folio icons serve  as links back to the main media listing to which the folio belongs.  TNG  media icons are "dead" -- do nothing.  If you want to make the TNG  icons behave in the same way, download and install the  [http://ccount.bisbeefamily.com/click.php?id=76  '''media_icons_mod''']''.
  
An folio cover page is desirable for a number of reasons:
+
== Revisions ==
 +
{| class="wikitable sortable" style="width:720px;"
 +
|-
 +
! scope="col" width="110" |Version !! scope="col" width="90" | Date Released !! What's New
 +
|- valign="top"
 +
| align="center"|version&nbsp;10.1.0.10 || <center>10&nbsp;Jan&nbsp;2015</center> ||
 +
* Initial release
 +
* This will be the only release of Folio as a mod.  Please see [[Showfolio Mod]] for the next generation of the folio mod for TNGv9.0 thru TNGv10.1 and later.
 +
|- valign="top"
 +
| align="center"|version&nbsp;9.0.0.9 || <center>25&nbsp;Dec&nbsp;2012</center> ||
 +
* adds enhanced page initialization
 +
* completely rewritten for better code semantics and efficiency
 +
* large images resize when page width is reduced
 +
* page tabs rearrange gracefully when page width is reduced
 +
* replaced skinnytips with tooltips for all but the magnifier
 +
|- valign="top"
 +
| align="center"|version&nbsp;9.0.0.8 || <center>26 Sep 2012</center> ||
 +
* fixes label in control_file for border color
 +
* minor processing fix
 +
* adds tool-tip heading variable 'Magnifier' to English language folio_text.php files
 +
|- valign="top"
 +
| align="center"|version&nbsp;9.0.0.7 || <center>6 Jun 2012</center> ||
 +
* Fixes missing icon when folio-document is created within a native TNG collection.
 +
* Changes tool tip for folio-document icon acting as link back to collection.
 +
*    <span style="color:#990000;">New:</span>  [[Folios V9  Media Icons Mod]] is available to turn TNG  document icons into links  back to their respective collection listings  so that Folios_v9.0.0.7+  and TNG documents will have the same behavior. To read more click on  link above.
 +
|- valign="top"
 +
| align="center"|version&nbsp;9.0.0.6 || <center>31 May 2012</center> ||
 +
* Properly handles media record if the mediakey is missing.
 +
* Fixes problem with folio control files failing to find the folio program.
 +
* Upgrades compatibility with PHP4.
 +
|- valign="top"
 +
| align="center"|version&nbsp;9.0.0.5 || <center>17 May 2012</center> ||
 +
* Fixes failure to find media keys under some circumstances.
 +
* Adds new routine to locate folios within the file hierarchy.
 +
|- valign="top"
 +
| align="center"|version&nbsp;9.0.0.4 || <center>8 May 2012</center> ||
 +
* Sets width for form and centers in on the screen
 +
* Fixes failure to access a folio remotely via an url
 +
* Adds option to create an init.php control file for users of Template 8
 +
|- valign="top"
 +
| align="center"|version&nbsp;9.0.0.3 || <center>6 May 2012</center> ||
 +
* Made compatible with older versions of PHP (v4) that caused it to blow up when creating Folio Control Files.
 +
|- valign="top"
 +
| align="center"|version&nbsp;9.0.0.2 || <center>5 May 2012</center> ||
 +
*Support for '''TNG template 8''' to use init.php vice index.php as its folio control file.
 +
*Eliminated errors and warnings when logging out while in the setup or control file pages.
 +
|- valign="top"
 +
| align="center"|version&nbsp;9.0.0.1 || <center>2 May 2012</center> ||
 +
* Initial release
 +
|}
  
* It organizes the underlying documents;
+
== Get The Correct Download File ==
* A transcription may be included here for difficult to read documents;
+
Download  the appropriate file for your TNG installation.
* It can contain a table of contents with links to each document page; and
 
* The cover page may be all users need to see, especially if they are on a slow connection.
 
  
Possible uses for a folio might be a Civil War Pension file, a probate file, land records, or a collection of personal records pertaining to a single individual. The latter is useful because only one Folio needs to be linked to an individual, rather than multiple individual documents. It is even more useful because folio pages (images) can be added by simply dropping them into a folder, or removed by deleting them from the folder.  
+
*  Folio version 9009 is an add-on and works with TNGv9 and TNGv10.0.3. You must unzip the contents (a folder) and place it  into your TNG  extensions folder.  Use your browser to navigate to  extensions/folio  and the setup screen will appear.
  
Here's how to implement Folios.
+
*  Folio Mod v10.1.0.10 is required for TNG version 10.1.0 and later.  It is a  Mod Manager mod.  Unzip the download package and place the file and  folder in the TNG  mods directory.  Use Mod Manager to install it and  set preferences.
  
Two script files are required:
+
== Automated Installation (Mod v10.1.0.10) ==
 +
Starting  with TNGv10.1.0 and folio_v10.1.0.10, folio is a Mod Manager mod.  If  you have a previous version installed as an add-on, you can delete the  folio folder from the TNG extensions directory.  None of your existing  folio folders, media or media records will be disturbed.
  
* '''docview.php''' which goes into the TNG root directory to manage page images, and  
+
Add  the unzipped contents of the download package (1 cfg file and a folder) to  your TNG ''mods'' directory, then go to your TNG Admin page and select the  Mod Manager.  Find the Folio mod, open its line, and click on the  ''<u>Install</u>'' button. After it is installed, open the line again, and click  on the ''<u>Edit Options</u>'' button to set your preferences.
* '''folio_index.php''', a small file in each folio to initialize docview.php.
 
  
== Revisions ==  
+
[[File:cm014.jpg]]
 +
 
 +
== Manual Installation (Add-on Only) ==
 +
 
 +
To  install the add-on version of Folio, unzip the download package and  place the folder in your TNG extensions folder. Use your browser to  navigate to extensions/folio and you will see the setup page.  Select  and save your options.  The necessary files to display your folios will  be copied to the TNG root.
 +
 
 +
[[File:Folio001.jpg]]
  
4 Oct 2009 - Original script release
+
==Add The Folio Control File (Addon Only)==
6 Oct 2009 - Revised scripts
 
  
Based on early feedback, we have revised the script files and instructions for installation.
+
[[File:folio003.jpg|left|frame]]
 +
Use the "'''Create Folio Control File'''" program from the Folio Setup page to customize and add a control file to each folio.  The control file is named index.php to prevent directory browsing. For users of TNG Template 8 which styles any index.php as a home page (ruining the display), the Control File program will optionally create an init.php which just includes the index.php control file. Either one can be used as the media file when creating a TNG media record, but users of Template 8 must use init.php as the media file name. If you are already using init.php as your control file, you do not need to change anything.
  
What's new:
+
If you prefer to create control files manually, you can copy one from an existing folio and modify it with an editor to suit.
* Corrected minor errors in the script.
 
* Improved documentation inside the script.
 
* Revised installation instructions.
 
* Renamed index.php to folio_index.php to allow Mod Manager to install and manage it.
 
* Added a folios_body_text_template.html to assist in creating text for the abstract.
 
* Added a folios_abstract_example.html.
 
* It is no longer necessary to deal with icon files (unless you insist on it).
 
* Added Prev - Next buttons to the bottom of the image pages.
 
  
== Installation ==
+
A control file can also be created from scratch with an editor and manually dropped into the folder.  Here is an example of a complete folio control file with nearly every local option set.
 +
<pre>
 +
<?php
 +
/*************************************************************************
 +
FOLIO CONTROL FILE: military/cw24/index.php (Tue, 24 Apr 2012)
 +
*************************************************************************/
 +
# Cheney B. Bisbee Civil War Pension File
 +
$restricted=1;
 +
$showmagnifier=0;
 +
$bordersize=1;
 +
$bordercolor="blue";
 +
$exclude[]=".png";
 +
$exclude[]=".gif";
 +
$useCover=1;
 +
$pdfLink="cheney_bisbee_cwpension.pdf";
  
=== Automated ===
+
// locate folio.php
 +
$relpath = ""; $maxlevels=6;
 +
for( $i=0; $i<$maxlevels; $i++ ) {
 +
    if( file_exists( $relpath . "folio.php" ) )
 +
        include( $relpath . "folio.php" );
 +
    else
 +
        $relpath .= "../";
 +
}
 +
?>
 +
</pre>
 +
It begins with a comment enclosed between (/*) and (*/) that serves to remind us where the file belongs and when it was created.  Lines beginning with a hash mark (#) or double slashes (//) are also comments. Comments are ignored by the server and their only purpose is to provide reminders to the coder.
  
Config file for the [[Mod Manager]] will be provided.
+
Option variables are defined for this specific folio.  Options do not have to be used -- those which are not defined take on the global values set when Folios V9 was installed, or else not used at all.
  
=== Manual ===
+
Remember, the actual control file is named index.php.  If used, an init.php file just includes the index.php control file as a workaround for TNG Template 8.
  
==== Get the Files ====
+
= Using Folio =
Download the attached files in the [http://www.tngforum.us/index.php?showtopic=5048 TNG Forum Entry]:
+
You can use an existing TNG media type as the basis for a folio, or you can create a new collection (type).
  
* docview.php.txt -- folios display script
+
=== Create A TNG Media Collection ===
* folios_index.php.txt -- used as a template to create the index.php file in each folios/subfolder
+
Folios  works fine with single pages as well as for multipage documents and  you may want to create a new collection dedicated to this styleOn the  TNG Admin page, click on 'Media' and then click the Add  Collection  button.
* body_text_template.html.txt -- used as a template to be copied to your media record Body Text field
+
[[Image:cm005.jpg]]
* abstract_example.html.txt -- an example of a Folios media record Body Text field  
 
'''Remove the .txt extension.'''
 
  
Place '''docview.php''' in the TNG root directory.  You will need to create your own index.php file in each subfolder in the media collection where you want to use folios using the folios_index.php file as a template. The other download files are intended to serve as templates, so just hold on to them for the moment.
+
[[Image:cm001.jpg]]
  
==== Add style definitions ====
+
You can name your new collection anything you want; it does not have to be 'Folios.'
 +
* Collection ID: Should should be a short, descriptive word and not capitalized.
 +
*    Display Title: Should be Capitalized.  TNG looks for a Display Title    definition in your current language files.  If it finds one, it will    ignore the Title you enter here.  You can define the Display Title in    cust_text.php files for each language you use.  You must use the    collectionID as the index into the $text array, for example,    $text['clippings']="Stories", where 'clippings' is the name you've given    to your collection.  Do not use a variable name such as    $text[clippings] in the Display Title field.
 +
* Folder Name: the    folder name should be same as the collection ID. It is best not to    capitalize a folder name because Unix names are case-sensitive and it    could introduce a bug.
 +
* If you have not already created the media folder, click the '''Make Folder''' button.
 +
*    Icon file: you can choose an existing TNG icon such as tng_doc.gif,  or  you can use any other Icon you choose.  Be sure to specify its full  path  relative to the website's root directory.
 +
* Thumbnail  File: I  think in theory the Thumbnail is used in listings. If you do  not want  TNG to create a thumbnail from the original document (in this  case it  does not make much sense), provide your own standard  thumbnail.  At the  moment it doesn't seem to do much of anything.
 +
* Same setup as: use '''Histories''' or '''Documents'''.
  
Note that the text for the folio cover page is enclosed in a DIV tag that has a unique class name '''folio''' so you can style it. Although the default style applied by your website will probably be fine as is, if you want more control over the look of your text and background, you can add a style definition for the '''folio''' class to mytngstyle.css.  Here is an example of folio styles you can paste into your mytngstyle.css file, then modify it to taste:
+
=== Organize the Collection ===
  
 +
Refer  to the example chart below and create subfolders inside the collection  to organize your folios.  I like to create folders on my desktop  computer, then upload them to the website using FileZilla. In this  example, folios are organized by family and named according a family  member's given name.  Many other  organizing schemes are possible. Each  folio folder will contain page  files and an '''index.php''' file that  will be called when the folio is  selected from the various TNG menu  listings.  When you create a folder you will add all the page files as  well as creating the index.php file.
 +
 +
[[Image:cm006.jpg]]
 +
 +
Note    that while each '''folio''' folder has its own index.php file, the    parent collection and organizing subdirectories do not not. On some    servers, this could mean that a visitor browsing to a directory on your    website that does not contain an index.html or index.php file may see    the directory contents.  To stop this happening, follow instructions    given in [[Prevent Directory Listing]]. Keeping with our example, you    could create an '''index.php''' in each of your organizing directories    (clippings, Smith, Jones and Brown) which contain just the following    code to redirect a visitor to a listing of all the 'clippings':
 
<pre>
 
<pre>
.folio { /* cover page styling */
+
<?php
    padding: 3em;
+
header('Location: /browsemedia.php?mediatypeID=clippings');
    background-color: #fffff0;
+
?>
    border-width: 1px;
 
    border-style: solid;
 
    border-color: #aaaaaa;
 
}
 
.folio p { /* paragraph styling */
 
    font-size: 14px;
 
}
 
.docimage { /* document image styling */
 
margin-top: 5px;
 
border: 1px solid #aaa;  
 
}
 
 
</pre>
 
</pre>
  
If you have created other forms of Folios (see Create Folio Subfolder Index below), and you want to style them differently than Folios, replace the '''folio''' class in the DIV that encloses your text in the cover page with some other class name that you can style in mytngstyle.css in a similar manner to '''folio'''.
+
=== Add Content ===
  
== Folios Implementation ==
+
Copy    all the page files for your folio to its subdirectory  underneath the  appropriate media collection. Page files must be named in  alpha order  because that is the order in which they will be displayed.  Numbers in  the file name are treated (somewhat inconsistently) as alpha  characters  on most servers. That means, for instance, that 10 may well  sort  before 2. To have them treated more like numbers, keep number  strings  all the same length. Thus, in the above example, 02 will come  before  10, as you would expect. We recommend you avoid using capital  letters  in file names because Unix servers treat names as case  sensitive  (that  is, c is not the same as C) and they sort differently  -- you can  eliminate confusion by using all lower case file names and  they will  sort the way you expect them to. If you wish to have a cover  page, name  it so it will display first, then edit index.php to have  it use the  first page as a cover.  You will also need to give it a  label to display  on its tab, something like 'Cover' or 'Summary.'
=== Create the Media Collection ===
+
       
 +
Note that
 +
* folio page file types can be mixed (for instance, jpg and html).
 +
*    the pages will be displayed in Unix collating sequence so Upper Case    will be displayed before Lower Case and numbers will be treated as  alpha  characters.
 +
* the collation sequence will be different on a Windows WampServer testing environment.
  
In TNG Admin, create a new media collection where
+
=== Add The Index.php ===  
# CollectionID = folios -- Note that if you use multiple languages, the collectionID is used to find the $text variable so if you use Folios then your variable in cust_text.php should be $text[Folios]
 
# Display Title = folios -- Note that if you do not use multiple languages, you may want to Upper case the Display Title as Folios
 
# Folder Name = folios 
 
# Click the '''Make Folder''' button
 
# Icon File = tng_doc.gif
 
# Same setup as = '''Histories'''.
 
  
[[Image:Folios_collection.jpg]]
+
Create  a control file named index.php in the folder where you are installing a  new folio.  You can find an example file in your mods/folio.v10 folder  if you want to start from that, or you can copy the file contents below  and modify it to suit.
 +
<pre>
  
=== Set Up the Folder Structure ===
+
<?php
 +
/***********************************************
 +
FOLIO CONTROL FILE:
 +
************************************************/
 +
# Cheney B. Bisbee Civil War Pension File
  
Refer to the chart below and create a subfolder in folios or other media collection folder to contain all the media and the index.php file for your folio.  
+
// ignore any files in the folder with extensions .html or .htm
 +
$exclude[] = ".htm";
 +
$exclude[] = ".html";
  
[[Image:chart.png]]
+
// consider the first file in the folder a coversheet
 +
$useCover=1;
  
=== Create Folio Subfolder Index ===
+
// add link to allow user to download the a pdf verson
 +
$pdfLink ="cbisibee.pdf";
  
Place a copy of folio_index.php into your folio's subfolder.  You can rename it index.php if you wish. Only two lines need to be customized:
+
// do not show the magnifier on image pages
* the '''$returnID''' value will need to be set to the mediaID number for the new folio you will create below (I'll remind you later); and
+
$showMagnifier=false;
* the '''$docTitle''' must be assigned the string that will be displayed at the top of the browser when viewing the images. 
 
  
Optionally, two other values may be added to folio_index.php. If, for some reason, you are creating a folio-type collection, but need to name it something other than Folios (like Military Records), and want to use a different icon, uncomment the following two lines in folio_index.php and replace the place-holder values with your customizations:
+
// Do not modify below this line
<pre>
+
// this section finds the folio.php driver
$icon="path_to_your_icon/icon_file_name";  
+
$relpath = ""; $maxlevels=6;
$titlestr="My_Custom_Doc_Type";
+
for( $i=0; $i<$maxlevels; $i++ ) {
 +
        if( file_exists( $relpath . "folio.php" ) )
 +
                include( $relpath . "folio.php" );
 +
        else
 +
                $relpath .= "../";
 +
}
 +
?>
 
</pre>
 
</pre>
  
=== Create a Folio ===
+
Options  in the control file only pertain to the current folioNo options are  required -- they will all default to the global values set with mod manager or the setup page for the add-on version. The only thing  absolutely required is the block of code that finds folio.php.
Create your first folio in TNG Admin -> Media -> Add New, where Media File->Collection = Folios. There are two ways to compose your cover page textThe most direct way is to copy and paste the content of folio_body_text_template.html into the '''Body Text''' box of the media you are creating, then edit in your content in the space provided. A second method is to make a copy of folio_body_text_template.html and use an editor to compose the text. When finished, copy and paste the whole thing into the '''Body Text''' box. The second method has the advantage of allowing you to save your text locally in case you have to go back later and make major revisions. If you like to spend time writing and rewriting content to get it exactly right, use the second method.
 
  
:<span style="color: red">'''Important!'''</span> The first and last lines of the pasted text provide links/buttons to "<span style="color: red">View Original Documents</span>."  These must be pointed to the '''index.php''' file in your new folio subfolder (e.g., href="folios/h47/index.php").
+
Here are some options you can (but don't have to) use to customize the current folio:
  
If the cover page content is very short and does not fill the page, feel free to delete the last button (last line in the folio_text_template file.)  If the page is a Table of Contents with links to the underlying documents, it might make sense to delete both buttons (first and last lines).
+
{| class="wikitable"
 +
|-
 +
! User Options !! Explanation
 +
|- valign="top"
 +
| $exclude[] = ".jpg";<br/>
 +
$exclude[] = ".png";<br />
 +
$exclude[] = ".gif";<br />
 +
$exclude[] = ".htm";<br />
 +
$exclude[] = ".html";<br />
 +
$exclude[] = ".php";
 +
|| Exclude certain file types from being included as a document page in  this folio.  The index.php is excluded automatically. No files (except  the index.php) are excluded by default.
 +
|- valign="top"
 +
| $useCover=TRUE;<br />
 +
$buttonLabel="cover";
 +
|| Use a cover page for the folio and provide a button label for it.<br />
 +
If  $buttonLabel can be found in the cust_text.php file in your chosen    language as an index into the $text array (for example,      $text['cover']="Contents"), the value provided there ("Contents") will    be used. If  not, the label itself will be used ("cover). This allows  you to  "internationalize" it in as many languages as you support.
 +
|-  valign="top"
 +
| $pdfLink ="filename.pdf";
 +
|| Adds root-relative PDF download links to top and bottom of folio pages
 +
|- valign="top"
 +
! Global Overrides !!
 +
|- valign="top"
 +
| $restrict=true;
 +
|| Restrict folio access to registered users -- redirect the rest to TNG login page.
 +
|-  valign="top"
 +
| $border=0;<br />
 +
$bordercolor="#aaa";
 +
|| Select a border for image pages in this folio.
 +
|-  valign="top"
 +
| $showMagnifier=true;
 +
|| If you've turned off the magnifier globally in folio.ini.php, you can turn it on here, but just for this folio.
 +
|-  valign="top"
 +
| $tjpzoom_config="round"; || Sets the magnifier corners "round" or "square";
 +
|-  valign="top"
 +
| $tjpwidth;<br />
 +
$tjpheight;
 +
|| Sets the start up width and height of the magnifier.
 +
|-  valign="top"
 +
| $tipborder="1px&nbsp;solid&nbsp;#aaa"; || Sets tooltip border style
 +
|-  valign="top"
 +
| $tipbackground="#eee"; || Sets tooltip background color
 +
|-  valign="top"
 +
| $tipfontsize="12px"; || Sets tooltip font size in pixels
 +
|-  valign="top"
 +
| $tipfontstyle="italic"; || "italic" or "normal"
 +
|-  valign="top"
 +
| $tiptextcolor="black"; || Color of tool tip text
 +
|}
 +
 
 +
Note that all value statements in index.php must end with a semicolon (;).  String values must be enclosed in quotes.
 +
 
 +
=== <span style="color: #990000">Special Note for Users of TNG Templates 8 and 12</span> ===
 +
TNG  Templates 8 and 12 treat any file named index.php as a 'home' page and style them accordingly. This results in dark text on a dark background  that is virtually unreadable.  
  
Finally, note that the text of the abstract is enclosed in a DIV tag that has a unique class name to allow the abstract to be styled in your mytngstyle.css. 
+
There are two ways to  fix the problem. The first is to use a companion mod --  [http://ccount.bisbeefamily.com/click.php?id=75 '''tmpl_index_fix'''] -- to correct the behavior of these templates.
  
Note that if the Body Text abstract is a very short one, you may want to delete either the top or bottom View Original Documents button
+
Or  you can change the name of the Folio's index.php control file to  something like init.php. However this will leave your folders vulnerable  to directory browsing.  One way to prevent that is to add a file named  'index.htm' to each folio folder that redirects a browser to your  init.php:
 
<pre>
 
<pre>
<p><a href="folios/subfolder/index.php" target="_self" class="snlink">View Original Documents</a></p>
+
<html>
 +
<head>
 +
<meta http-equiv="Refresh" content="0; url=init.php" />
 +
</head>
 +
<body>
 +
<p>Please follow <a href="init.php">this link</a>.</p>
 +
</body>
 +
</html>
 
</pre>
 
</pre>
either before the '''<nowiki><div></nowiki>''' or after the '''<nowiki></div></nowiki>''' in the Body Text of the abstract media record.
+
The code in the <body> is intended for browsers that do not honor the redirect.  You should style it to suit.
  
=== Update Your index.php ===
+
Next,  exclude .htm file types in init.php.  Your .html file types will still  be included in the folio if you need them.  See [[Prevent Directory  Listing]] for a more detailed discussion of the issue.
While still on the Folio media record creation page,  
+
 
* Add a title in the Media Information sectionYou should use this title information in the '''$docTitle''' in the index.php file. In your index.php be careful to retain the capital letter in $docTitle (it's case-sensitive), enclose the title in quotes, and end with a semicolon.
+
=== Include PDF Download Link ===
 +
 
 +
If  the folio is also available as a PDF download, you can add links to the top and bottom of each pageTo do so, define $pdfLink&nbsp;=&nbsp;"filepath" in the folio's index.php file, substituting "filepath" for the path to the file from the TNG root (root-relative.) For example:
 
<pre>
 
<pre>
$docTitle="Uncle Charlie's Wedding";
+
$pdfLink = "clippings/pdf/myfile.pdf";
</pre>
+
</pre>
* Link the folio to persons as appropriate and save it.  Don't forget to save it.  
+
 
* When you see a message like "Changes to item 348 were successfully saved", note the mediaID number (348 in this example) and enter it as the '''$returnID=''' value in your folio index.php. It should look like this with a semicolon at the end:
+
=== Create a TNG Cover Page (Optional) ===
 +
A cover page can be used:
 +
* to present a summary of the folio;
 +
* to provide space for transcribing difficult to read documents;
 +
* to contain links to related non-folio pages or downloadable files (e.g. pdf, zip); and
 +
* for a table of contents with links to individual document pages.
 +
 
 +
If  you choose to use a cover page you should create an HTML file named to   sort first among the other page files and containing only text  formatting tags&mdash;do not use <html>, <head> or  <body> tags.
 +
 
 +
Note that it is good practice to  enclose your  formatted text in DIV tags and give them a class name so  you will have  the option to style them if you wish. 
 
<pre>
 
<pre>
$returnID=348;
+
<div class="folio">
 +
<p>Paragraph 1 from the article goes here</p
 +
<p>Paragraph 2 from the article goes here</p>>
 +
</div>
 
</pre>
 
</pre>
  
=== Copy Folio Media ===
+
===Add a Folio to TNG===
 +
This    is the payoff, the final step, where we make an actual TNG Media  record  for the folio we've assembled under our new collection.  Do this  from  the TNG Admin page by clicking on "Media".
 +
 
 +
[[Image:cm007.jpg]]
 +
 
 +
Since you have not entered the folio yet, the search list will return nothing.<br />
 +
Next, click on the Add New tab.
 +
 
 +
[[Image:cm008.jpg]]
 +
 
 +
Choose    a thumbnail to represent the folio-type.  If you place a thumbnail in    the collection directory, you can use it for all folios in the    collection.
 +
 
 +
[[Image:cm009.jpg]]
 +
 
 +
Continue  filling  out the form with the Title and Description.  The Title will  be used  when your folio is displayed.  The Description will appear as  notes  underneath the Title.  When you have completed this portion,  click "Save  and continue...".
 +
 
 +
On the next screen you  can associate this folio with a Person, Family, Source, Repository or  Place.  If associated with a person, you may further refine the  association to an event in the person's life such as Death or Burial.
 +
 
 +
[[Image:cm010.jpg]]
 +
 
 +
Once    a link has been added to the list of links associated with this  media,  you can edit it by clicking on the leftmost icon and associate  it with  an event in the person's life.  In the above example, I have  linked  the  folio with Robert Smith's death and it will show up on his  page as a  link under 'Death'.
 +
 
 +
When you are finished  entering  all the data in the record, you MUST click on Save to add it  to the  database.  Your new multipage document is finished except for  any  additional styling you may wish to add.
 +
 
 +
=== Add Style Definitions (Optional)===
 +
 
 +
Any    html text, for instance for a cover page, should be enclosed in a DIV    tag that has a unique class name like '''folio''' to allow you to  style  it whenever you choose.. Although the default style applied by  your  website will probably be fine as is, if you want more control  over the  look of your text and background, you can add a style  definition for the  '''folio''' class to mytngstyle.css.  Here is one  example of folio  styling you can paste into mytngstyle.css if you wish  to experiment with  it.
 +
 
 +
<syntaxhighlight lang="css">
 +
.folio { /* text page styling */
 +
  padding: 3em;
 +
  background-color: #fffff0;
 +
  border-width: 1px;
 +
  border-style: solid;
 +
  border-color: #aaa;
 +
}
 +
.folio p { /* paragraph styling */
 +
  font-size: 14px;
 +
}
  
Copy all the images you want to display in a folio to your media collection subfolder. Images must be named in alpha order because that is the order in which they will be displayed. Numbers in the image name are treated (somewhat inconsistently) as alpha characters on most servers. That means, for instance, that 10 may well sort before 2. To have them treated more like numbers, keep number strings all the same length. Thus, in the above example, 02 will come before 10, as you would expect. We recommend you avoid using capital letters in file names because Unix servers treat names as case sensitive (that is, c is not the same as C) and they sort differently -- you can eliminate confusion by using all lower case file names that will sort the way you expect them to.
+
.folio li { /* list item styling */
+
  font-size: 14px;
Note that
+
}</syntaxhighlight>
* you do not need to create TNG media records for these images.
 
* the images will be displayed in Unix collating sequence so Upper Case will be displayed before Lower Case and numbers will be displayed xxx
 
* the collation sequence will be different on a Windows WampServer testing environment.
 
  
== Test the Result ==
+
If    you have created other forms of folios (see    [[#Create_A_TNG_Media_Collection | Create A TNG Media Collection]]), and    you want them styled differently than folios, replace the '''folio'''    class in the DIV that encloses your text with some other class name  that  you can separately style in mytngstyle.css in a similar manner to    '''folio'''.
  
Obviously, there is no magic in the name of the collection (Folios), folder names, class names, or icon file.  Change them as you will.
+
== Notes ==
 +
Obviously, there is no magic in the names of collections, folders, classes, or icons.  Change them as you will.
  
If you want to see my implementation of folios, go to my [http://www.bisbeefamily.com A Bisbee Family History website home page], click on the Media drop down menu and select '''Folios''' or '''Military Records'''.  
+
If you would like to see one of my own implementations of folios, click on    [http://bisbeefamily.com/military/cw52/index.php Curtis C. Bisbee Civil War Pension File].
  
== Disclaimer ==
+
== Examples ==
 +
See also the [[Folios - Examples]] page.
  
There is no warranty. Use the script at your own risk. I have not tested it in all the TNG template styles, so it may need to be modified to suit your environment.
+
== Credits To ==
 +
* Janos Pal Toth at [http://valid.tjp.hu/tjpzoom http://valid.tjp.hu/tjpzoom] for the magnifier lens
 +
* The folks at [http://craigsworks.com/ http://craigsworks.com] for the custom tool tips script.
 +
* Roger Clist at [http://tng.roots.lochneil.com The Clist Connections]for his always helpful design suggestions.
  
I hope someone will find it as useful as I have.
+
== Disclaimer ==
  
== Site Using ==
+
There    is no warranty.  Use the script at your own risk.  It has been tested    in all the TNG template styles without any particular problems.
  
[http://www.bisbeefamily.com A Bisbee Family History] TNG Forum user Kazooter's site
+
== Sites Using ==
 +
The following sites contain folios which are viewable without login.
 +
* [http://www.bisbeefamily.com A Bisbee Family History] mod developer and TNG Forum user Kazooter's site
 +
*    [http://tng.roots.lochneil.com The Clist Connections] has folios of    typewritten pages (jpg scans) and folios created from source documents    (html pages)
  
 
[[Category:Media]]
 
[[Category:Media]]
 +
[[Category:Mods for TNG v10]]
 +
[[Category:Other Scripts]]

Nuværende version fra 6. maj 2024, 03:24

Redirect to:

Obsolete The Folios on this page for TNGv9 and TNGv10 are no longer supported. Please use the Showfolio Mod instead. It works with existing folios and all version of TNG from TNGv9 thru TNGv11.0 and later. Obsolete



The latest Mod Manager version of the folio method is called Showfolio Mod. It works with all versions of TNG from TNGv9 onward and is completely compatible with existing folios.

Folio
Summary Multipage images and documents facility
Validation
Mod Updated {{{mod_last_update}}}
Download link

TNG Mod version for TNGv10.1+


TNG Add-on version for TNGv9 & 10.0


Download stats view statistics
Author(s) Rick Bisbee
Homepage Folios (This page)
Mod Support Rick Bisbee
Contact Developer Support for Folios
Latest Mod 10.1.0.10
Min TNG V 10.1.0
Max TNG V 10.1
Files modified
Related Mods
Notes
Handles jpg, gif, png, htm, html, and php.


With TNGv10.1.0, Folio is offered as a mod for TNGv10.0. Options can be set with the Mod Manager editor after it is installed. See Showfolio Mod for a better implementation.

The Folio addon works with TNGv9 thru TNGv10.0. It is plug and play and has its own setup and options page.


Introduction

A folio simulates a multipage document handled as if it were a single TNG media object. Opening a folio displays a cover page (optional) and page navigation links to the rest of the pages (images or html/php), all using your website's TNG styling. Folios does not modify any native TNG files or structure the database.

Possible uses for a folio might include Civil War pension files, probate files, land records, diaries, letters, or a collection of personal records pertaining to a single individual or family. Only one folio needs to be linked to an individual or family, rather than creating each page as a TNG document and linking them all separately.

Folios Concept

Folios is a method, not a document type. A folio folder contains page files (jpg, gif, png, htm, html, and/or php) named so they will alpha-sort in the order you want them displayed. Page files are added or deleted simply by adding or deleting them from the folder. In addition to the page files, each folder contains an index.php control file that is registered in TNG as a media file. When a folio is selected for viewing, index.php sets some options specific to that individual folio, then grabs folio.php from the TNG root directory to display the contents of the folder page-by-page.

Note 1: Folio images are displayed in their native size/resolution. For best viewing image widths should not exceed 800-900 pixels. Height can be whatever is needed. Faster load times can be achieved by using 72-100px resolution.

Note 2: TNG templates 8 and 12 have a quirk in which they consider any file named index.php to be the home page and styles them accordingly. This results in dark text on dark backgrounds (unreadable). If your website uses one of these templates, a related mod, tmpl_index_fix, should be installed to allow folio control files to be styled as secondary pages.

Note 3: Folio icons serve as links back to the main media listing to which the folio belongs. TNG media icons are "dead" -- do nothing. If you want to make the TNG icons behave in the same way, download and install the media_icons_mod.

Revisions

Version Date Released What's New
version 10.1.0.10
10 Jan 2015
  • Initial release
  • This will be the only release of Folio as a mod. Please see Showfolio Mod for the next generation of the folio mod for TNGv9.0 thru TNGv10.1 and later.
version 9.0.0.9
25 Dec 2012
  • adds enhanced page initialization
  • completely rewritten for better code semantics and efficiency
  • large images resize when page width is reduced
  • page tabs rearrange gracefully when page width is reduced
  • replaced skinnytips with tooltips for all but the magnifier
version 9.0.0.8
26 Sep 2012
  • fixes label in control_file for border color
  • minor processing fix
  • adds tool-tip heading variable 'Magnifier' to English language folio_text.php files
version 9.0.0.7
6 Jun 2012
  • Fixes missing icon when folio-document is created within a native TNG collection.
  • Changes tool tip for folio-document icon acting as link back to collection.
  • New: Folios V9 Media Icons Mod is available to turn TNG document icons into links back to their respective collection listings so that Folios_v9.0.0.7+ and TNG documents will have the same behavior. To read more click on link above.
version 9.0.0.6
31 May 2012
  • Properly handles media record if the mediakey is missing.
  • Fixes problem with folio control files failing to find the folio program.
  • Upgrades compatibility with PHP4.
version 9.0.0.5
17 May 2012
  • Fixes failure to find media keys under some circumstances.
  • Adds new routine to locate folios within the file hierarchy.
version 9.0.0.4
8 May 2012
  • Sets width for form and centers in on the screen
  • Fixes failure to access a folio remotely via an url
  • Adds option to create an init.php control file for users of Template 8
version 9.0.0.3
6 May 2012
  • Made compatible with older versions of PHP (v4) that caused it to blow up when creating Folio Control Files.
version 9.0.0.2
5 May 2012
  • Support for TNG template 8 to use init.php vice index.php as its folio control file.
  • Eliminated errors and warnings when logging out while in the setup or control file pages.
version 9.0.0.1
2 May 2012
  • Initial release

Get The Correct Download File

Download the appropriate file for your TNG installation.

  • Folio version 9009 is an add-on and works with TNGv9 and TNGv10.0.3. You must unzip the contents (a folder) and place it into your TNG extensions folder. Use your browser to navigate to extensions/folio and the setup screen will appear.
  • Folio Mod v10.1.0.10 is required for TNG version 10.1.0 and later. It is a Mod Manager mod. Unzip the download package and place the file and folder in the TNG mods directory. Use Mod Manager to install it and set preferences.

Automated Installation (Mod v10.1.0.10)

Starting with TNGv10.1.0 and folio_v10.1.0.10, folio is a Mod Manager mod. If you have a previous version installed as an add-on, you can delete the folio folder from the TNG extensions directory. None of your existing folio folders, media or media records will be disturbed.

Add the unzipped contents of the download package (1 cfg file and a folder) to your TNG mods directory, then go to your TNG Admin page and select the Mod Manager. Find the Folio mod, open its line, and click on the Install button. After it is installed, open the line again, and click on the Edit Options button to set your preferences.

Cm014.jpg

Manual Installation (Add-on Only)

To install the add-on version of Folio, unzip the download package and place the folder in your TNG extensions folder. Use your browser to navigate to extensions/folio and you will see the setup page. Select and save your options. The necessary files to display your folios will be copied to the TNG root.

Folio001.jpg

Add The Folio Control File (Addon Only)

Folio003.jpg

Use the "Create Folio Control File" program from the Folio Setup page to customize and add a control file to each folio. The control file is named index.php to prevent directory browsing. For users of TNG Template 8 which styles any index.php as a home page (ruining the display), the Control File program will optionally create an init.php which just includes the index.php control file. Either one can be used as the media file when creating a TNG media record, but users of Template 8 must use init.php as the media file name. If you are already using init.php as your control file, you do not need to change anything.

If you prefer to create control files manually, you can copy one from an existing folio and modify it with an editor to suit.

A control file can also be created from scratch with an editor and manually dropped into the folder. Here is an example of a complete folio control file with nearly every local option set.

<?php
/*************************************************************************
FOLIO CONTROL FILE: military/cw24/index.php (Tue, 24 Apr 2012)
*************************************************************************/
# Cheney B. Bisbee Civil War Pension File
$restricted=1;
$showmagnifier=0;
$bordersize=1;
$bordercolor="blue";
$exclude[]=".png";
$exclude[]=".gif";
$useCover=1;
$pdfLink="cheney_bisbee_cwpension.pdf";

// locate folio.php
$relpath = ""; $maxlevels=6;
for( $i=0; $i<$maxlevels; $i++ ) {
    if( file_exists( $relpath . "folio.php" ) )
        include( $relpath . "folio.php" );
    else
        $relpath .= "../";
}
?>

It begins with a comment enclosed between (/*) and (*/) that serves to remind us where the file belongs and when it was created. Lines beginning with a hash mark (#) or double slashes (//) are also comments. Comments are ignored by the server and their only purpose is to provide reminders to the coder.

Option variables are defined for this specific folio. Options do not have to be used -- those which are not defined take on the global values set when Folios V9 was installed, or else not used at all.

Remember, the actual control file is named index.php. If used, an init.php file just includes the index.php control file as a workaround for TNG Template 8.

Using Folio

You can use an existing TNG media type as the basis for a folio, or you can create a new collection (type).

Create A TNG Media Collection

Folios works fine with single pages as well as for multipage documents and you may want to create a new collection dedicated to this style. On the TNG Admin page, click on 'Media' and then click the Add Collection button.  

 

You can name your new collection anything you want; it does not have to be 'Folios.'

  • Collection ID: Should should be a short, descriptive word and not capitalized.
  • Display Title: Should be Capitalized. TNG looks for a Display Title definition in your current language files. If it finds one, it will ignore the Title you enter here. You can define the Display Title in cust_text.php files for each language you use. You must use the collectionID as the index into the $text array, for example, $text['clippings']="Stories", where 'clippings' is the name you've given to your collection. Do not use a variable name such as $text[clippings] in the Display Title field.
  • Folder Name: the folder name should be same as the collection ID. It is best not to capitalize a folder name because Unix names are case-sensitive and it could introduce a bug.
  • If you have not already created the media folder, click the Make Folder button.
  • Icon file: you can choose an existing TNG icon such as tng_doc.gif, or you can use any other Icon you choose. Be sure to specify its full path relative to the website's root directory.
  • Thumbnail File: I think in theory the Thumbnail is used in listings. If you do not want TNG to create a thumbnail from the original document (in this case it does not make much sense), provide your own standard thumbnail. At the moment it doesn't seem to do much of anything.
  • Same setup as: use Histories or Documents.

Organize the Collection

Refer to the example chart below and create subfolders inside the collection to organize your folios. I like to create folders on my desktop computer, then upload them to the website using FileZilla. In this example, folios are organized by family and named according a family member's given name. Many other organizing schemes are possible. Each folio folder will contain page files and an index.php file that will be called when the folio is selected from the various TNG menu listings. When you create a folder you will add all the page files as well as creating the index.php file.

 

Note that while each folio folder has its own index.php file, the parent collection and organizing subdirectories do not not. On some servers, this could mean that a visitor browsing to a directory on your website that does not contain an index.html or index.php file may see the directory contents. To stop this happening, follow instructions given in Prevent Directory Listing. Keeping with our example, you could create an index.php in each of your organizing directories (clippings, Smith, Jones and Brown) which contain just the following code to redirect a visitor to a listing of all the 'clippings':

<?php
header('Location: /browsemedia.php?mediatypeID=clippings');
?>

Add Content

Copy all the page files for your folio to its subdirectory underneath the appropriate media collection. Page files must be named in alpha order because that is the order in which they will be displayed. Numbers in the file name are treated (somewhat inconsistently) as alpha characters on most servers. That means, for instance, that 10 may well sort before 2. To have them treated more like numbers, keep number strings all the same length. Thus, in the above example, 02 will come before 10, as you would expect. We recommend you avoid using capital letters in file names because Unix servers treat names as case sensitive (that is, c is not the same as C) and they sort differently -- you can eliminate confusion by using all lower case file names and they will sort the way you expect them to. If you wish to have a cover page, name it so it will display first, then edit index.php to have it use the first page as a cover. You will also need to give it a label to display on its tab, something like 'Cover' or 'Summary.'

Note that

  • folio page file types can be mixed (for instance, jpg and html).
  • the pages will be displayed in Unix collating sequence so Upper Case will be displayed before Lower Case and numbers will be treated as alpha characters.
  • the collation sequence will be different on a Windows WampServer testing environment.

Add The Index.php

Create a control file named index.php in the folder where you are installing a new folio. You can find an example file in your mods/folio.v10 folder if you want to start from that, or you can copy the file contents below and modify it to suit.


<?php
/***********************************************
FOLIO CONTROL FILE:
************************************************/
# Cheney B. Bisbee Civil War Pension File

// ignore any files in the folder with extensions .html or .htm
$exclude[] = ".htm";
$exclude[] = ".html";

// consider the first file in the folder a coversheet
$useCover=1;

// add link to allow user to download the a pdf verson
$pdfLink ="cbisibee.pdf";

// do not show the magnifier on image pages
$showMagnifier=false;

// Do not modify below this line
// this section finds the folio.php driver
$relpath = ""; $maxlevels=6;
for( $i=0; $i<$maxlevels; $i++ ) {
        if( file_exists( $relpath . "folio.php" ) )
                include( $relpath . "folio.php" );
        else
                $relpath .= "../";
}
?>

Options in the control file only pertain to the current folio. No options are required -- they will all default to the global values set with mod manager or the setup page for the add-on version. The only thing absolutely required is the block of code that finds folio.php.

Here are some options you can (but don't have to) use to customize the current folio:

User Options Explanation
$exclude[] = ".jpg";

$exclude[] = ".png";
$exclude[] = ".gif";
$exclude[] = ".htm";
$exclude[] = ".html";
$exclude[] = ".php";

Exclude certain file types from being included as a document page in this folio. The index.php is excluded automatically. No files (except the index.php) are excluded by default.
$useCover=TRUE;

$buttonLabel="cover";

Use a cover page for the folio and provide a button label for it.

If $buttonLabel can be found in the cust_text.php file in your chosen language as an index into the $text array (for example, $text['cover']="Contents"), the value provided there ("Contents") will be used. If not, the label itself will be used ("cover). This allows you to "internationalize" it in as many languages as you support.

$pdfLink ="filename.pdf"; Adds root-relative PDF download links to top and bottom of folio pages
Global Overrides
$restrict=true; Restrict folio access to registered users -- redirect the rest to TNG login page.
$border=0;

$bordercolor="#aaa";

Select a border for image pages in this folio.
$showMagnifier=true; If you've turned off the magnifier globally in folio.ini.php, you can turn it on here, but just for this folio.
$tjpzoom_config="round"; Sets the magnifier corners "round" or "square";
$tjpwidth;

$tjpheight;

Sets the start up width and height of the magnifier.
$tipborder="1px solid #aaa"; Sets tooltip border style
$tipbackground="#eee"; Sets tooltip background color
$tipfontsize="12px"; Sets tooltip font size in pixels
$tipfontstyle="italic"; "italic" or "normal"
$tiptextcolor="black"; Color of tool tip text

Note that all value statements in index.php must end with a semicolon (;). String values must be enclosed in quotes.

Special Note for Users of TNG Templates 8 and 12

TNG Templates 8 and 12 treat any file named index.php as a 'home' page and style them accordingly. This results in dark text on a dark background that is virtually unreadable.

There are two ways to fix the problem. The first is to use a companion mod -- tmpl_index_fix -- to correct the behavior of these templates.

Or you can change the name of the Folio's index.php control file to something like init.php. However this will leave your folders vulnerable to directory browsing. One way to prevent that is to add a file named 'index.htm' to each folio folder that redirects a browser to your init.php:

<html>
<head>
<meta http-equiv="Refresh" content="0; url=init.php" />
</head>
<body>
<p>Please follow <a href="init.php">this link</a>.</p>
</body>
</html>

The code in the <body> is intended for browsers that do not honor the redirect. You should style it to suit.

Next, exclude .htm file types in init.php. Your .html file types will still be included in the folio if you need them. See Prevent Directory Listing for a more detailed discussion of the issue.

Include PDF Download Link

If the folio is also available as a PDF download, you can add links to the top and bottom of each page. To do so, define $pdfLink = "filepath" in the folio's index.php file, substituting "filepath" for the path to the file from the TNG root (root-relative.) For example:

$pdfLink = "clippings/pdf/myfile.pdf";

Create a TNG Cover Page (Optional)

A cover page can be used:

  • to present a summary of the folio;
  • to provide space for transcribing difficult to read documents;
  • to contain links to related non-folio pages or downloadable files (e.g. pdf, zip); and
  • for a table of contents with links to individual document pages.

If you choose to use a cover page you should create an HTML file named to sort first among the other page files and containing only text formatting tags—do not use <html>, <head> or <body> tags.

Note that it is good practice to enclose your formatted text in DIV tags and give them a class name so you will have the option to style them if you wish.

<div class="folio">
<p>Paragraph 1 from the article goes here</p
<p>Paragraph 2 from the article goes here</p>>
</div>

Add a Folio to TNG

This is the payoff, the final step, where we make an actual TNG Media record for the folio we've assembled under our new collection. Do this from the TNG Admin page by clicking on "Media".

 

Since you have not entered the folio yet, the search list will return nothing.
Next, click on the Add New tab.

 

Choose a thumbnail to represent the folio-type. If you place a thumbnail in the collection directory, you can use it for all folios in the collection.

 

Continue filling out the form with the Title and Description. The Title will be used when your folio is displayed. The Description will appear as notes underneath the Title. When you have completed this portion, click "Save and continue...".

On the next screen you can associate this folio with a Person, Family, Source, Repository or Place. If associated with a person, you may further refine the association to an event in the person's life such as Death or Burial.

 

Once a link has been added to the list of links associated with this media, you can edit it by clicking on the leftmost icon and associate it with an event in the person's life. In the above example, I have linked the folio with Robert Smith's death and it will show up on his page as a link under 'Death'.

When you are finished entering all the data in the record, you MUST click on Save to add it to the database. Your new multipage document is finished except for any additional styling you may wish to add.

Add Style Definitions (Optional)

Any html text, for instance for a cover page, should be enclosed in a DIV tag that has a unique class name like folio to allow you to style it whenever you choose.. Although the default style applied by your website will probably be fine as is, if you want more control over the look of your text and background, you can add a style definition for the folio class to mytngstyle.css. Here is one example of folio styling you can paste into mytngstyle.css if you wish to experiment with it.

.folio { /* text page styling */
   padding: 3em;
   background-color: #fffff0;
   border-width: 1px;
   border-style: solid;
   border-color: #aaa;
}
.folio p { /* paragraph styling */
   font-size: 14px;
}

.folio li { /* list item styling */
   font-size: 14px;
}

If you have created other forms of folios (see Create A TNG Media Collection), and you want them styled differently than folios, replace the folio class in the DIV that encloses your text with some other class name that you can separately style in mytngstyle.css in a similar manner to folio.

Notes

Obviously, there is no magic in the names of collections, folders, classes, or icons. Change them as you will.

If you would like to see one of my own implementations of folios, click on Curtis C. Bisbee Civil War Pension File.

Examples

See also the Folios - Examples page.

Credits To

Disclaimer

There is no warranty. Use the script at your own risk. It has been tested in all the TNG template styles without any particular problems.

Sites Using

The following sites contain folios which are viewable without login.