Zum Inhalt springen

Modify a template source

Erstellt am 6. Oktober 2003 · 5 Antworten · letzte Antwort am 9. Oktober 2003

Tags: Frage, English

Pilaf ·

Hi, I would like to modify a template source which is in "Include Statics" .
I can't find where it could be editable.

thanks a lot.

Romain. o.O o.O

tmallee ·

Just include the template and have a look at the source using the Template / Template Analyzer (simply click the template link in the tree view). You can overwrite any template setting in the setup field (or constants) of your template.

Example:

The template for the plugin tt_news defines color1 by default as a constant (included automatically when using the News extension):

plugin.tt_news {
    color1=#cccccc
}

Maybe you don't like this color. This can be easily changed by making the approptiate setting in your constant field (Template / Info Modify / Constants):

plugin.tt_news {
    color1=#eeeeee
}

Now the value for color1 is no longer #cccccc but #eeeeee. This also works for more complex functions. So it is not necessary to change the template source code when you can overwrite any settings (this is similar to the object orientated approach).

Hope this helps.

Regards

Thomas

Pilaf ·

Hi, thanks a lot for your answer but I think you don't understand my problem.
I can edit and modify a template that I do but if I want to modify a template which is record, like Candidate, green etc.. And I can read globals and setup but never find where the source is editable. M template only appear when I'm in Info/Modify in Include Static.

Hope you can resolve that case too 😉

Thanks a lot, Romain.

tmallee ·

Static templates are stored in database table static_template. You can edit the records by using phpMyAdmin (make sure that BLOB fields are editable, you will have to modify the config file for phpMyAdmin, see phpMyAdmin for further details).

Though it is possible I would not recommend to change the static template records that come with Typo! A much better solution is to build your own static template using the code from another static one (just copy and paste the code).

Regards

Thomas

tmallee ·

Still another suggestion: the HTML Files corresponding to the static templates are located in the directory media/upload.

Thomas

Pilaf ·

Thanks a lot for your answer. I'll look on the database and do like you say.

++, Romain. 😃 😃