I have started to look into the structure of MODx so I am able to add new varaibles for my site
It would make sence to have the additional variables within the create/edit document section
mutate_content.dynamic.php
Hopefully someone can point me in the right direction to the process of adding additional content & title fields.
also I have added the new fields in the table "modx_site_content"
tab1 (varchar 255)
tab2 (varchar 255)
tab3 (varchar 255)
tabContent1 (mediumtext)
tabContent2 (mediumtext)
tabContent3 (mediumtext)
Would I need to follow the same process below to add a new content variable & is there a class I need to define these new varaibles in?
<?php
if (($content['richtext'] == 1 || $_REQUEST['a'] == 4) && $use_editor == 1) {
// replace image path
$htmlContent = $content['content'];
if (!empty ($htmlContent)) {
if (substr($rb_base_url, -1) != '/')
$im_base_url = $rb_base_url . '/';
else $im_base_url = $rb_base_url;
$elements = parse_url($im_base_url);
$image_path = $elements['path'];
// make sure image path ends with a /
if (substr($image_path, -1) != '/')
$image_path .= '/';
$modx_root = dirname(dirname($_SERVER['PHP_SELF']));
$image_prefix = substr($image_path, strlen($modx_root));
if (substr($image_prefix, -1) != '/')
$image_prefix .= '/';
// escape / in path
$image_prefix = str_replace('/', '\/', $image_prefix);
$newcontent = preg_replace("/(<img[^>]+src=['\"])($image_prefix)([^'\"]+['\"][^>]*>)/", "\${1}$im_base_url\${3}", $content['content']);
$htmlContent = $newcontent;
}
?>