7 users online. Create an account or sign in to join them.Users

Search

“Lorem ipsum dolor sit amet, consectetur adipisicing elit, <br/> sed do eiusmod tempor incididunt <br/> ut labore et dolore magna aliqua.”

Is br inevitable, when writing stuff and want it to be in another row? Can I help myself with something, like some text formater, which would transfer part of the sentence in new row when I click enter.

I’d like text in front end to look nice, like in verses, but in back end as well. Can I acchieve that somehow? :P

Is br inevitable, when writing stuff and want it to be in another row?

Do you have a specific example of when you’d need this? In the interest of forwards-compatibility and operability it’s generally regarded as better practice to not use forced linebreaks but limit the width of the text container. The only time I’ve used linebreaks recently has been for writing type-setting addresses and poetry!

If you use the Markdown text formatter on your Textarea fields you can achieve a linebreak if you so wish (as you can in this forum). Put a double-space at the end of the line, and it will insert a break. For example:

This is line one[double-space-here]
This is line two

Thanks for that useful tip. Every time I come here I learn something new, I didn’t know.

If you are using TinyMCE you can also use ‘shift+return’ for a line break, also called a ‘soft return.’

If you are using Markdown, you must bookmark this:

http://daringfireball.net/projects/markdown/syntax

(Remember that one of the features – obfuscating – won’t work in Symphony, because the XSLT layer will “de-obfuscate”.)

Well, I enabled the Markdown extension, edited the field setting (use Markdown), edited the data source to offer the formatted version of text, I inserted double spaces at the line ends - and it doesn’t work. Now what?

I have just checked the debug version of the page and the br’s are there in the xml stuff.

Do you have any HTML tags in your text output?

The answer is obviously no - if the html tags were there, the lines would be broken…

In the debug xml text, there’s a mixture of p and br tags. The p tags are wrapped around the verses and within the verses there are br tags. Then in the html version all these tags are missing.

ETA: I have figured out just now. I need to use copy-of instead of value-of.

Are you using value-of or copy-of?

See above.

Okay, I’ve got another question related to line breaks and formatting. Do your users tolerate this markup thingy? To be honest I can’t imagine me using double spaces for line breaks in my admin interfaces. I make smaller sites that are not updated very often, and users who log in a few times a month would never remember stuff like that (like this line breaking method).

Do your users tolerate this markup thingy?

It’s just one of many text formatting options, and yes, many users like it a lot.

Whenever I choose a text formatter for my clients I go with Markdown as default.

I have had a few clients who’ve asked for a full WYSIWYG but my response is that the last site I build that uses it I have to go in every once and a while to fix the site when they break it. Most WYSIWYG editors if you paste into them will paste everything, including all the bad code and even javascript. This can break the site very easily and then they have to pay me to fix it.

Once I explain this to them they usually go with Markdown, especially after I show them the format bar and pass them off a full format guide.

This was like; sorted out in first reply. I did what Nick told me and it works perfectly 4 me.

To be honest I can’t imagine me using double spaces for line breaks in my admin interfaces

I think the point is that you should very rarely need single line breaks (see my first comment about addresses and poetry).

If you set your text with double line breaks for paragraphs (as you would typing into this forum, an email or any other document) then you get your line breaks as HTML paragraphs instead.

I think the point is that you should very rarely need single line breaks (see my first comment about addresses and poetry).

You are making assumptions about my content. A lot of my content falls into the ‘addresses and poetry’ category. If I say that I need br then I do need it, believe me.

By the way I would never use a WYSIWYG editor, or any editor with a lot of formatting options for that matter. The users would mess up the pages in next to no time. Haha.

Maybe you should have a look at this: http://github.github.com/github-flavored-markdown/

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details