We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24074
    • 81 Posts
    Hello,
    I’m building a website, here is the draft: http://www.purplerspace.com/dl/event15/
    Now, what i would like to do is to have those 3 boxes in the middle as separate 3 resources so client can edit it easily but as I just started playing with MODx I don’t have idea how it could be done so I could make use of some help.

    Second thing is that if content exist before those boxes and its place is declared with content variable, boxes need to come after it and another block of content after boxes which probably means i need to have something like:

    [*content*]
    -boxes-
    [*content2*]

    ..right?

    Could someone show me how the page should be formatted for education purposes?
    Thanks
      Radio sucks!
      • 12888
      • 2 Posts
      Trying to create two Template Variables contentleft and contentright. Input Type should be RichText. Now you call this two tvs in your template. Or you have to write a snippet to show only the filled ones.
      Hope this will help for the first step ^^
        • 27708 MODX Staff
        • 2,502 Posts
        There are a number of approaches to this. Are the boxes to be sitewide or do they relate to only this one 1 document? If you might want to use the boxes elsewhere you might make each box a document resource and use Ditto to call the boxes and a TV in the document itself to set the boxes to show on that document.

        Your my boxes could be a comma separated list in a TV called myBoxes like: 21,34,56 and then your Ditto call (not the whole call but as an example:
        [[Ditto? ... &includeDocs=`[[*myBoxes*]]`]]


        If you wanted to get advanced with this you could also make the TV grab all the published doc titles beneath a container, show them in a dropdown and output the comma separated list of ids. This would require more work but might be easier for your client.
          Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
          • 27708 MODX Staff
          • 2,502 Posts
          I forgot to show you the format:

          [*content*]
          [[Ditto? ...]]
          [*bottomContent*]
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
            • 27347
            • 65 Posts
            Quite a lot of options depending on your and your clients needs. Do the boxes really need to be separate resources? If so i would try Ditto.
            What you could also do is make 3 chunks and just call them in your resource content area.
              • 19369
              • 1,098 Posts
              Hi purpler, what you need here is custom template fields, that are known in MODx as Template Variables (TV). Here is a quick example:

              1)
              Go to Elements > Manage Elements > Template Variables > New Template Variable
              Template Variable Name: box-01
              Caption: Box Content
              Input Type: Textarea (Here you can choose also RichText, which is TinyMCE or FCK)
              Template Access: Here select the template you’re using in your home page.

              2)
              Repeat step one and create box-02 and box-03

              3)
              Open your template and add the Template Variables that you have just created like in this example:
              <div class="box">
              <h3>Rođendani</h3>
              <p>
              [*box-01*]
              <br />
              <a class="readmore" href="address" title="Pročitajte više">Pročitajte više</a>
              </p>
              </div>
              


              About your second question, you are correct. Your template could look something like this:
              [*content*]
              [*box-01*]
              [*box-02*]
              [*box-03*]
              [*content2*] 


              [*content2*] is just another Template Variable with Input Type: RichText.
                • 24074
                • 81 Posts
                Awesome, thanks everybody with replies, I’m going to try them.
                @Jay
                No, boxes are going to be only on homepage, other pages are going to be regular, text and images only.

                @SiNNuT, @smashingred
                Idea for each box to be separate resource is that client has easy access to them ince they’re not tech-savvy and will find complicated to edit chunks or go deeper than basic content editing via TinyMCE.

                I’ll give you a feedback on how it went.
                  Radio sucks!
                  • 8609
                  • 607 Posts
                  Template variables are the best way, in my opinion, to add multiple editable areas to one page. The syntax will of course depend on what version of MODx you’re using. microcipcip has given you a good start smiley
                    • 24074
                    • 81 Posts
                    @einsteinsboi, so if TV’s are going to be used, does client need to edit TV or wanted resource when there is necessity to make a change to content of those 3 boxes?
                      Radio sucks!
                      • 8609
                      • 607 Posts
                      I just reread your original post, looks like you want these three boxes to be pulled in from other resources? In this case you would use Ditto and the client would need to edit the original resource they were pulled from to edit the content in those boxes. However, if you make those three boxes into template variables, then the client could edit them while editing the rest of the page. So they would only be doing editing on one page.

                      I guess the question then is, why do you need the three boxes to be resources in and of themselves?

                      Does this make sense?