This is related question, but one I couldn’t seem to find an answer to until I can across this thread.
I wanted to edit the [*#template*] field from the site_content table. Seems like it should work as it is part of the Document Object, but I couldn’t seem to get it to work.
Using the tag: [*#template*] shows the correct template, and shows an editable button in Quickedit, but changing the value does not update the template field.
Ideally, what I want is for the #template field to show up on the Quickedit bar, but not on the site, so that the user can change the template for the page.
Finally by adding ’template’ to the editable list in the Quickedit module code...
if(!isset($editable)) { $editable = 'pagetitle,longtitle,description,content,alias,introtext,menutitle,published,hidemenu,menuindex,searchable,cacheable,template'; }
...and by adding this code to the contentVariable.class.inc.php in the switch around line 198 I get options for changing the template!
case 'template':
$type = 'dropdown';
$caption = 'Change Template';
$description = 'Change Template';
$elements = "blog entry==10||blog folder==9";
$group = 'content';
break;
This is perfect for me because I can just list the options for the user to use. I took the [*#template*] tag off the template of course. But I can see where you could construct a string from the template table to list all templates.
I think I’m finally seeing the value of the template variables after using modx for a few months. This is by far the best cms out there, and believe me I have tried a good portion of them in the last two years. You guys should be proud! Thank you.
The one thing I’m stuck on now is how to add an image to the quickedit window when they edit the template dropdown box, so the user can see a representation of each template with a label.