We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27449
    • 211 Posts
    Hello,
    I have all my document published because the browser Internet Explorer don’t read the document that don’t have published...
    I have documents that just are inserted in other document and I don’t want that the user see this document on her browser... but if I put the document un-publish, this document don’t appear in the document where is called

    How I block these document for the user don’t see on her browser and just see the document when is called.

    Example: I have a document that just have a snipped call... and the another document I have I call the id of the document that just have a snipped call
      • 16034
      • 107 Posts
      How do you insert documents in other documents?

      If it’s with a Ditto call you can use the Ditto-parameter showPublishedOnly=`0` to tell that you also want to see unpublished documents.

      http://ditto.modxcms.com/files/snippet-ditto-php.html#showPublishedOnly
        MODx snippet-glossary 101:
        Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
        • 27449
        • 211 Posts
        I call the id of this document (index.php?id=62)

        I have a document that call the autoslide snipped with the id=62 and the other document I have this code where I call this document:

        <div id="container">
        <a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this rotator.
        </div>


        <script src="assets/templates/swfobject.js" type="text/javascript">
        </script>
        <script type="text/javascript">
        var s1 = new SWFObject("assets/templates/imagerotator.swf","rotator","933","350","2");
        s1.addVariable("file","index.php?id=62");
        s1.addVariable("width","933");s1.addVariable("height","350");
        s1.addVariable("searchbar","false");
        s1.addVariable("showicons","false");
        s1.addVariable("transition","fade");
        s1.addVariable("shownavigation","false");
        s1.write("container");
        </script>
          • 16034
          • 107 Posts
          When your document is accessed that way it has to be available directly, since the Flash-application imagerotator.swf accesses the page just like a normal browser would.

          I don’t think there’s a good way to completely hide the document on direct access and still be able to show it in the Flash-application.

          You might be able to hack your way to a solution by checking the User Agent or Referer in the page that is loaded, and show nothing it it’s not being loaded by the Flash-application, but that wouldn’t hide the content completely just make it a bit more difficult to get to it.

          As it is now I suppose your only issue is that people can read the web page source and open the page on it’s own. If they do that they shouldn’t expect it to work as intended.
            MODx snippet-glossary 101:
            Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
            • 27449
            • 211 Posts
            And How do I do ? huh
              • 16034
              • 107 Posts
              How do you do what?

              If you want to make the hack that somewhat might work, you need to get your hands dirty with some php-coding.

              One way to start would be to make a php-script that simply prints the user agent, referer and any other info that might differ in the two cases. Then you run this script through the Flash-application, and through a variety of normal browser, and compare the output. If there is some difference you can use to classify the "thing" that accesses your php-script, that’s the thing you should use to decide what output to present in the semi-hidden document.
                MODx snippet-glossary 101:
                Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
                • 27449
                • 211 Posts
                I don’t know how I block the document that call the snipped without leave to work in the other document...

                  • 16034
                  • 107 Posts
                  Ok, what I’m writing above is that as far as I know, there is no easy solution to your problem.

                  Is it a problem because the document shows up in menus or other places where you don’t want it?

                  Or is it only a problem because it’s possible to enter the address of the document in the browser and view it?
                    MODx snippet-glossary 101:
                    Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control