[TYPO3] Typoscript in Templavoila

LinTong pcu84424 at gmail.com
Thu Jul 3 12:35:28 CEST 2008


Hallo Chris

Thanks very much. I found that the documents you mentioned are very
helpful. Is there any tool similar to eclipse which can give me a hint
to sub properties when  I program in TS? Thanks

2008/7/2 Chris <chris at oblady.com>:
> Hello again,
>
> - first, there is one thing that you should delete from your piece of
> code, this line :
> 10.stdWrap.typolink.target.field = field_relatedlink
> I don't think this line generates anything useful ??
>
> - About the "split" function, it is not the one you need : this function
> expects a "separator" character, to split a string into multiple parts.
>
> - For your needs, "crop" (stdWrap.crop) will do :
> http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/5/1/
>
>
> 10 = TEXT
> 10.field = field_topictitle
> 10.stdWrap.typolink.parameter = 6
> 10.stdWrap.typolink.target.field = field_relatedlink
> 10.stdWrap.typolink.parameter.stdWrap.append=TEXT
> 10.stdWrap.typolink.parameter.stdWrap.append {
>  field=field_relatedlink
>  crop= 1|
>  wrap=#|
> }
>
> About documentation or examples, this work is on the way :
>
> http://news.typo3.org/news/article/typoscript-in-45-minutes/
> (not finished, only German, but I guess this will be a must)
>
> http://support.typo3.org/snippets/
> All new, will grow fast
>
> http://typo3.org/documentation/document-library/core-documentation/doc_core_tsbyex/0.0.16/view/
>
> Anyway, you will find lots of examples by Googling, but keep in mind
> that the best is to understand how things work, I myself found lots of
> examples with errors, and most of the time with no explanation :-(
>
>
>
>
>
>
>
> LinTong a écrit :
>> Hallo Chris
>>
>> Thanks very much. The first solution you told me works fine.
>> Could you help me to improve this function? I have modified the typoscript as follow*********************  10 = TEXT  10.field = field_topictitle  10.stdWrap.typolink.parameter = 6  10.stdWrap.typolink.target.field = field_relatedlink  10.stdWrap.typolink.parameter.stdWrap.append=TEXT  10.stdWrap.typolink.parameter.stdWrap.append {  wrap=#|  field=field_relatedlink}******************what i would like to do is thatinput : Aliceoutput: <a href="...index.php?id=6#A">Alice</a>.
>> input : boyoutput: <a href="...index.php?id=6#b">boy</a>.
>> That means the first letter of the input is as an anchor. I tried to use Split function but...I read the TSref carefully but i don't quite understand.
>> Could you recommend some references about tsref which include a lot of examples?Thanks very much.
>>
>>
>>
>>> From: chris at oblady.com> Date: Tue, 1 Jul 2008 15:06:23 +0200> To: typo3-english at lists.netfielders.de> Subject: Re: [TYPO3] Typoscript in Templavoila> > OK, I think i've got it :-)> > let me explain : when the typolink function receives the "page id + # + > anchor number" it expects a content id which is always prefixed by "c" > (w3c compliance : an id can't begin with a number).> > There is another solution which is to make the link differently, like this :> > 10=COA> > 10.1=TEXT> 10.1 {> typolink.parameter=6> typolink.returnLast=url> wrap=<a href="|> }> # 10.1 generates : <a href="index.php?id=6> > 10.2=TEXT> 10.2 {> field=field_relatedlink> wrap=#|">> }> # 10.2 generates #MYINPUT and ends opening a tag> > 10.3 = IMAGE> 10.3.file = fileadmin/templates/img/relatedlink.jpg> # 10.3 : your image> > 10.4=TEXT> 10.4.value=</a>> # 10.4 closes a tag> > ... should work this time !> > Further, to prevent errors if the users don't fill some fields in your > FCE, you should read the
>  "if" documentation in TSRef... that will help> > :-)> > LinTong a écrit :> > Hallo Chris> > > > Thanks very much for you response> > I am sorry that i am a newbie for tsref. and i tried to override the target, but...> > -----------------------------------------------------------------------> > <field_relatedlink type="array">> > <tx_templavoila type="array">> > <title>related topics</title>> > <description>related topics</description>> > <sample_data type="array">> > <numIndex index="0">related topics</numIndex>> > </sample_data>> > <eType>input</eType>> > <proc type="array">> > <HSC type="integer">0</HSC>> > </proc>> > <TypoScript>> > > > 10 = IMAGE> > 10.file = fileadmin/templates/img/relatedlink.jpg> > 10.stdWrap.typolink.parameter = 6> > ***************************************> > 10.stdWrap.typolink.target.field = field_relatedlink> > ***************************************> > 10.stdWrap.typolink.parameter.stdWrap.append=TEXT> > 10.stdWrap.typolink.parameter.stdWrap.app
> end {> > wrap=#|> > field=field_relatedlink> > }> > > > </TypoScript>> > </tx_templavoila>> > <TCEforms type="array">> > <config type="array">> > <type>input</type>> > <size>1</size>> > <eval>trim</eval>> > </config>> > <label>related topics</label>> > </TCEforms>> > </field_relatedlink>> > ---------------------------------------------------------> > But it does not work. the name of the link is still the title of the target page.> > > > Second, the link looks like <a href="...index.php?id=6#cMYINPUT">....</a>. I don't know why there is a character "c"> > > > Thanks very much for your help> > > > > > > >> From: chris at oblady.com> >> Date: Sun, 29 Jun 2008 11:38:05 +0200> >> To: typo3-english at lists.netfielders.de> >> Subject: Re: [TYPO3] Typoscript in Templavoila> >>> >> Hello,> >>> >> first, I didn't notice :> >> <HSC type="integer">1</HSC>> >> means your content is passed through htmlspecialchars...> >> => just delete this line or set it to 0> >>> >>> >> for your link text, b
> y default the typolink does this :> >> typolink.stdWrap.field=title (the linked page title)> >> => you still can use stdWrap over this to do what you need...> >>> >>> >> LinTong a écrit :> >>> Hallo Chris> >>> > >>> Thanks very much for your response.Your code works partly but... at first you can see the source code of XML> >>> *********************************************> >>> <field_relatedlink type="array"> <tx_templavoila type="array"> <title>related topics</title> <description>related topics</description> <sample_data type="array"> <numIndex index="0">related topics</numIndex> </sample_data> <eType>input</eType> <proc type="array"> <HSC type="integer">1</HSC> </proc> <TypoScript>> >>> 10 = IMAGE 10.file = fileadmin/templates/img/relatedlink.jpg 10.stdWrap.typolink.parameter = 6> >>> 10.stdWrap.typolink.parameter.stdWrap.append=TEXT 10.stdWrap.typolink.parameter.stdWrap.append { wrap=#| field=field_relatedlink }> >>> > >>> </TypoScript> </tx_templavoila> <TCEforms type="
> array"> <config type="array"> <type>input</type> <size>1</size> <eval>trim</eval> </config> <label>related topics</label> </TCEforms> </field_relatedlink>> >>> > >>> ************************************************> >>> first problem:It will display as follow:> >>> > >>> <a href="index.php?id=6#cMYINPUT" >Research Topic</a> > >>> > >>> it is not a link. that means in source code it looks like> >>> &lt;a href=&quot;index.php?id=6#c2222&quot; &gt;Research Topics&lt;/a&gt;> >>> > >>> second,the name of the link"Research Topic" is the title of the target page(id = 6). I don't know which part of your code works that way. I would like to display "fixed content"+ MYINPUT.> >>> > >>> Third, you can see there is a "c" in front of MYINPUT. I don't know how it comes.> >>> > >>> in a word, the link should be <a href="index.php?id=6#MYINPUT" >"fixed content"+ MYINPUT</a> > >>> > >>> However, thanks very much for your help.> >>> > >>> > >>> > >>> > >>>> From: chris at oblady.com> Date: Fri, 2
> 7 Jun 2008 18:05:59 +0200> To: typo3-english at lists.netfielders.de> Subject: Re: [TYPO3] Typoscript in Templavoila> > Hello,> > if you read TS Ref, you will see this :> > "Now the input can be an alias or page-id. If the input is an integer> it's a page-id, if it's two comma separated integers, it's a id/type> pair, else it's an alias. For page-id's or aliases you can prepend a "#"> mark with a number indication tt_content record number on the page to> jump to! (if .section-property is present, it overrides this)."> > => if .section-property is present, it overrides this> > means you should code like this :> > <TypoScript>> 10 = IMAGE> 10.file = fileadmin/templates/img/relatedlink.jpg> 10.stdWrap.typolink.parameter = 6> 10.stdWrap.typolink.parameter.stdWrap.append=TEXT> 10.stdWrap.typolink.parameter.stdWrap.append {> wrap=#|> field=field_relatedlink> }> </TypoScript>> > not tested, but should work...> > tell me if it's OK :-)> > LinTon> g > >> a écrit :> > hallo everybody> >
>> > > > I modified an image content element in the XML of DS> > > > <TypoScript>> > 10 = IMAGE> > 10.file = fileadmin/templates/img/relatedlink.jpg> > 10.stdWrap.typolink.parameter = 6> > 10.stdWrap.typolink.section.field = field_relatedlink> > </TypoScript>> > > > this add a link "index.php?6#"+the input of field_relatedlink to the image "relatedlink.jpg". it works fine. > > > > but If i want to have a plain input field. e.g. if i input "aaaa", the output will look like:> > <a href="....index.php?6#aaa">related:(this is fixed) aaa </a>> > if "bbb"> > <a href="....index.php?6#bbb">related: bbb </a>> > > > I tried to write codes similar to the above codes but it does not work. Who could do me a favor to show me the correct typoscript which can be add into the XML of templavoila.> > > > Thanks very much.> > > > _________________________________________________________________> > 新年换新颜,快来妆扮自己的MSN给心仪的TA一个�> ��喜!> > http://im.live> >
>> .cn/emoticons/?ID=18> _______________________________________________> TYPO3-english mailing list> TYPO3-english at lists.netfielders.de> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english> >>> _________________________________________________________________> >>> 用手机MSN聊天写邮件看空间,无限沟通,分享精彩!> >>> http://mobile.msn.com.cn/> >> _______________________________________________> >> TYPO3-english mailing list> >> TYPO3-english at lists.netfielders.de> >> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english> > > > _________________________________________________________________> > 用手机MSN聊天写邮件看空间,无限沟通,分享精彩!> > http://mobile.msn.com.cn/
>> _________________________________________________________________
>> Windows Live Photo gallery 数码相机的超级伴侣,轻松管理和编辑照片,还能制作全景美图!
>> http://get.live.cn/product/photo.html
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english



-- 
Best Regards
LinTong(Pierre)


More information about the TYPO3-english mailing list