Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert locallang values into TypoScript [stdWrap]

I wonder if it is possible to insert a locallang value into my typoscript wrap / stdWrap object:

I have:

singleView {
   related.wrap = <div class="related">Related items: |</div>
}

What I need is something like that:

singleView {
   related.wrap = <div class="related">{LLL:related_items}:|</div>
}

EDIT:
What I am looking for is an TS equivalent for $this->pi_getLL (which works fine). In our case, we would be replacing values in our extension with
$this->cObj->stdWrap($item, $this->conf['singleView.']['related']);

locallang.xml in extensions /pi1 directory:

<languageKey index="default" type="array">
    <label index="related_items">Related items: </label>
</languageKey>
like image 404
Mateng Avatar asked Nov 22 '25 14:11

Mateng


1 Answers

singleView {
   related.dataWrap = <div class="related">{LLL:EXT:myextensionkey/pi1/locallang.xml:related_items}:|</div>
}

Of course related_items must be a valid locallang key.

Edit: Do not use wrap with insertData here, because insertData is then run on the whole content, including the user input. If somebody uses {DB:be_users|0|password} inside the content you are wrapping, he can just see the password (hash) of the backend user with uid 0.

like image 154
pgampe Avatar answered Nov 25 '25 10:11

pgampe