Search

A new Extension, “Textformatter Labels” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

[EDIT]: The Markdown Labels extension has been removed and is no longer supported. Driven by community impact, I have tried and come up with a more “Symphonese” solution, the Textformatter Labels extension. (Github Repo) [EDIT END]

Working on rather big sites with dozens of sections I could somtimes hardly remember the formatting preference for all the sections’ textareas. Some used Markdown, some used Markdown Extra, and some had no formatter appended to them.

Additionally, providing online documentation for Markdown has proven to be very useful for authors. On several websites I created custom-tailored documentation pages for Markdown. But where to put the link? I used to put it on the website frontend (for logged-in users only), but to be honest: The backend (e.g. edit pages) is a much better place!

So I created the Markdown Labels extension. It will append text formatter information to Markdown-enabled textareas on edit pages. These “Markdown labels” may be text-only (reminding the author which formatter he may use in a textarea), or even linked text which is rather useful for linking to online docúmentation.

Version 1.0 is hard-coding target="_blank" into links. If anyone hates this, I will add a configuration option for this.

Since I am still at a beginners’ level in PHP, I would be glad to hear critique about the codebase. Any idiotic, over-complicated or dull constructions? Please let me know.

Thanks for this. Even I have trouble remembering markdown syntax. This will make it easier for clients to accept markdown over other text editors.

Markdown is king. There have been many discussions here. But none of those “What-you-mean-is-what-the-f…k-is-happening”-Editors has ever convinced me. Well, WMD (which is used here in this forum) is rather good, but Lewis said that you won’t manage to have more than one instance on a page…

So Markdown is king.

Wow great idea! It would be good if it could have Textile info as well. We always have trouble remembering if a particular text field is formatted using Markdown or Textile so it would be super awesome to have a little textual reminder next to the textarea.

@Henry: It should be possible to have a “Textile Labels” Extension running even in parallel to the Markdown Labels extension. I will think about the transcribing effort. Shouldn’t be too hard. I’ll probably come back tomorrow.

Are you using the Textile Plus formatter by Rowan Lewis?

@Henry: I’ve put something up for you: The Textile Labels Extension. [EDIT]: The link is dead. I have removed this extension from Github - see below.

The only Textile formatter I could find was the Textile Plus formatter. If there are others, please let me know. They will be added.

I do not think there will be any problems running this extension together with the Markdown Labels extension. (Although I do not think is is a good idea to confuse authors by using two different formatting languages on a website. Different story…)

I hope you like the extension!

Henry’s impact made me think about the solution(s) provided by these extensions. The result is: They are not “Symphonese”. Hardcoding any logic of existing and/or combined textformatters (like I did in the Markdown Labels Extension) is not future-proof. Having several extensions for several formatters is a bad idea. If you are using “combined” formatters like “Markdown Extra plus Smarty Pants”, it will not be of great help for the author to have several links in a row. The author would appreciate finding a single link to a custom page explaining this special formatter combination.

So I did a complete rewrite, including the following features:

  • auto-detection of available Text Formatters (that’s cool, isn’t it?)
  • a single auto-generated Textformatter Label per Textarea

This rewrite greatly simplified the code as well. It is therefore considered the successor of “Markdown Labels” and “Textile Labels”, which both have been removed from the Download Area and from Github.

I will upload the all-new Textformatter Labels extension on Github in a few hours. I hope you will like it.

Bravo Michael, this looks amazingly useful! To have it “just work” is a big bonus. It means you don’t need to update it, and the user doesn’t nee to configure anything. I took the same approach with the new Uploadify extension — my single aim was that it had to work with any upload field, otherwise it ties you down to a single choice elsewhere.

Well, actually you will still have configuration options in the Symphony preferences. By default the extension will simply display the text formatter names, but you may define an alternative text to display as well as a link URL. You will find those two options for each available text formatter. Once you uninstall a formatter, the options will be gone (and erased from the config file upon saving the prefs).

OK, here it is, the successor to my (already discontinued) “Markdown Labels” and “Textile Labels” extensions. This extension is so much better, and the code is dead-simple! (Music is swelling…):

Textformatter Labels

I am rather proud of this. Am I starting to learn PHP? (I thought that I would never go there…)

Did I mention that I love Symphony?

P.S. Thank you, Nick.

Great, I have used tooltips before to fetch the short documentation of its page and display it in place as they hover the links, so they dont even have to leave the page. (in my case it was a frontpage edited page, with tooltips to chapters of the docs , that were also at the bottom of the page)

Maybe since now we have jquery, this migth be a nice added featue out of the box? or do you prefer a back to what you were editing link on the docs page (that functionality could be added to, supply a param with back link)

Rock on Michael, nicely done!

Thank you, Lewis.

Since my documentation pages are rather long, I never thought about a tootip or modal-box solution. But if there is a demand for it, well, yes, this could be implemented.

@newnomad: Does the link not open the documentation page in a new window for you? It is supposed to do so, so you can read the docs, then simply close the window/tab and continue working.

michael I assumed ‘open in new window’ isnt valid xhtml and thus never used in symphony?

You are right that it is not valid XHTML if you implement this like I did (by using target="_blank"). It’s dirty. I could change this open a new window using JavaScript, which is what most people do on websites. The XHTML would be valid then – before JavaScript is applied… The result is nearly the same.

I do not think that this is a big problem in the backend. And even on the frontend of a website I often implemented the JavaScript solution for clients insisiting on opening new windows for outbound links. While I am convinced that generally one should not do this, I simply have to face reality here.

So be warned: This extension will not produce valid XHTML. If you want, I can change it to use JavaScript, but in my eyes this is not much better.

It’s OK, the Symphony back-end doesn’t output XHTML anyway (check the DTD in the source) to target="blank" is perfectly acceptable. However in the interest of forwards-compatibility and the potential move to XHTML or HTML5, JavaScript would make sense.

Textformatter Labels updated to version 1.0.1 on 2nd of December 2009

Textformatter Labels updated to version 1.1 on 11th of February 2011

Textformatter Labels updated to version 1.2 on 18th of December 2011

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details