add a space char in Typoscript
Asked Answered
O

4

8

I would like to add a blank/whitespace in TypoScript It concerne a "More"-link in tt_news.

Here's the HTML I have :

<p class="bodytext">blablabla<span class="news-list-morelink">&nbsp;<a title="Read all the news" target="_top" href="http://www.google.com">More</a></span></p>

And here's what I want :

<p class="bodytext">blablabla <span class="news-list-morelink">&nbsp;<a title="Read all the news" target="_top" href="http://www.google.com">More</a></span></p>

(the difference is the whitespace juste before the <span>.

In my opinion, I must make a change in the TypoScript which generates the link "more". That must be where I wrote "HERE"

plugin.tt_news {
 displayLatest{
  subheader_stdWrap {
   #More link after the bodytext
   append = TEXT
   append.data = register:newsMoreLink
   append.wrap = HERE<span class="news-list-morelink">&nbsp;|</span>
  }
 }
}

Does anyone have an idea ? Thanks...

Opponent answered 5/11, 2010 at 14:38 Comment(0)
C
15

Use noTrimWrap instead of wrap:

append.noTrimWrap = | <span class="news-list-morelink">&nbsp;|</span>|

See TSref notrimwrap

Colp answered 5/11, 2010 at 17:36 Comment(3)
…I would never have searched for "noTrimWrap"Ethicize
Do take a stroll around TSRef, in this case the function stdWrap: docs.typo3.org/typo3cms/TyposcriptReference/Functions/Stdwrap/… - there are lots of useful functions. As for noTrimWrap, there is, since 6.1, also the possibility to change the pipe for another splitting character.Colp
Documentation page was moved: docs.typo3.org/m/typo3/reference-typoscript/main/en-us/…Tactile
M
1

My solution was to add:

NO.afterWrap = &#32
Mccomas answered 24/2, 2017 at 15:57 Comment(1)
Please in answer only pass the answer, if you also have question pass it as question (keep'em distinct)Greeting
O
0

I found this technic but I m note quite happy with it

append.wrap = <span></span> <span class="news-list-morelink">&nbsp;|</span>

HTML gurus'll kill me

Opponent answered 5/11, 2010 at 15:35 Comment(0)
U
0

What about

append.wrap = &nbsp;<span class="news-list-morelink">&nbsp;|</span>

?

nbsp will just add a space and no additional span is needed.

Upolu answered 5/11, 2010 at 16:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.