NPT files contain sections of code, [[ in double square]] brackets ( or [[= code ]] brackets), that represent sections of code that are processed when publishing. Besides the code you see in the NPT itself you should look at the series of NP files prefixed "dynamic_" that you will find in the /global/en/libraries/ sub-folder of NP's /webroot/. Notice that NPT files reference one or more of them at the head of the file.
Some of the [[code]] sections are conditional, such that if a certain choice is not set or a condition met, that section of code is not exported to the output NP template. You will find a number of those settings get saved in the XML files in the master set.
An NPT master will contain a site.xml in its root folder and a page.xml in each page templates folder. These files hold most of the settings you'll make in NPA, for instance the fields you've chosen for display, the source of detail (preview) images, etc. The XML is basic text so can be opened and viewed in Notepad or TextEdit.
NPA only allows 4 basic styles of template that you can modify via NPA on-screen controls: search, results, details and collection. However any of these type folders can also contain other NPT files that NPA will process. For instance many of the supplied template sets' details folders hold both a detail.npt and a view.npt. You can put as many templates in as you need though clearly you've less scope for alerting the non-standard ones.
As many as you like. The supplied sets have 4 variants per page but you can have as few as one or as many as you like. In fact once you've chosen a type per page you can help yourself cut unnecessary upload time by weeding unused assets - e.g. button artwork is your templates use HTML text links.
Certainly. The best way to see what's possible is to deconstruct the supplied templates.
Yes, just copy the size and format of existing assets. Look at the XML files to see how they are referenced. Image files all live in the /media/ sub-folder.
Yes. When you first set things like the logo or welcome HTML, these assets are added to the template folders when the site is saved. The logo goes to the /media/ folder and header/footer/welcome HTML files are placed in /resources/. A current bug means NP doesn't extract the body content, so to avoid output having nested HTML pages (not 'legal' HTML code) strip everything from the start of the code to the start of the main body copy (text) and the closing </body></html> tags.
Poor cross-referencing of the overall "dynamic_" series of files. You could edit these if you're sufficiently JS-expert but note you'll need to back-up your versions before adding any client updates. Unless you need to constantly fiddly with NPA settings you're best off getting as close as you can and then editing the NPT files - if necessary creating custom NP libraries to do your extra work. Bear in mind that if you support others in a multi-seat/multi-site environment such customisation will want careful planning, deployment and maintenance.
Keywords (to assist indexing/searching):
Question: Template Master Sets (NPTs) [FAQ00370.htm]
Last Update:- 27 November 2006
Site and articles © Mark Anderson 2001-2007 - Visit my home page