Is there a way to force Modx to pull a fresh page when logged in for editing?
Goal
---------
I really like the QuickEdit functionality and want to add a custom QuickEdit tags to edit the image href.
Problem
---------
The {*# syntax doesn’t work well inside a HREF. It places html coded inside the HREF. Not so good. So I tried the custom HTML tags. Functionally it worked great. The problem with the custom HTML tags are they are not strict XHTML compliant.
Solutions I tried
----------
In response, I wrote a snippet that checks the session variable. If the user is logged in to edit, then write the custom QuickEdit tag. The newest issue I have is with caching. I need to enable caching throughout the site, but hoped that Modx would turn off caching when logged in and using QuickEdit.
I can’t think of an advantage of editing a cached page versus a non-cached page. I assume after editing, the page would cache on first call.
My Question
-----------
In summary, does anyone know of a setting or code to turn off server side caching if user is logged in for editing?
Thanks,
Quad
Just to clarify ...
I have a chunk called template_image:
[!addQuickEditTag!]
<a title="[*ImageDescription*]" rel="lightbox" href="[*CommonRightLargeImg*]"><img src="[*CommonRightImg*]" alt="[*ImageDescription*]" /> </a>
The call to the snippet addQuickEditTag:
<?php
if($_SESSION["usertype"] == "manager") {return "<quickedit:ImageDescription /><quickedit:CommonRightImg /><quickedit:CommonRightLargeImg />"; }
?>
If I change the call to the snippet from [! !] to [[ ]]], we see the cached version in edit mode. If I keep the [! !], I assume we aren’t cached any more. Right?
I want all the elements of the page to cache 99% of the time for the general users, just not when logged in for editing via QuickEdit. Is there a simple solution to have the snippets pull the non-cached version when logged in as a manager but pull the cached version the rest of the time?
-
MODX Staff
- 12,272 Posts
There are a couple of alternatives to QuickEdit that might be more suited to your needs (I think called quick manager or qm+). QuickEdit is in need of an overhaul in general. Have you explored the alternatives?
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me