Skip to content

Instantly share code, notes, and snippets.

@froemken
Created December 6, 2019 12:21
Show Gist options
  • Save froemken/26e5de562b2266107a07c4d929c3f264 to your computer and use it in GitHub Desktop.
Save froemken/26e5de562b2266107a07c4d929c3f264 to your computer and use it in GitHub Desktop.
How to update, change, modify pi_flexform values and fields in tt_content
UPDATE tt_content
SET pi_flexform = REPLACE(
pi_flexform,
CONCAT(
'<field index="settings.classForTable">',
CHAR(10),
' <value index="vDEF">HpTableST1</value>',
CHAR(10),
' </field>'
),
'<field index="settings.cssClassForPlugin">
<value index="vDEF">HpTableST1</value>
</field>
<field index="settings.cssClassForTableSection">
<value index="vDEF">row</value>
</field>
<field index="settings.cssClassForTable">
<value index="vDEF"></value>
</field>'
)
WHERE list_type='stahlcranesystems_tableview';
@vertexvaar
Copy link

vertexvaar commented Dec 6, 2019

You should definitely go for UpdateXML instead. 😉
BTW: I lately published a XML query gist: https://gist.github.com/vertexvaar/0cb83e53217bd1b477a80c1f42cc09fa and https://xmltoolbox.appspot.com/xpath_generator.html will help you find the correct xpath

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment