We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13734
    • 11 Posts
    I am finding Mod-X really great for modifying html pages with the manager. But is it also possible to use the manager to edit other files like XML files in the same way? Like with simpleviewer gallery it uses an xml file with caption tags etc that you put info in. Could you make the XML file a sort of template, and then use the manager gui to easily change the xml file?

    This would be really great for making my website easily editable
      • 11055 ☆ A M B ☆
      • 3,112 Posts
      You can just browse the Elements > Manage Files
      You can edit everything, when it’s writable.
      Everything.
        Rico
        Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
        MODx is great, but knowing how to use it well makes it perfect!

        www.virtudraft.com

        Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

        Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

        Maintainter/contributor of Babel

        Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
        • 13734
        • 11 Posts
        Didn’t actually realize that, thats quite cool.

        But I was more hoping it could be set up with something analogous to like template variables, so a person with very basic computer knowledge can add text to the correct part of the xml file
          • 4172
          • 5,888 Posts
          I didn’t try that but I think this would work.
          you can use maxigallery for uploading and managing your pictures and manage desriptions or captions for these pictures.
          I’m sure there is a way let maxigallery create the xml-file on the fly for simpleviewer gallery and use it in combination.


          another way may be use subdocuments with image-tv and for example content as caption for each picture and let ditto generate the xml-file.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 4172
            • 5,888 Posts
            I tested creating 2 subdocuments and let ditto generate the xml-file for simpleviewer from these documents. Seems to work:
            http://bruno.tattoocms.de/176.html
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 13734
              • 11 Posts
              Cheers for the helpful replies. Sounds like great ideas.. I’m not entirely sure how I am to carry them out as I am still a newbie to mod-x, but I shall research these concepts like subdocuemnts, ditto etc. they are to go here by the way http://www.eionbryant.com/gallery.html
                • 4172
                • 5,888 Posts
                ok, here you go:

                create a new ressource, which is not on your menu. You can choose contenttype text/xml and template blank.
                pagetitle: simpleviewer.xml
                content:

                <?xml version="1.0" encoding="UTF-8"?>
                
                <simpleviewergallery
                	
                	galleryStyle="MODERN"
                	title="SimpleViewer Gallery"
                	textColor="FFFFFF"
                	frameColor="FFFFFF"
                	frameWidth="20"
                	thumbPosition="LEFT"
                	thumbColumns="3"
                	thumbRows="4"
                	showOpenButton="TRUE"
                	showFullscreenButton="TRUE"	
                	maxImageWidth="640"
                	maxImageHeight="640"
                	useFlickr="false"
                	flickrUserName=""
                	flickrTags=""
                	languageCode="AUTO"
                	languageList=""		
                	imagePath="images/"
                	thumbPath="thumbs/"
                	
                >
                
                [!Ditto? &extenders=`request`&tpl=`simpleviewer`&display=`all`&orderBy=`menuindex ASC` !]
                
                </simpleviewergallery>


                to choose your image in the manager create an imageTV for your template, i named it imagepath
                inputtype: image , nothing else.

                create a chunk for ditto
                name:simpleviewer
                content:

                <image imageURL="[+imagepath+]" thumbURL="[+imagepath+]" linkURL="" linkTarget="" >
                	<caption>[+content+]</caption>	
                </image>

                (in this first step for testing I used the same image for thumbnail and image, I think there are ways to get the thumb dynamic or create the thumb with phpthumb or directresize or something like that.............in a later step)

                at the resource ,where you want to have simpleviewer something like that in your head:
                (modify your path, where you have simpleviewer installed)

                <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
                <script type="text/javascript">
                var flashvars = {};
                flashvars.galleryURL = "[~177~]?ditto_parents=[*id*]";//replace 177 with your resourceID of 'simpleviewer.xml' 
                var params = {};
                params.bgcolor = "222222";
                params.allowfullscreen = true;
                params.allowscriptaccess = "always";
                swfobject.embedSWF("assets/simpleviewer/web/simpleviewer.swf", "flashContent", "800", "600", "9.0.124", false, flashvars, params);
                </script>    


                add subdocuments for each image under these resource and choose your images, add content for imagecaption.
                you can sort them with the module docmanager.
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 13734
                  • 11 Posts
                  Success laugh