We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11336
    • 20 Posts
    Hi,

    I’ve set up a site which uses about 3-4 different templates. I want to easily be able to add images to the footer area so they display sitewide regardless of what template is used. There are around 20+ pages so using a tv would mean making the changes on all pages wouldn’t it?
    How could i make the footer area editable so it only has to be edited once and update sitewide?

    Thanks for any help

    G
      • 22829 ☆ A M B ☆
      • 80 Posts
      Chunks work well for things like this. Simply create a footer chunk and then include the chunk in your template.
        Time is what keeps everything from happening all at once.
        • 11336
        • 20 Posts
        Hi, thanks for your reply.

        How would i then make this easy for an administrator to update?
        They would not have rights to the chunks. I want it to be easy for an administrator to upload an image to an existing list of image links and for that update to only be made once in order to update the whole site.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          You could use a TV with @DOCUMENT binding that points to a resource that they can edit. Either assign the TV to a group they don’t have, or hide it with ManagerManager (can it hide specific TVs?) then they can edit that resource. I usually have an upublished container resource named Tools for storing this sort of thing, and keep the individual Tools resources unpublished so there’s no chance of somebody stumbling across them on the front-end.
            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
            • 19369
            • 1,098 Posts
            This might help: http://wiki.modxcms.com/index.php/Use_a_Document_to_form_sidebar_content

            Either assign the TV to a group they don’t have, or hide it with ManagerManager (can it hide specific TVs?)
            Yes
            mm_hideFields('tvmyVar', '2'); // Hide the template variable "myVar" for users with role "2"
              • 11336
              • 20 Posts
              Hi,

              Thank you for all the replies. I have got the @DOCUMENT working, so i have a new document named ’footer images’ (id 58) containing the images and my TV, called ’footer-images’ has a default value of @DOCUMENT 58.

              All works well until i then go to edit a document (any page in the menu) and all the tv info disappears! This is not just the ’footer-images’ tv it’s every tv associated with the pages. The ’footer-images’ TV actually displays ’DOCUMENT 58’ instead of the images when a page is updated...othe TVs just disappear.
              Any ideas why this is happening?
              I have searched the forums but can’t find any posts with this specific issue.

              Thanks

              G
                • 19369
                • 1,098 Posts
                This happened to me once after that I changed a rule in ManagerManager. If you have changed something there, try to restore the default version.
                  • 11336
                  • 20 Posts
                  Hi,

                  I’ve made quite a few changes to mm, do you know if there is an easy way to get mm back to default?
                  Are the settings anywhere that i could copy and paste?

                  Cheers

                    • 19369
                    • 1,098 Posts
                    Try this:

                    // PHP *is* allowed
                    // $news_role and $news_tpl will not apply to demo content but are left as a demonstration of what can be done
                    
                    // For everyone
                    mm_default('pub_date');
                    mm_renameField('introtext','Summary');
                    mm_changeFieldHelp('alias', 'The URL that will be used to reach this resource. Only numbers, letters and hyphens can be used');
                    mm_widget_tags('documentTags',' '); // Give blog tag editing capabilities to the 'documentTags (3)' TV
                    mm_widget_showimagetvs(); // Always give a preview of Image TVs
                    // mm_widget_colors('color', '#666666'); // make a color selector widget for the 'colour' TV
                    
                    // For everyone except administrators
                    mm_hideFields('link_attributes', '!1');
                    mm_hideFields('loginName ', '!1');
                    // mm_renameField('alias','URL alias','!1');
                    
                    // News editors role -- creating a variable makes it easier to manage if this changes in the future
                    $news_role = '3';
                    mm_hideFields('pagetitle,menutitle,link_attributes,template,menuindex,description,show_in_menu,which_editor,is_folder,is_richtext,log,searchable,cacheable,clear_cache', $news_role);
                    mm_renameTab('settings', 'Publication settings', $news_role);	
                    mm_synch_fields('pagetitle,menutitle,longtitle', $news_role);
                    mm_renameField('longtitle','Headline', $news_role, '', 'This will be displayed at the top of each page');
                    
                    // News story template
                    $news_tpl = '8';
                    // mm_createTab('Categories','HrCats', '', $news_tpl, '', '600');
                    // mm_moveFieldsToTab('updateImage1', 'general', '', $news_tpl);
                    // mm_hideFields('menuindex,show_in_menu', '', $news_tpl);
                    mm_changeFieldHelp('longtitle', 'The story\'s headline', '', $news_tpl);
                    mm_changeFieldHelp('introtext', 'A short summary of the story', '', $news_tpl);
                    mm_changeFieldHelp('parent', 'To move this story to a different folder: Click this icon to activate, then choose a new folder in the tree on the left.', '', $news_tpl);




                      • 11336
                      • 20 Posts
                      Thanks very much for your replies.
                      It is finally working (fingers crossed). I’m still not sure what in MM was causing the TV content to disappear, but for the time being it’s working.

                      Thanks again.