We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4594
    • 74 Posts
    hello!

    i would like to know, if and how it’s possible, to insert certain blocks of predefined content in any area of the [*CONTENT*]-area?

    for example:
    Block 1:
    <h1>Lorem ipsum dolor</h1>
    <p>This is an headline paragraph combination...</p>
    
    Block 2:
    <ul class="linkList">
       <li><a href="#">linkt to somwhere</a></li>
       <li><a href="#">linkt to somwhere</a></li>
    </ul>
    
    etc. ...


    current, i have just one big [*content*] block which i can edit with the wysiwyg-editor. and this is very unflexible and for the customer who knows no HTML, it’s very hard to put in good HTML-code.

    but i want to predefine many blocks, so the customer can chose from a pool of elements, can place the element anywhere he wants and just has to insert plain text. just like a building set.

    do you know what i mean?

    thanks for help!
      • 25663 MODX Staff
      • 12,272 Posts
      Create Chunks for them. Chunks are little blocks of reusable content that don’t contain php logic.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 22098
        • 218 Posts
        simply create a number of plain text template variables and use these instead of the main content variable

        Olaf
          • 4594
          • 74 Posts
          sure, i can make chunks or a set of tv’s. but i have to include the tv’s into templates, or chunks, or whatever and then they are on a fix place. and if i want to create/edit a document, i just can fill the tv’s with content, but i can’t move them around, because they are fix in the template.

          here is a peace of my template:

            :
            :
          <div id="contentSrd">
          [*head1*]
          [*paragraph1*]
          [*list*]
          </div>
           :
           :
          


          this is ok, if every site would look the same way. but how it is done this way: "i want here a headline, and here a image/text combination, and after that a list of links.... sure i can do that with the wysiwyg editor, but i have to clean up the code afterwards...

          do i have manualy put the tv’s in the wysiwyg-editor? like
          [*head1*]
          [*paragraph1*]
          [*list*]

          ??

          sorry for this confusion, maybe i’m totally blind....

          how do you manage this?
            • 22098
            • 218 Posts
            this kind of flexibility is impossible with a CMS. This is why a WYSIWYG editor was created, to enable users to make up their own content structure, but still it generates HTML code. A possible alternative would be to customise the WYSIWYG editor to insert a bunch of code with a custom icon and dialogue window. Your best bet would be to offer a set of predefined templates for the editors to choose from, and enable them to use the WYSIWYG editor to fill in the templates.

            Olaf
              • 4594
              • 74 Posts
              @olaf

              thanks for your answer.
              this kind of flexibility is impossible with a CMS

              I have feared this...

              A possible alternative would be to customise the WYSIWYG editor to insert a bunch of code with a custom icon and dialogue window

              do you know a tutorial about this customization? this sounds good to me...

              by the way: this forum is very helpful and friendly!
                • 8960
                • 150 Posts
                Quote from: olafmol at Jan 18, 2007, 04:11 AM

                this kind of flexibility is impossible with a CMS.

                I don’t think that’s true at all. What was described is exactly what true Custom Content Types are all about.

                Not only is this possible with other CMS’s (Plone, OpenCms, dotCMS), but it will be available, in a possibly better/easier fashion in the future MODx with Document Variables as OpenGeek mentions.
                  • 4594
                  • 74 Posts
                  if this flexibility would be inserted into the future realeaes of modx, that would be great. laugh
                  maybe in the 1.0 final version?

                  it is so impotant to me, that you can insert predefined content anywhere you like, because the wysiwyg-editors produces always nasty code....
                    • 8960
                    • 150 Posts
                    Quote from: captain at Jan 18, 2007, 02:37 AM

                    sure, i can make chunks or a set of tv’s. but i have to include the tv’s into templates, or chunks, or whatever and then they are on a fix place. and if i want to create/edit a document, i just can fill the tv’s with content, but i can’t move them around, because they are fix in the template.

                    It seems what you are describing here is how Mambo/Joomla handle their ’Modules’. You can create a Module [with text] and then move that Module to all the different pre-defined areas, like left, right, top, bottom, user1, user2, etc. While MODx doesn’t do this in that manner, you can utilize TV’s & Chunk to have different formats that would not require you to keep editing your template.

                    In the template you would call a TV like [*MySpecialContent*]. In the MySpecialContent TV, you could call up the Chunks that contain you content in the HTML format you want. This TV could also be a checkbox or a list select that you choose how your content is laid out (like 1 Column, 2 Column, 3 Column, etc). Each of the Chunks you call will have the main content within the HTML as you defined.

                    So if you choose one column, your head, paragraph, & list are all in that column. If you choose 2 Column, your head, paragraph are in the 1st column and your list is in the 2nd column.

                    MODx doesn’t really limit you in any manner on how you push your content out. You just have to visualize how to push MODx to behave the way you want it to.

                    So, does this answer your question a little better?
                      • 4594
                      • 74 Posts
                      @er16004:

                      thanks for your answer. but i think (if i understood you right) the solution you described is not really perfect, because like you said you can place a TV [*MySpecialContent*] in my template, where i can choose from a list specific content-styles. so far so good. but it is fixed in place! what if i want below that TV-Content an another special content, like a perdefined paragraph?

                      sure i can place 100 TV’s among each other in my template, so i have 100 drop downs in my edit-area where i can choose specific content-styles. but thats not really handy...

                      maybe i’m stupid and totally off the track, but like you said:

                      I don’t think that’s true at all. What was described is exactly what true Custom Content Types are all about.

                      Not only is this possible with other CMS’s (Plone, OpenCms, dotCMS), but it will be available, in a possibly better/easier fashion in the future MODx with Document Variables as OpenGeek mentions.

                      and so i wait for the big 1.0 release...

                      thanks for your patience..