You need to be logged in to post in the forum - Log In
An active JCE Pro Subscription is required to post in the forum - Buy a Subscription
Support is currently Online
Official support hours:
Monday To Friday
From 09:00 To 17:00 Europe/London (BST)
From 09:00 To 17:00 Europe/London (BST)
This could technically be done, but it would not be a feature of JCE, as JCE does not update or alter any database content except it's own.
The best way to do this would be with a plugin, that responds to a JCE Filesystem Event, and then searches database content, eg: the Article Manager #__content table, for url values to replace. For example:
As you can see this is quite complex (and untested!!), and this is for only renaming a single file, so doing this for multiple files, in a cut/paste operation for example, might be quite intensive.
The best way to do this would be with a plugin, that responds to a JCE Filesystem Event, and then searches database content, eg: the Article Manager #__content table, for url values to replace. For example:
public function onWfFileSystemAfterRename($result)
{
$db = JFactory::getDBO();
if ($result->state) {
$before = $result->source;
$after = $result->path;
// make the paths relative, eg: images/forest.jpg
$before = mb_substr($before, mb_strlen(JPATH_SITE));
// trim leading slash
$before = ltrim($before, '/');
$after = mb_substr($after, mb_strlen(JPATH_SITE));
// trim leading slash
$after = ltrim($after, '/');
$query = $db->getQuery(true);
$word = $db->quote('%="' . $db->escape($before, true) . '"%', false);
$query->select('id, introtext')->from('#__content')->where('introtext LIKE ' . $word . '');
$db->setQuery($query);
$rows = $db->loadObjectList();
$table = JTable::getInstance('Content', 'JTable');
foreach($rows as $row) {
$row->introtext = str_replace('="' . $before . '"', '="' . $after . '"', $row->introtext);
if ($table->load($row->id)) {
$table->introtext = $row->introtext;
$table->store();
}
}
}
}
As you can see this is quite complex (and untested!!), and this is for only renaming a single file, so doing this for multiple files, in a cut/paste operation for example, might be quite intensive.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
This could technically be done, but it would not be a feature of JCE, as JCE does not update or alter any database content except it's own.
The best way to do this would be with a plugin, that responds to a JCE Filesystem Event, and then searches database content, eg: the Article Manager #__content table, for url values to replace. For example:
As you can see this is quite complex (and untested!!), and this is for only renaming a single file, so doing this for multiple files, in a cut/paste operation for example, might be quite intensive.
The best way to do this would be with a plugin, that responds to a JCE Filesystem Event, and then searches database content, eg: the Article Manager #__content table, for url values to replace. For example:
public function onWfFileSystemAfterRename($result)
{
$db = JFactory::getDBO();
if ($result->state) {
$before = $result->source;
$after = $result->path;
// make the paths relative, eg: images/forest.jpg
$before = mb_substr($before, mb_strlen(JPATH_SITE));
// trim leading slash
$before = ltrim($before, '/');
$after = mb_substr($after, mb_strlen(JPATH_SITE));
// trim leading slash
$after = ltrim($after, '/');
$query = $db->getQuery(true);
$word = $db->quote('%="' . $db->escape($before, true) . '"%', false);
$query->select('id, introtext')->from('#__content')->where('introtext LIKE ' . $word . '');
$db->setQuery($query);
$rows = $db->loadObjectList();
$table = JTable::getInstance('Content', 'JTable');
foreach($rows as $row) {
$row->introtext = str_replace('="' . $before . '"', '="' . $after . '"', $row->introtext);
if ($table->load($row->id)) {
$table->introtext = $row->introtext;
$table->store();
}
}
}
}
As you can see this is quite complex (and untested!!), and this is for only renaming a single file, so doing this for multiple files, in a cut/paste operation for example, might be quite intensive.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
I have made this into a plugin for testing - https://github.com/widgetfactory/wf-filesystem-sync-content
It works with renaming files and folders, and cut/paste of files and folders. It currently only supports Joomla Articles (com_content) and has only been tested in Joomla 3.x
It works with renaming files and folders, and cut/paste of files and folders. It currently only supports Joomla Articles (com_content) and has only been tested in Joomla 3.x
Just because you're not paranoid doesn't mean everybody isn't out to get you.
Hi Ryan,
is this (https://github.com/widgetfactory/wf-filesystem-sync-content/releases/) already implemented in the Pro Version?
How is the workflow in the JCE Editor then? Just Cut and paste (e.g. into another folder)?
Thanks a lot,
Dennis
is this (https://github.com/widgetfactory/wf-filesystem-sync-content/releases/) already implemented in the Pro Version?
How is the workflow in the JCE Editor then? Just Cut and paste (e.g. into another folder)?
Thanks a lot,
Dennis
is this (https://github.com/widgetfactory/wf-filesystem-sync-content/releases/) already implemented in the Pro Version?
This is an optional plugin because it is expermiental. It also only works with com_content (Article Manager).
How is the workflow in the JCE Editor then? Just Cut and paste (e.g. into another folder)?
It is triggered from JCE Filesystem Events - move and rename - and updates the database with the changed path/name.
JCE Pro does now include something similar or the current editor content (introduced in 2.9.11) see URL Sync - https://www.joomlacontenteditor.net/news/jce-pro-2-9-11-released
Just because you're not paranoid doesn't mean everybody isn't out to get you.
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!