I would love to reorganize the library without loosing all the links to the webpage.
Is there any efficient way to do that?
Kind Regards
A content editor for Joomla!®
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
Please create a new Ticket and we will get back to you as soon as we can.
Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Latest post by Ryan on Friday, 29 October 2021 14:58 BST
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. Ryan Demmer
Lead Developer / CEO / CTO
Just because you're not paranoid doesn't mean everybody isn't out to get you.
Ryan Demmer
Lead Developer / CEO / CTO
Just because you're not paranoid doesn't mean everybody isn't out to get you.
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)?
Ryan Demmer
Lead Developer / CEO / CTO
Just because you're not paranoid doesn't mean everybody isn't out to get you.
How is the workflow in the JCE Editor then? Just Cut and paste (e.g. into another folder)?
Ryan Demmer
Lead Developer / CEO / CTO
Just because you're not paranoid doesn't mean everybody isn't out to get you.
Your post is being submitted…