We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39521
    • 15 Posts
    Going off this page http://rtfm.modx.com/display/revolution20/Custom+Manager+Pages

    I'm trying to create a Custom Manager Page that doesn't have any of the normal Manager header and footer. The documentation I posted above shows and mentions the ability to do this but it seems that must be an old version of Revo as 2.2.1 doesn't seem to have the ability to create "wrapperless" pages.

    Reason I need this is I'm trying to create it so my content managers can click a link and it will drop them a .csv file that they can import into excel. I've done this by creating another Action and having my first script just link to that page. It kind of works in the sense the page is dropping them the csv file but it's loading the headers and footer of the page so my csv file is the html on the whole page not just the csv content I need.

    So if someone can direct me to creating a wrapperless Custom Manger Page or a better way to drop them a csv file. The csv file script needs to have access to $modx and needs to be protected.
      • 39521
      • 15 Posts
      Ok. So I just figured this out, but it's a hack solution. I'd like to see if anyone has a better solution as I may like to repeat something like this.

      But here was my solution:

      All I did was echo the csv string that I create (instead of return it) and then immediately call exit; right after the echo statement.
        • 3749
        • 24,544 Posts
        Isn't there still a "load headers" field when you define a Manager Action? I haven't looked lately.

        If not, your solution might be the best, although I suppose you could create a protected resource with no template, write to its content field, and forward the user to it.



        ------------------------------------------------------------------------------------------
        PLEASE, PLEASE specify the version of MODX you are using.
        MODX info for everyone: http://bobsguides.com/modx.html
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 39521
          • 15 Posts
          No 2.2.1 doesn't seem to have the option to load headers, unfortunately. That would have more than likely solved my issue.

          I was also thinking about creating a protected resource, I just wanted to keep all my code in the same area if possible. But that very well could be the best option sad
            • 28215
            • 4,149 Posts
            In your controller class, add this as the class vars:

            class MyControllerClass extends modManagerController {
               public $loadHeader = false;
               public $loadFooter = false;
            }
            
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com