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

    I don’t know if this is possible but i can’t find a solution myself so perhaps someone on here can let me know if i’m wasting my time or not...

    I want a client to have a set number of pages and only use QM for editing. This is easily set of course but my issue is that i also want them to have the ability to hide/unpublish a page but still have access to it via the front-end in case they change their minds. Currently if a page is set to not show in menu or is unpublished the client would have to go into the Manager in order to still view that page and re-publish.

    The other way i may be able to achieve this is if i can somehow set a maximum number of pages (for instance 12) for the user to have with their site and give them the ability to create a page in the root of the site (when they reach 12 they would not be able to create any more). This way if they unpublsied a page i could add a note telling them that unpublishing would require them to recreate the page and input all their information again if they wanted to re-publish....but i can’t seem to create a page in teh root??

    Thanks for any help

    J
      www.9thwave.co.uk
         WEB | DESIGN | PRINT
      • 16610
      • 634 Posts
      @janice171:

      You could make a special page with Ditto that lists all unpublished (or just all pages). Then add this special page to QM+ toolbar with custom button configuration parameter. That way the front-end editor can select unpublished page to be edited with QM+.
        Mikko Lammi, Owner at Maagit
        • 36549
        • 572 Posts
        thanks Lammiko i’ll give that a go although i’m not quite sure about how to create a tab on the toolbar...might have to come back here and ask about that if i’m struggling

        Cheers for your quick response.

        J
          www.9thwave.co.uk
             WEB | DESIGN | PRINT
          • 36549
          • 572 Posts
          As i thought i am totally lost when it comes to creating a custom tab in QM.
          I can see //Show custom button in the qm.inc.php but not having the php knowledge i don’t know how to generate the tab....can anyone help me out?

          Thanks

          J
            www.9thwave.co.uk
               WEB | DESIGN | PRINT
            • 16610
            • 634 Posts
            No need for PHP to create custom button. Read the QM+ readme file at "assets/plugins/qm/readme.html" or here: http://www.maagit.fi/files/qm-plus-1341/readme.html

            See "Custom buttons" section to learn how to create custom buttons.
              Mikko Lammi, Owner at Maagit
              • 36549
              • 572 Posts
              Hi Lammikko,

              wow, thanks for your help with this it’s really appreciated.

              I think i am nearly there but am not understanding a part of the configuration so would just appreciate your opinion of how i’ve set this up...if you have some time.
              By the way i’m using QM 1.3.3, Modx 1.0.2 just in case this has any relevance.

              I have created a page called ’pages’ set to be published but not show in menu with a ditto call:
              [!Ditto?parents=`0`&depth=`2`&display=`all`!]
              (i also have filtered some pages not to show including the ’pages’ page but it’s not really important for this example i guess)

              In QM i have the following:
              ’Site Pages’,’link’,’http://myWebsite.com/pages.php’,’’,’’

              In the QM toolbar i have a new button called ’site pages’ (this one generates the ditto call on the site template).
              I’m not entirely sure if this is the correct way to achieve my goal...but then again it does do what i want so i guess will suffice.

              Thanks again

              J


                www.9thwave.co.uk
                   WEB | DESIGN | PRINT
                • 16610
                • 634 Posts
                @janice171: That looks pretty much the way I would do it too.

                Maybe you should also hide the ’site pages’ page from site visitors and show it only if user is logged in MODx manager.

                You can do this by putting simple snippet like this on your ’site pages’ page:

                [!OnlyForManagers!]


                <?php
                // Snippet name: OnlyForManagers
                
                // If user is not logged in manager, forward user to page id 1
                if (!isset($_SESSION['mgrValidated'])) $modx->sendForward(1);
                ?>
                
                  Mikko Lammi, Owner at Maagit
                  • 36549
                  • 572 Posts
                  Hi,

                  Yep that’s great.
                  thanks for your help it’s opened up a whole new aspect to QM that i wasn’t aware of...very much appreciated.

                  J
                    www.9thwave.co.uk
                       WEB | DESIGN | PRINT
                    • 14951
                    • 151 Posts
                    This is such a great plugin! I have really enjoyed this addition to modx!

                    Feature Suggestion
                    I thought of an amazing feature that I doubt is possible (as of current) to implement, but would be and incredible feature in the future to have!
                    Is it possible for custom buttons to be shown dependent upon what document the user is currently on. For example, on the Blog Page, buttons could read "Add New Blog Post" "Publish Post"...etc where as on other documents the standard button set would be available.

                    This seems like it would be a very involved process but I think it would be a wonderful addition!

                    Question
                    I have been reading the readme.html page regarding custom buttons, but can’t quite seem to figure out what I’d like to do. It appears the the ability to delete resources is not yet a possibility, but based upon what I have read in this thread I’m lead to believe that "(Un)Publishing" is currently a possibility(?).

                    If this is possible, would the correct syntax be:
                    'Publish Resource','publish','2','3','Site Admins'
                    ?

                    and conversely:
                    'Unpublish Resource','unpublish','2','3','Site Admins'
                    ?

                    and I don’t want to make this question to complex, but any possibility of an "if/then" style button? Such as (I have no syntax knowledge whatsoever):
                    if $docStatus (published='true') {echo $unPublishbtn; else echo $Publishbtn;}
                    ?

                    Thank you so much in advance for any insight!
                    -Jared

                      • 16610
                      • 634 Posts
                      Quote from: jtech at Feb 23, 2010, 06:39 PM

                      Question
                      I have been reading the readme.html page regarding custom buttons, but can’t quite seem to figure out what I’d like to do. It appears the the ability to delete resources is not yet a possibility, but based upon what I have read in this thread I’m lead to believe that "(Un)Publishing" is currently a possibility(?).

                      If this is possible, would the correct syntax be:
                      'Publish Resource','publish','2','3','Site Admins'
                      ?

                      and conversely:
                      'Unpublish Resource','unpublish','2','3','Site Admins'
                      ?

                      and I don’t want to make this question to complex, but any possibility of an "if/then" style button? Such as (I have no syntax knowledge whatsoever):
                      if $docStatus (published='true') {echo $unPublishbtn; else echo $Publishbtn;}
                      ?

                      You can’t (easily) make a custom button that publishes/unpublishes a document. You can do it but it will require custom snippet. The way it would work:

                      Make a custom button to link to a document that has the ability to publish/unpublish a document.

                      Your custom button would be something like:
                      'Publish','link','http://www.yoursite.com/publish-document','',''


                      Then you would need a custom snippet in document "publish-document" that checks the referer page and publishes/unpublishes it.

                      To your third question: There isn’t currently if/else logic to be added to custom buttons.

                      I think your ideas would definitely be possible to implement in QM+ but unfortunately I’m currently too busy at other (paying) projects to develop QM+ right now. Maybe some day smiley

                      Late addition: Of course you can publish/unpublish documents with QM+ the normal way by editing the document and setting published status there. I think this is enough in most cases.
                        Mikko Lammi, Owner at Maagit