We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20413
    • 2,877 Posts
    The tespage html could be main template striped of content and modified *. When you then create docs in modx manager and assign them to this template
    u could either put <div style="display:inline;">{{chunk1}} {{chunk2}} {{chunk3}}</div> in page content
    and have chunks as
    <div style="width:220px;">column content</div>

    if the plan is to have a lot o different layouts. There are so many ways of doing this. This above is just an idea.

    * ) http://wiki.modxcms.com/index.php/Beginner%27s_Guide_to_MODx
      @hawproductions | http://mrhaw.com/

      Infograph: MODX Advanced Install in 7 steps:
      http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

      Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
      http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
      • 4322
      • 14 Posts
      Hey, thanks for the reply.

      1) Ok, so I’m going to get my main HTML wrapper code that will serve as the main template. That will include the markup to give me the top logo banner, the left nav bar (and I’m going to play with Wayfinder to put a menu in there automatically), along with the footer (which I am also going to replace with a Chunk I create).

      So that gives me an outer template, which will contain an empty div called ’mainContent’

      2) For my home page I just want to embed flash on the page in the mainContent. In order to do so, I need to reference some js files. Should I just put the includes for these js files in the main template and then just put the <object> code in the markup for the home page I create from this template, or is there some other way of putting other includes into a document when you create it?

      3) Looking at my other pages, there’s basically 8 other different layouts within the site:


      • the first about us page
      • the second about us page
      • the services / awards page
      • the main projects overview page with links to more detail and a link to the second projects overview page
      • the second projects overview page, with just a link back to the first projects overview page
      • the project detail page style 1 (6 detail pages, 3 using style 1, 3 using style 2)
      • the project detail page style 2 (as above)
      • the contact page

      I’ve had a look at the documentation for Chunks. So basically, they just contain HTML markup. So I could create a chunk for the first ’about us’ page that has all the divs etc.......the thing I can’t grasp is then how I’d create dynamic content within those chunks?

      I’d have the main template, then I’d create a document for about us based on that template and put the Chunk I create for about us in. But where when or how do I then put in the call to the dynamic content, so I can get my text and <img> links to pictures etc stored in the database, so that the users can edit / maintain it?

      Sorry for the barrage of questions - I’ll probably have more as I go on, but think there will be a lightbulb moment after I’ve grasped this fundamental concept.

      Thanks.
        • 20413
        • 2,877 Posts
        Tvs can be edited by the Quickedit Tool! You can call php-snippets [[ ]], template variables [* *] inside of chunks.

        You could create TVs for a page
        column1, column2
        and then with Quickedit what you are editing will endup in
        the chunk placeholder <div style="width:220px;">[*column1*]</div>

        In the end its all about whats going to be the best for you. Test and try. Especially try implement the TV for sidebar chunks I linked. That will
        maybe get you to use 2-3 templates instead of 6-7?

        I did my first modx webpage with 5 templates, that page would only require one. If you are using the sitemap snippet its handy to
        exclude docs that are assigned to a certain template...

        Its always bad to call stuff that is not needed inside of <head>
          @hawproductions | http://mrhaw.com/

          Infograph: MODX Advanced Install in 7 steps:
          http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

          Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
          http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
          • 4322
          • 14 Posts
          Quote from: mrhaw at Nov 24, 2008, 06:47 AM

          Tvs can be edited by the Quickedit Tool! You can call php-snippets [[ ]], template variables [* *] inside of chunks.

          You could create TVs for a page
          column1, column2
          and then with Quickedit what you are editing will endup in
          the chunk placeholder <div style="width:220px;">[*column1*]</div>

          In the end its all about whats going to be the best for you. Test and try. Especially try implement the TV for sidebar chunks I linked. That will
          maybe get you to use 2-3 templates instead of 6-7?

          I did my first modx webpage with 5 templates, that page would only require one. If you are using the sitemap snippet its handy to
          exclude docs that are assigned to a certain template...

          Its always bad to call stuff that is not needed inside of <head>


          But surely there’s no way of me inserting a couple of js inserts into my template on certain pages is there? Or do I need to create some kind of template variable that sits in my template inside <head>, that I only set with the js include calls on the page I need it?
            • 20413
            • 2,877 Posts
            Make a [*headContent*] text TV
              @hawproductions | http://mrhaw.com/

              Infograph: MODX Advanced Install in 7 steps:
              http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

              Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
              http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
              • 4322
              • 14 Posts
              Quote from: mrhaw at Nov 24, 2008, 10:42 AM

              I just tried to make a [*headContent*] with raw text (deprecated)
              and it works fine for me on 0.9.6.3-RC2! smiley

              So you create that a TV named [*headContent*] and then put in the head of a template and were able to then set it as you choose in pages?

              Can’t try it at work right now as I’m getting that "$rs not set! New variable not saved!" error when I try to save my TV. Have tried recreating the DB, but no joy as of yet...............!
                • 20413
                • 2,877 Posts
                Yes! Just save it as headContent with text or text box and select it to ur template. Then on the pages that are
                assigned to same template there will be a text field or text box where you can set calls to js files for just that page.
                  @hawproductions | http://mrhaw.com/

                  Infograph: MODX Advanced Install in 7 steps:
                  http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                  Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                  http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                  • 4322
                  • 14 Posts
                  Quote from: mrhaw at Nov 24, 2008, 11:18 AM

                  Yes! Just save it as headContent with raw text or raw text box and select it to ur template. Then on the pages that are
                  assigned to same template there will be a text field or text box where you can set calls to js files for just that page.

                  Sweet, will give that a try when I get a minute. Also tried to set up some Chunks but was getting same error. Will try to set up some chunks that can house my differing kinds of content also. Thanks!
                    • 20413
                    • 2,877 Posts
                      @hawproductions | http://mrhaw.com/

                      Infograph: MODX Advanced Install in 7 steps:
                      http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                      Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                      http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                      • 4322
                      • 14 Posts
                      Thanks for links - setting sort order to 0 seems to work for me!!

                      Hmmmmmmm, can’t these Chunks to work though........

                      Just did the following:

                      1) Create 3 TV’s, named:

                      ProjectOverviewTitle (type Text)
                      ProjectOverviewPicture (type Image)
                      ProjectOverviewDescription (type TextArea)

                      2) Create a test Chunk named ProjectOverviewPanel and put the following markup into it:

                      <div class="projectPanel">
                        <div class="projectTitle">
                          [*ProjectOverviewTitle*]
                        </div>
                        <div class="projectPicture">
                          [*ProjectOverviewPicture*]
                        </div>
                        <div class="projectDescription">
                          [*ProjectOverviewDescription*]
                        </div>
                      </div>

                      3) Created a template called ’Test Template with the following markup:

                      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                      <html xmlns="http://www.w3.org/1999/xhtml" >
                      <head>
                          <title>Test Page</title>
                      </head>
                      <body>

                      </body>
                      </html>

                      4) Linked all the TV’s to this template

                      5) Created a new document, with Test Template as the template.

                      When I’m in this new document, how and where do I add my ’ProjectOverviewPanel’ chunk to this document and once I’ve done that, how do I then set the three TV’s inside that chunk?

                      Thanks.