XF 2.1 Write with paragraphs

antonino

Active member
Can anyone help me with an annoying problem I have?

I am from Greece and here we are accustomed to leaving a gap in the first line of each paragraph
1.webp

....but the editor does not accept it as you can see.

If i use INDENT accepts it not only for the first line but for the whole paragraph

2.webp

...to bypass it I give an empty line which I then erase, but then losing JUSTIFY

3.webp

Any hint? Someone? Please?
 
It can be forced with CSS but this would apply to everything

 
Ok I can give further instructions later, I’m currently not at my computer, but first is it something you want to happen on all paragraphs for everyone automatically or just those who want it?
 
OK, I cannot find a way to make it happen automatically (maybe somebody can). The problem is the text editor doesn't seem to add paragraph p tags. If somen knows of a way it can do that, then it can be made automatic.

But you can do it with a custom bbcode in your admin panel, see under Content. It's a bit tiresome as you need to add it to every paragraph.


  1. Give the bbcode tag (can be what you want but must be unique, e.g. indent1
  2. Give it a title e.g. Indent 1st line
  3. html replacement <p style="text-indent:50px">{text}</p>

Now when you surround a paragraph with those tags the 1st line is indented

Code:
[indent1]This paragraph will have first line indented by 50px[/indent1]

In the custom bbcode you can choose an icon to go into the text editor bar, which is a bit quicker.
 
The only thing is of course, it is adding a p tag as well as the default way xenfor makes spaces, ie with the <br /> tag. This means there may be large gaps between paragraphs so this may be better:

Code:
<p style="text-indent:50px;margin:0px">{text}</p>

Or if you want it based on the style, use this:
Code:
<p class="indent1">{text}</p>

And put this in the template extra.less for the specific style
Code:
.indent1
{text-indent:50px;margin:0px}
 
Back
Top Bottom