We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49515
    • 184 Posts
    Hello, I need to edit my MODX website, however I cannot find the file with the code to be edited?
    I search on Chrome > Inspect element and I see the code to be edited.
    I navigate to the website's File System from files I pulled to my local computer and search in the .php file that my notes show had the code, but the code is not there?

    I've tried some root searches from root/$ grep -r image_1, but no results.

    I think I'm searching the correct way, as the MODX Dashboard doesn't really offer much search capability I understand.
      • 22840
      • 1,572 Posts
      If it's MODX it's very unlikely that it will be in any files, if it's page content look in the pages in the left hand tree, if not in there it will either be a TV or a chunk depending on how it's been built.
      • The last few versions of MODX don't have the original search function in the menu, but it's quite easy to add. In the Tools menu (the gear on the right) go to Menus, then Create Menu.

        Fill out the form like this:
        Parent: Content
        Lexicon Key: search
        Description: search_desc
        Permission: search
        Action: search
        Namespace: core
        Icon: images/icons/context_view.gif
        


        You will need to refresh the page in your browser to see the new menu item in the Content main menu.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 49515
          • 184 Posts
          Quote from: paulp at Jul 03, 2015, 11:27 AM
          If it's MODX it's very unlikely that it will be in any files, if it's page content look in the pages in the left hand tree, if not in there it will either be a TV or a chunk depending on how it's been built.

          I think I've found the file handling the code.
          It's nowhere in MODX.
          The file is in the website file system under domain.com/www/file.js and file.php.
          These 2 files do not have the same code that is output on the home.html page though.
          Quite confusing.
            • 49515
            • 184 Posts
            k, I think I've found the file.
            No where in MODX.
            There's a non MODX website file in www/file.js and file.php which I have to edit.
            Terrible code, so I think I might try a new Carousel package. Maybe MODX has something that's EASY?
            Sorry, I should clarify when I say easy...I mean easy documentation to read where the clear and specific paths are to code and install files.
            MODX has been quite helpful, but some others become a guessing game to find stuff, rather than actual coding.
            • MODX runs entirely from its index.php file. All other files (core) are included as necessary. Your page content, and the elements (templates, TVs, chunks, snippets and plugins) are primarily stored in the database. The PHP code of snippets and plugins are included into the running MODX object. Often snippets and plugins have class files, these are all found in core/components/add-on-name/. Again, these files are included into the running index.php file.

              The web server is configured to load that index.php file if it cannot find a requested file or directory. So for example if you have domain.com/about.html, that does not exist. So the server loads the index.php file, domain.com/index.php?q=about.html. MODX now looks at that q=about.html, and looks for a resource with an alias of "about". Once it gets that resource's ID, it can load it from the database, get its template, and start generating the page.

              Those files you mentioned are for something else altogether, and have nothing to do with MODX.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
              • As far as carousels or any other Javascript elements, MODX doesn't care. Pick one that you like, then just put the links in your template to load their Javascript libraries and plugins, as you would on any flat HTML document. Use a listing snippet with a chunk tpl to format the snippet's output to match whatever the Javascript requires for its functions - HTML div or li elements, classnames, etc.

                For example, this one for example uses the Jssor Slider JQuery plugin.

                The images are taken from individual "product" resources using getResources, here is the HTML from my "shop" template - the JSsor Javascript library is loaded at the bottom of the page, after the JQuery and Bootstrap libraries are loaded:
                <!-- Jssor Slider Begin -->
                <div id="slider1_container" class="slider center-block">
                
                <!-- Loading Screen -->
                <div u="loading" class="loading">
                  <div class="loading-overlay"></div>
                  <div class="loading-indicator"></div>
                </div>
                
                <!-- Slides Container -->
                <div u="slides" class="slides">
                  [[getResources?
                    &parents=`3`
                    &tpl=`slideshowTpl`
                    &depth=`0`
                    &includeContent=`1`
                  ]]
                </div>
                        
                <!--#region Arrow Navigator Skin Begin -->
                 
                <!-- Arrow Left -->
                <span u="arrowleft" class="jssora05l" style="top: 158px; left: 8px;"></span>
                <!-- Arrow Right -->
                <span u="arrowright" class="jssora05r" style="top: 158px; right: 8px"></span>
                <!--#endregion Arrow Navigator Skin End -->
                
                <!--#region Thumbnail Navigator Skin Begin -->
                <!-- thumbnail navigator container -->
                <div u="thumbnavigator" class="thumbnav jssort01">
                  <!-- Thumbnail Item Skin Begin -->
                  <div u="slides" style="cursor: default;">
                    <div u="prototype" class="p">
                      <div class=w><div u="thumbnailtemplate" class="t"></div></div>
                      <div class=c></div>
                    </div>
                  </div> <!-- Thumbnail Item Skin End -->
                </div> <!--#endregion Thumbnail Navigator Skin End -->
                
                <a style="display: none" href="http://www.jssor.com">Bootstrap Slider</a>
                </div> <!-- Jssor Slider End -->


                And this is what the getResources' "slideshowTpl" looks like:

                <div>
                  <img u="image" src="[[+product_image:pthumb=`w=400&h=200&zc=`1`]]">
                  <img u="thumb" src="[[+product_image:pthumb=`w=68&h=68&zc=1`]]">
                  <div u="caption" t="MCLIP|B" style="position: absolute; top: 365px; left: 0px; right: 0; width: 676px; height: 50px; background: #000; opacity: 0.5; color: #fff;">
                	  <div style="position: absolute; top: 0px; left: 0px; width: 100%; height: 50px;	background-color: Black; opacity: 0.5; filter: alpha(opacity=50);"></div>
                    <div style="position: absolute; top: 0px; left: 0px; width: 100%; height: 50px;	color: White; font-size: 16px; font-weight: bold; line-height: 50px; text-align: center;">[[+longtitle]]</div>
                  </div>
                </div>


                If you look a the Jssor demo page, you'll see that all I did was take the HTML block for one image in the slideshow, and modify it to use the MODX placeholders from getResources.


                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 49515
                  • 184 Posts
                  Wow, thanks for all the info.
                  As it happens, I tried the MODX Slideshow Manager and it is buggy.
                  I have an image that cannot change its aspect ration, so I made the size 600x235px, but Slideshow Manager wanted 600x400 to work.
                  Slide Manager also shows 1 large image at a time, not like a real slide carousel with smaller slides that show multiple images sliding across.
                  Pity, as the start and end time schedule function would have been useful.

                  So, now I'm trying this MIGx thingy, but I think it's just for images and not a carousel?

                  Ok, well, I might try your suggestion or Bootstrap...whatever is easiest, just works and is clear to install into the MODX system.
                  • MIGX is just to store the images and any accompanying captions or other metadata. The display of the images is up to you. MIGX uses its own getImageList snippet, it takes a chunk tpl just like getResources does.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 49515
                      • 184 Posts
                      Ok, sounds like MIGx doesn't make a carousel.
                      I'll try yours or Bootstrap to see if they can work with MODX, thank you.