User Pages - Getting Started

From TNG_Wiki
Jump to navigation Jump to search

User Pages - Getting Started


Article Under Construction


The easiest way to create user pages is to edit the historytemplate.php file with an ASCII text editor like Notepad++, PSPad, or Windows Notepad.
  • Open the historytemplate.php
  • Save it with a different name
  • Edit the saved page and replace the text as shown in Editing new file

Editing new file

You must removed lines 2-4 which generate the following error display

Please remove this line and the "exit" line that follows before deploying this 
file to the "histories" folder.

edit title

You should provide your own title for the tng_header function call in line 27 before removing lines 2-4.

This can be either text entered directly, such as

Your Ancestor's Story

or could be entered as a $text variable, suce as $text[ancestorstory] where the variable in the English/cust_text.php is defined as

$text[ancestorstory] = "Your Ancestor's Story";

and in the French/cust_text.php as

$text[ancestorstory] = "L'histoire de votre ancêtre";

edit log

You must also update line 18 (before deleting lines 2-4) for the log string

$logstring = "<a href=\"/path_to_your_history_folder/this_file_name\">Your Title Here</a>";

with the same text used for the tng_header function call and with the actual path and name of the file you are creating. For example,

$logstring = "<a href=\"/extrapgs/feature1.php\">Your Ancestor's Story</a>";

or as

$logstring = "<a href=\"/extrapgs/feature1.php\">$text[ancestorstory]</a>";


edit page content

You must replace the following text in lines 30-33 with your own text

Your history goes here (do not include a BODY tag). IMPORTANT: In order for links on this page to work, you must edit your custom header, footer and meta files (see General Settings for their specific names) and make sure all file and internal link references are *absolute* and not relative. In other words, the default meta.html file contains a relative link to the style sheet "genstyle.css". To make it absolute, prefix that with the path from your root folder (i.e., "/genealogy/genstyle.css").

For example, you could use something like the following to add a Feature Story for Template 4.

<p class="header">Feature 1 Story</p> This is the story of our first ancestor who came to Quebec (New France) from Joigny, France in June 1665 with the Carignan-Saliere Regiment which had been dispatched by the King of France to Quebec to help fight the Iroquois Indians.

remove pull down menu

If you don't want the pull down menu on your user created page, you can remove the comments ( // ) at the beginning of line 26

//$flags[noicons] = true;

add TNG icons

If you want to add the TNG Home Search Print Login and Bookmark icons on your user-created page, you will need to add

<?php echo tng_coreicons(); ?>

after your header line for example

Feature 1 Story

<?php echo tng_coreicons();

?>

extrapgs subfolder

Since the historytemplate.php is designed to be used in the histories subfolder, you should create a subfolder to save your pages, such as user or extrapgs as shown by Dave Freeman in his word document that explains how to use the historytemplate.php.

absolute paths

The custom header, footer, and meta files should also be using absolute paths.

Most of the templates for TNG 7.0 were updated to use $cms[tngpath] to provide the absolute path.

Extra Pages Document Download

See User Created Pages in TNG Forum which provides a download the Word Document that describes Dave Freeman's process used to create user pages