Discussion:Typo3 Template Extension

De FrozenWiki
Aller à la navigation Aller à la recherche

Personal Notes

ADD AT THE END OF THE DOC A REFERENCE ON WHAT EACH TEMPLATE LOOKS LIKE (USE ALL TSCE SCREENSHOTS)


CrCPH :

      1. LOGOIMAGE### media/uploads/crcph/logo.gif
      2. PILIMAGE### media/uploads/crcph/pil.gif
      3. HOMEIMAGE### media/uploads/crcph/home.gif
      4. SEARCHIMAGE### media/uploads/crcph/search.gif
      5. PILIMAGE2### media/uploads/crcph/pil2.gif
      6. TOPARROWIMAGE### media/uploads/crcph/toparrow.gif

document the process to convert that with tags... (with the :

constants: variable = EXT:extensionkey/files/image.gif

setup: marks.SUBPART = {$variable} )


===> HOW DO I MAKE AN EXT FROM A TEMPLAVOILA TEMPLATE ????

==> Write doc on how to create modifiable constants in the template ==> tell where to find the small '1', '2' '3'... numbers to copy/paste to the screenshot you would have made of a sample site. Also tell people what size and name the screenshot(s) should have. How to create different sections, and different screenshot sections. (TSCE)

static templates are stored in :

- static_template DB (uid, pid, tstamp, crdate, title, include_static, constants, config, description, editorcfg) - they belong to the id0 page (list module)


they are made of :

- title : title - constants (text) : constants - setup (text) : config - dependencies on other templates : include_static - description (text) : description - backend editor configuration (text) : editorcfg

all of these can be seen in the id0 page details....

  • CONVERSION:

- 1st of all you need to create an empty extension. Just fill in the "General Info" details (screenshot), update, view result, and save the extension. That is all that will be done with the extension kickstarter.

- create a directory per template

- create:

  - constants.txt
  - setup.txt
  - include_static.txt : is a CSV of the uid for the included templates... (found with:

SELECT title, include_static FROM `static_template` WHERE title LIKE 'template%' )

- take all images and store in to the "TSCE/" subdirectory (explain directory structure). The Tstemplate config editor extension has images about the template. Copy these over AS WELL: <webroot>/typo3/ext/tstemplate_ceditor/gfx/... as TSCE_<imagename>.gif

replace their references by EXT:<extname>/<templatename>/EXCE/<imagename>.gif

- look in the template all references to files and copy them to the "files/" directory

(example of styles.gmenu_layer.green - 75 content(default) - 43 plugin.meta [DEPRECIATE] - 68

- in the ext_tables.php you NEED TO HAVE the first argument of addstatic as $_EXTKEY OTHERWISE THE TEMPLATES WILL NOT APPEAR ANYWHERE AND NOT BE WORKING !

if the template depends on a specific static template that will never be used outside of it, then include it into the template extension (e.g here the styles.gmenu_layer.green).

find references to external files in the template constants & setup (e.g media/images/...) and store them to a "files" directory. Replace then their reference by something like EXT:extname/files/filename

NOTE: tmpl_green has a bug where the numbers in the CONSTANT editor configuration have been deleted. KEEP THEM IN THERE !! 1 = blabla 2 = blabla 3 = blabla

The inclusion of the template is done by the creation of ext_tables.php (see example)

t3lib_extMgm::addStaticFile($_EXTKEY,'static/','GREEN (extension example)');

1st arg = extension key

2nd argument is path to: - setup.txt - constants.txt - include_static.txt - editorcfg.txt $path is the path where the template files (fixed names) include_static.txt (integer list of uids from the table "static_templates"), constants.txt, setup.txt and editorcfg.txt is found (relative to extPath, eg. 'static/')

3rd = title in selector box

my QUESTIONS:


locallang ? ext_locallang ?

it would be great if we would have a include_static_files.txt where you could specify the inclusion of other template files, to build some kind of library... Currently a library can only be built from static templates. or by manually including a sequence of templates from the template building record


STATUS:


ESCAPING is done through markers (see newsletter example...)

      1. PASSED OK ###

green/ -- DONE -- TESTED candidate/ -- DONE -- TESTED gluck/ -- DONE -- TESTED tu/ -- DONE -- TESTED mm/ -- DONE -- TESTED business/ -- DONE -- TESTED hyper/ -- DONE -- TESTED re/ -- DONE -- TESTED bug/ -- DONE -- TESTED first/ -- DONE -- TESTED newsletter/ -- NEEDED ESCAPING OF VERTICAL LINE (also removed height="100%") -- TESTED crcph/ -- NEED ESCAPING OF AN HTML FILE --> add the TSCE header for the new image variables in constants.txt


not in 'Include static:' anymore, but in the other one (see screenshot)


LEAVE gmenu_layers.php where it is...