[TYPO3-dev] [Typo3-dev] [TYPO3] Do you think too many wrap intyposcript template?

Dennis Cheung hkdennis2k at gmail.com
Fri Dec 23 16:10:37 CET 2005


I have read some default typoscript before, included CSS-styled-content.
But I did read cObject before? I must be missed.

I think the cObject may be what I am looking for.
A wrap can do stdWrap attribute.

>Why should I want to use things like
>wrap = whatever|whatever
>wrap.insertData = 1
>when I could use
>dataWrap = {whatever}|{whatever}

Because it can join many different behavior.
It may have many kind of wrap in furture.
e.g.
  1. dataWrap {whatever}|{whatever} with uppercase to {whatever}
 2. highlight a given word
 3. trim from tail
  4. and then removeBadHTML only to the wrap (not the content)
In most case, COA are used. Not a stdWrap, even it is a wrap theory.
Or there will be list of wrap have unique name for all combination.

And, it will be shorter typoscript with stdWrapArray.
e.g.
   xx.value=who
   xx.innerWrap=<b>abc|def</b>
   xx.dataWrap={whateverHead}|{whateverTail}
   xx.outerWrap=<td>|</td>
[condition]
   xx.innerWrap=<b><i>abc|def</i></b>
[global]

With stdWrapArray
   xx.value=who
   xx.1.wrap=abc|def
   xx.2.wrap=<b>|</b>
   xx.3.dataWrap={whateverHead}|{whateverTail}
   xx.4.wrap=<td>|</td>
[condition]
   xx.1.1.wrap=<i>|</i>
[global]
if can apply attribute to wrap
   xx.value=who
   xx.1=abc|def
   xx.2=<b>|</b>
   xx.3={whateverHead}|{whateverTail}
   xx.3.insertData=1
   xx.4=<td>|</td>
[condition]
   xx.1.1=<i>|</i>
[global]

(Martin Kutschker's example like a COA more than a wrap array)






When we have stdWrapArray, will innerWrap and outerWrap repeating same
function? (If I understand stdWrapArray right)

I just want to leran more, and give some comment. Just correct me if I wrong.
My point is, it should have more variable general solution. Not a complex way.
Keep It Simple Stupid.



I know they are almost not used at all.
You don't use it, do not equals to it is not a problem.


Dennis


On 12/23/05, JoH <info at cybercraft.de> wrote:
> >> noTrimWrap is the only way to use wrap without trimming whitespace
> >> before wrapping.
> >> dataWrap can insert many different getText values at once.
> >> outerWrap sometimes is the only way of having an additional wrap
> >> around existing items, because they are already using things like
> >> wrap or innerWrap internally.
> >
> > About the dataWrap, wrap, noTrimWrap
> > There should be an better way to do.
> >
> > e.g.
> > (stdWrap).wrap=xxx|xxx
> > (stdWrap).wrap.insertData=1
> > (stdWrap).wrap.noTrim=1
> > (stdWrap).wrap.escapeHTML=1
> >
> > You don't use wrap and noTrimWrap and dataWrap at same time? didn't
> > it?
> > We are not looking for many different wrap.
> > You want a single wrap, but with different behavior.
> >
> > At least, please somebody update the doc_core_tsref on typo3.org.
> > Let newbie know that they are unused.
>
> As I already told you, they are not unused.
> The fact that you don't use them doesn't mean they are useless for others.
>
> And I don't really get the point.
> You are complaining about too many wraps and that they are confusing or
> misleading.
> At the same time you are asking to not just remove these wraps but insert
> _additional_ parameters to get the same behaviour as before.
> Sorry - but this is even more confusing and it will take more code to
> acchieve the same goal.
>
> Why should I want to use things like
>
> wrap = whatever|whatever
> wrap.insertData = 1
>
> when I could use
>
> dataWrap = {whatever}|{whatever}
>
> instead. And yes I might use dataWrap _and_ other wraps at the same time.
>
> Example:
> innerWrap and outerWrap have stdWrap properties themselves and thus can be
> filled based on a cObject.
> You can do something like
>
> dataWrap = {whatever}|{whatever}
> innerWrap.cObject = CASE
> innerWrap.cObject {
>     key.field = somefield
>     ...
>     a lot of different wraps here
>     ...
> }
> outerWrap.cObject = CASE
> outerWrap.cObject {
>     key.data = GPvar:something
>     ...
>     a lot of different wraps here
>     ...
> }
>
> This way you can have three different conditional wraps that get their
> behaviour from DB fields and/or GPvars.
> Maybe you didn't do something like this before, but it is working perfectly
> fine and is only possible with different wrap-types.
> If you want to see a working example have a look at the implementation of
> the user selectable frames, borders and indentations in CSS-styled-content.
>
> Joey
>
> --
> Wenn man keine Ahnung hat: Einfach mal Fresse halten!
> (If you have no clues: simply shut your knob sometimes!)
> Dieter Nuhr, German comedian
> openBC: http://www.openbc.com/go/invuid/Jo_Hasenau
>
>
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>




More information about the TYPO3-dev mailing list