Search

Hi, and thanks for taking the time to read this :)

We're writing a CMS to provide customised policies for companies.

We're trying to take some text from a Markdown field in a section, and replace all instances of the word "Company" with the actual company name.

So far: we can do this, but the formatting provided through Markdown disappears. Without using the replacement utility, the formatting is OK, but the company name is not replaced (obviously).

The code is here: http://xpathr.com/view/3993747/. The replacement utility is at the bottom of the XSLT text field.

Please only look at the part which is trying to do the replacement for the actual policy statements, not the Introduction or other parts, which are not as far advanced (they have a few issues which we've already solved in the policy statement section).

The output currently displays each policy statement twice to illustrate the issue: "Company" replaced with "The Happy Factory" in the first instance, but HTML tags removed; and "Company" not replaced, but tags OK, in the second instance.

NB: We have identified that if the search string is not found, the formatting is not damaged by the search operation; but if it is found, all HTML tags vanish.

Any suggestions would be very gratefully received!

abeta - you can make life simpler look at Templated Text Formatters. Create a new regex formatter which does a replace of Company with Your Company Name. Then create another formatter which would be made up of your custom formatter + markdown.

This way between installs you just have to change the formatter and the names would change on their own

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