[TYPO3] Customizing templates

Christopher Torgalson bedlamhotel at gmail.com
Thu Apr 12 17:12:57 CEST 2007


Hello again,

On 4/12/07, tonix (Antonio Nati) <tonix at interazioni.it> wrote:
> At 16.54 11/04/2007, Christopher Torgalson wrote:
> >Hi,
> >
> >On 4/11/07, tonix (Antonio Nati) <tonix at interazioni.it> wrote:
> > > At 17.03 09/04/2007, Andrew Davis wrote:
> > > >you could ebable/disable the printable page link using conditions in
> > > >your template, that way you will only need one.
> > > >
> > > >look for conditions in the newsgroup for more help
> > >
> > > I'm serching massively in manuals, but I cannot find a very basic
> > > example about:
> > >
> > > - definition of a variable, like
> > >          PagePrint.enable = 1
> > > inside TS config of the page. Is this enough or there is other to add?
> > >
> > > - usage of that variable inside a condition within the template setup:
> > >          [PagePrint.enable = 1]
> > >          ....
> > >          [end]
> > > I feel this is not enough, but I cannot guess what other params I
> > > have to add in order to have it working.
> >
> >
> >More reading is in order. A couple of things stand out in your message:
> >
> >1. TS and TSconfig are different. If you are really putting things
> >like this in TSconfig field, you should know that, even if the code
> >above was correct--it isn't--it would never work if you put it in that
> >location.
>
> Thanks.
> Is there any concise architectural view of typo3, explaining each
> section job? Not a long  manual going always around the problem, but
> never inside it.


Well, there are specific manuals covering both TS and TSconfig [1],
[2], [3], [4], [5]. If you want the one-sentence explanation, TS is
for configuring FE output, and TSconfig is for configuring the BE both
in general, and also for specific users and groups.


> >2. YOU CANNOT SIMPLY INVENT TS AND EXPECT IT TO WORK. Sorry for
> >shouting, but as far as I am aware, there is not and never has been
> >any such thing as "PagePrint.enable." What did you expect to happen?
> >How did you expect the system to interpret an arbitrary value? TYPO3
> >is a CMS, not an AI...
>
> I have to do this way. As no manual explains clearly basic things,
> I'm forced to ask directly what I'm looking for.


Sorry, but if you insist on this approach, you will /never/ succeed
with TS. ALL Typoscript properties can be found in the TSref and in
the manuals of extensions. If you don't see it in one of these places,
there's no point using it because it WILL NOT WORK.


> Typo3 is a framework more than a CMS, so all the power of generating
> and using objects/datatypes/templates/etc should be explained a lot
> more clearly.


Maybe so. What are your SPECIFIC suggestions?


<snip>


> >1. Re-read the TSref section on conditions
>
> Done. But no part is telling me how I can introduce a
> field/variable/definition that can be used inside conditions (if it
> can be done :-) ).


You can't have read it that closely, or you'd have found that
conditions can be user-defined in php [6]


> >2. Read about how to actually /use/ the TSref effectively (doesn't
> >cover conditions, but should help you understand why you can't just
> >invent TS properties and how to find a function, property or object
> >that does what you need it to do) [1]
>
> I don't see anything explaining what datatypes are really, how they
> can be created and used, which is the influence of a datatype created
> in PHP but used in TS (and viceversa), how they can be used in the
> various Typo3 sections.


This is because, generally speaking, datatypes are NOT created; the
existing ones are employed. Datatypes tell you two things:

1. the nature of the expected input
2. how that data will be processed


> I mean, there is nothink explaining the base bricks of typo3.
>
> This is the TSref manual.

<snip>


Well, one problem is that the TSref is NOT a manual. Its job is not
really to explain how to use TS. That's the job of the TS by example
[3].


> But I need to know where to define my variables, how to exchange them
> with PHP, how they are used within various TS sections.


Well, after a while, you may be surprised how little it is generally
necessary to use php, but try to figure out the USER cObject [7]--and
pay particular attention to the userFunc property of the USER
cObject--the files it refers to are present in the TYPO3 source, so
you can try them out and see how they work. The actual path (from the
webroot) is not media/... but typo3/sysext/cms/tslib/media/...


<snip>


> >5. Decide what condition must be satisfied to show a printable view
> >(choose from among the conditions in the TSref--is it a GET paramater
> >in the URL? a particular page id? a particular page type?)
>
> GET parameter type, as usual. But I want it to work only on selected pages.
> Selected page whould have something enabled and template should
> display print version only if that page is enabled (and type
> requested is 98 of course).


Well, again, you could use conditions to show an object only on certain pages:

[globalVar = TSFE:id = 1,3,5,7,9]
lib.printLink >
[global]

...or you could use a CASE cObject [7] or the .if function [8].


> Now I can do it all using another template, added to the page.
> But I'd love to see if Typo3 let me easily make ONE unique
> customizable template for the whole site. In this way I want to add
> specific features on the template, and enable them on a page by page
> basis using "something" in the TSConfig section of each page.


Using the objects/methods referred to above, this is already quite
possible--but not if you use the TSconfig section!



-- 
Christopher Torgalson
http://www.typo3apprentice.com/


[1] http://typo3.org/documentation/document-library/core-documentation/doc_core_ts/4.0.0/view/
[2] http://typo3.org/documentation/document-library/core-documentation/doc_core_tstemplates/current/
[3] http://typo3.org/documentation/document-library/core-documentation/doc_core_tsbyex/current/
[4] http://typo3.org/documentation/document-library/references/doc_core_tsref/current/
[5] http://typo3.org/documentation/document-library/references/doc_core_tsconfig/current/
[6] http://typo3.org/documentation/document-library/references/doc_core_tsref/4.0.0/view/4/1/#id2798914
[7] http://typo3.org/documentation/document-library/references/doc_core_tsref/4.0.0/view/8/22/
http://typo3.org/documentation/document-library/core-documentation/doc_core_tsbyex/0.0.16/view/5/1/#id2852461
[8] http://typo3.org/documentation/document-library/references/doc_core_tsref/4.0.0/view/5/7/


More information about the TYPO3-english mailing list