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

    I'm trying to add the content of a document in my template or in a chunk.

    The reason why I need this is that my director wants to update a message every week on the website and he doesn't know anything about html (and he doesn't want to learn it sad even if the basics are so easy to understand).

    At the moment on the website it's added via a chunk on the right side of it: example here http://1punt.be/

    But in chunks there is no TinyMCE editor so I was wondering if I could add the content of an article that I would hide from the menu to let it appear via a code into the template or a chunk....

    Thanks for your help,

    Sub
    • I haven't gotten that deep into working with Revo yet, but if Template Variables work the same as they do in Evo, you can use a TV instead, with the default value of @DOCUMENT <doc ID #>

      Then your director can just edit that document's content.

      There is a front-end editor available, something about AlohaX, but I'm not sure if it handles the editing of included elements like that. In Evo, I've accomplished that by using Ditto with its ability to add an Edit button to its item tpl that will open the item's page for editing in QuickManager+ Perhaps using Ditto like that on a single document is a bit of overkill, but it sure makes life easier for an editor to deal with small items like this (in my case I used it for the footer).
        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
        • 3749
        • 24,544 Posts
        NewsPublisher would let you edit a single richtext TV in the front end or just the content section of the page. In both cases you would have TinyMCE.
          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
          • 36098
          • 46 Posts
          Hi,

          Thanks Bob I tried it by adding
          [[!NewsPublisher? &initrte=`1`&rtcontent=`1`&show=`content`&np_id=`1`]]
          to a document. It let's the user create a document but I'm trying to show a document that would be modified.

          Is there a code that I have to add to show the content of a specified document so that my director can modify it when needed?

          I'm also trying to add the content of a specified ressource somewhere into my template.

          I'm getting better with Modx but I have to read and try and read and try more and more.

          Thanks for your help !

          ;-)
          Sub [ed. note: subran last edited this post 12 years, 4 months ago.]
            • 3749
            • 24,544 Posts
            One way to do that would be to put a tag for the NpEditThisButton on the page in question. Then the user could preview that page and click on the button to edit it.

            I guess NP should really have a property that specifies an existing document to edit. TBH, I never thought of your case when developing it. I'll think about how to add that.
              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
              • 36098
              • 46 Posts
              Ok, thank you Bob!

              By the way, is there an easy way to integer the content field of a document (resource) into a chunk or into the template ? If yes, I can give acces to my director to that document via the manager.
                • 3749
                • 24,544 Posts
                Quote from: subran at Dec 16, 2011, 04:52 PM

                integer the content field of a document (resource) into a chunk or into the template

                Sorry, I can't figure out what this means. Can you give a specific example?

                The content field of the document currently being viewed in the front end is always available with this tag, if that helps:

                [[*content]]

                  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
                  • 36098
                  • 46 Posts
                  Yes, the *content tag shows the current page but i'd like to show a specific page content.

                  it would a tag like *content &id=21 showing the content of document 21

                  is that possible?
                    • 3749
                    • 24,544 Posts
                    Yes, check out the getResourceField snippet.
                      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
                      • 36098
                      • 46 Posts
                      Thank you Bob !
                      [[getResourceField? &id=`67` &field=`content`]]

                      Works great ! [ed. note: subran last edited this post 12 years, 4 months ago.]