Hi Jeremy,
Indeed that is a problem. The plugins you are using add elements after the content is loaded from the database and just before it is being displayed on the page. When you edit the page in the front-end, those elements actually become a part of the content. When you save the content those elements are stored in the database. The next time the page is loaded the elements are added again.
One solution is to delete those items each time you edit a page.
Another solution would be to generate the plugin output not as a part of the content but by adding plugin functions in your template files. It depends on the plugins if this is possible, and of course it requires some coding.
If this does not work for you I could think about a solution that disables these plugins when the page is being edited. But you will have to be patient, I don’t think I will create this soon.
Others having similar problems? Please share your questions here, so I can think of a solution that works for the majority.
Thread Starter
JPo
(@jrmyprtr)
Thanks Carlo. I’ll deactivate it for now and hopefully you can find a fix.
One possible fix might be to allow admins to exclude certain div ids from displaying when editing a page.
An unrelated question — is there a way to easily switch between editing and viewing? For example, being able to click on links within content?
Hi Jeremy,
Actually that is a good idea. But I don’t plan to add it to DirectEdit, because I want to keep it simple. Instead, just insert this javascript on your page and it should work. Replace ‘#my-div’ with your own selector.
jQuery(function () {
if (jQuery.directEdit) {
jQuery('#my-div').remove();
}
}
If you include this script in direct-edit-custom.js it wil only be loaded for admin users.
No, there is no way to switch between edit and view mode. In edit mode links can still be tested using CTRL click, the link opens in a new tab for most browsers.
He Jeremy,
Did that javascript work for you?
Issue appears to be resolved.
I found a solution for your side-question also. There is a great plugin “user-switching”. After you install it, you will find in the front-end just below the log-out link a new link “switch off”. You will see the website as an anonymus visitor then. At the bottom of each page there will be a link “switch back to admin”.
Thread Starter
JPo
(@jrmyprtr)
Hi Carlo,
I didn’t try the javascript. I don’t like editing plugins.
Thanks anyway.
Jeremy