-
MODX Staff
- 10,725 Posts
There is not currently a feature for this, no.
All due respect that’s weak...
In fact its really not a "preview" as such, this is now a major issue for me as i’m going to have to hack your code to create it...
Really how hard is it go through the document extract the content and current template variables and chuck them into the template??
norki
I don’t think it would be too hard to implement. But it is my understanding that MODx is a developer’s CMS. Most developers have a dev/local build to do modifications and testing before pushing them out live; therefore I doubt this is a super high priority. I know I don’t miss it.
All that really has to be done is create a duplicate saved document and then display it without altering the original:
Here is a hack which can do this for now:
Create a "preview document" my one had id=128
in mutate_content.dynamic.php:
function realPreview() {
document.forms[’mutate’].elements[’id’].value=128;
document.forms[’mutate’].elements[’alias’].value=’’;
document.forms[’mutate’].elements[’pagetitle’].value=’Preview Document (DO NOT DELETE!)’;
var f = document.forms[’mutate’];
documentDirty=false;
f.target = "_blank";
f.refresh_preview.value=1;
f.save.click();
f.target=’’;
f.refresh_preview.value=0;
document.forms[’mutate’].elements[’id’].value=’<?php echo $content[’id’];?>’;
document.forms[’mutate’].elements[’alias’].value="<?php echo stripslashes($content[’alias’]);?>";
document.forms[’mutate’].elements[’pagetitle’].value="<?php echo htmlspecialchars(stripslashes($content[’pagetitle’]));?>";
}
seems to work...
norki
Let me correct my attitude aside from this minor thing... modx is really very nice.
norki