We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32241
    • 1,495 Posts
    That sounds really cool to me, for now I will just setup an admin page and have a link pointing to that pages, and I will also hack to the core a little bit I guess smiley
      Wendy Novianto
      [font=Verdana]PT DJAMOER Technology Media
      [font=Verdana]Xituz Media
      • 33393
      • 30 Posts
      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.
        "Adversus solem ne loquitor." -don’t speak against the sun (don’t waste your time arguing the obvious) Something I sometimes need to be reminded of.
        • 1764
        • 680 Posts
        Well it looks like you’ve got it pretty much figured out. With the next release I’ll definitely try to get the Template in there as a setting.

        For the images associated with each template you’d have to hack things up a bit and create another type of TV input that used images in some way.
          • 33393
          • 30 Posts
          For the images associated with each template you’d have to hack things up a bit and create another type of TV input that used images in some way.

          That’s what I was just thinking... adding a custom element type in the tmplvars.inc.php file. Radio buttons with a picture beside it? I’ll just have to see how much I can mess up my installation of modx...
            "Adversus solem ne loquitor." -don’t speak against the sun (don’t waste your time arguing the obvious) Something I sometimes need to be reminded of.