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

    I was thinking about chnaging the view document page in the manager to add a tab in which if the document is a container we will list all its children.

    According to me it would be relevant and handy to know how many childs has a container.
    When you have thousand docs it would give a better view of the content
    I’ve started to look at the code and it doesn’t seem too difficult to do it.;

    What do you think about the idea?
    If you want I can try to make the changes.

    :-)
      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
      • 11975
      • 2,542 Posts
      done !

      Is anybody interested in these changes ?

      :-)

        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 25663 MODX Staff
        • 12,272 Posts
        That’s quite handy indeed! I’m interested. Care to add the missing introtext and other meta data fields as well to the general tab? tongue
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 11975
          • 2,542 Posts
          I’ll look into it this afternoon.

          Could someone explain me how to enable the first tab when the page is reloading.

          For instance, as the edit page counts more tabs than the view page, if when i’m saving I was in the third tab then the view page will be in the third wich doesn’t exist (does it make sense grin)

          I’d like to check first if the tab exists if not fall back to the first.

          Any idea.

          :-)
            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 10487 MODX Staff
            • 1,535 Posts
            Nice work, heliotrope!

            For the tab thing, check the tab page class - there is a cookie that gets set that saves which tab is active and, IIRC, you can pass a variable in to make it not use the cookie and therefore it will always activate the first tab in load.
              Garry Nutting
              Senior Developer
              MODX, LLC

              Email: [email protected]
              Twitter: @garryn
              Web: modx.com
              • 2762
              • 1,198 Posts
              Very nice Heliotrope! i love this add wink
                Free MODx Graphic resources and Templates www.tattoocms.it
                -----------------------------------------------------

                MODx IT  www.modx.it
                -----------------------------------------------------

                bubuna.com - Web & Multimedia Design
                • 11975
                • 2,542 Posts
                Thx for your kind comments.

                here is the final version of the mod.



                Before posting the files:

                @Ryan : the general tab now displays the meta tags and introtext
                Do you have some preference about the output, I mean would you like to see more than the name (tag, tagValue, http-equiv)

                I’m being writing the changelog.
                As I didn’t want to reinvent the wheel, I’m using the jason’s maketableclass to render the table.
                I’ve added the file in /manager/includes/extenders.
                Is that all right for you ?

                I’ve also added three entries in lang file, here they are:

                $_lang["view_childs_documents_in_container"] = "View childrens";
                $_lang["documents_in_container"] = "documents in this container";
                $_lang["no_documents_in_container"] = "This container has not yet childrens.";

                I’m still struggling with the cookie stuff right now, hope I could find how to deal with it.

                :-)
                  Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • 33337
                  • 3,975 Posts
                  Awesome! Awesome! ....... smiley
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 11975
                    • 2,542 Posts
                    here are the modified files

                    Changelog: document_data.static.php

                    - Added Jason’s maketable.class.php in /manager/includes/extenders/
                    - Changed in maketable.class line to skip class="clearfix" and added global $_lang support

                    - Added these lines in english.inc.php (mods start at line 207)
                    $_lang["view_childs_documents_in_container"] = "View childrens";
                    $_lang["documents_in_container"] = "documents in this container";
                    $_lang["no_documents_in_container"] = "This container has not yet childrens.";
                    $_lang["pagination_table_first"] = "First";
                    $_lang["pagination_table_last"] = "Last";
                    $_lang["pagination_table_gotopage"] = "Go to page";
                    $_lang["pagination_table_perpage"] = "per page";

                    - Added some css in style.css for table pagination (at the bottom of the file)

                    - Modified viewdata to display introtext / metatags, added tab view child list.
                    The create bar (document & weblink) will not be displayed if user has no right to create
                    The edit edit bar will not be displayed if user has no right to edit.

                    TODO / IMPROVE

                    I have been unable to deal with the cookie stuff from tabpane.
                    So I’m forcing it to display the "View childrens" tab except when isfolder=0 or webfxtab_documentPane>1 (when you save document from meta or preview tab)

                    It would be nice if someone more experienced could fix it.


                    :-)

                    EDIT : forgot to remove per page in maketable class. post back files in one minute.
                    done ! smiley
                      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                      • 11975
                      • 2,542 Posts
                      About the tabs, it seems to me that I need to create my own webfx instance to avoid conflict with the existings ones (docmanager, docpane, ...)

                      Am I on the right way ?


                      :-)
                        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l