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


    I have some questions regarding converting my lay-out to Modx. I already have come very far, but there some things that I don't quite know how to deal with in the best way.

    So, first question. My template is constructed normally this way:

    header
    breadcrumb block
    content
    footer.

    The content div (spanning the total site width) is as follows:

    <div class="singlecontent">
    My content and it's mark-up.
    </div>

    So far, nothing special. But my frontpage is a bit special. It doesn't use the breadcrumb block. And it has two content divs. The one I posted above and this one (to create two blocks of content next to each other):

    <div class="doublecontent">
    <div class="doubleleft">
    left block content
    </div>

    <div class="doubleright">
    right block content

    </div>

    <div class="clear"> </div>
    </div>

    I could of course create a template for the front page alone, but I guess that with chunks, template variables or something this could be handled more gracefully. How do I do that exactly?


    My second question: On my frontpage, in the doubleright block from above, I show the ten last posts from my Wordpress blog. How do I do this in Modx?

    My third question: I use a header image (image between my site name and the navigation). My website has a few sections. With a few sections I would like to use a different header image. Again, am I correct in believing that handling that with chunks/template variables or something is more elegant? And how I would exactly do that?

    Fourth question: I use a contact form (PHP script, very secure. Got it recommend at Sitepoint). How can I use this one in Modx?

    Fifth question: Google Analytics code: can I put this just in the template? Instead of a chunk or so?

    Sixth question: Can I let ModX generate a site map automatically? Both for visitors and Google webmasters?

    Sorry for the long post, but these are the questions I have. I am happy to return to ModX after many years smiley
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I would strongly recommend a separate template for the home page. While I have amused myself by using a single template with TVs and CSS to contort it into radically different forms, it's really much easier to have two or three templates.
        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
        What version of MODX?
          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
          • 42141
          • 73 Posts
          I use the latest version of ModX revolution smiley
            • 42141
            • 73 Posts
            Quote from: sottwell at Feb 06, 2013, 07:00 AM
            I would strongly recommend a separate template for the home page. While I have amused myself by using a single template with TVs and CSS to contort it into radically different forms, it's really much easier to have two or three templates.

            Ah, OK then. Good to know smiley
              • 42603
              • 6 Posts
              Third Question:I would use a different template for those sections which require it. It is straightforward if not elegant.

              Fifth question: Google Analytics code: I would put this in the template(s).

              Sixth question: have you looked at sitemapFriend or GoogleSitemap both are an official extras added through package manager.
                • 3749
                • 24,544 Posts
                Third Question: Template Variables (TVs) and chunks are designed for exactly that. You could use a TV for the image.

                Fourth Question: You can convert the form to work in MODX as a snippet, but you should probably check out SPForm first. If it doesn't meet your needs, check out FormIt.

                Sixth Question: http://modx.com/extras/browse/?search=sitemap
                  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
                  • 42141
                  • 73 Posts
                  Thank you all for you replies, They definitely help me out!
                    • 42141
                    • 73 Posts
                    I only need to get the breadcrumbs and wayfinder working, but I am stuck there. It's all a bit above my head how to make exactly work as I want... TV's and tpl's are confusing to me, let alone all the options of Wayfinder...
                      • 10208 ☆ A M B ☆
                      • 1,780 Posts
                      Breadcrumbs can be done with the Breadcrumbs snippet, check package management. It's fairly straightforward.

                      Which part about TV's confuses you? The concept or the implementation? When you say tpl's, do you mean the templates or chunks used as tiny templates for chunks of html?

                      Wayfinder can be confusing at first, but it's very efficient for producing menus and quite logical. Read through the documentation about 478 times... jk. No, but refer to it frequently. Is there anything special about the css of your menu?

                      Something you could do is install MODX on localhost, or a subfolder/subdomain at your server and then immediately install the Flexibility Package. Explore it, and you'll get a better idea of how TV's, chunks, templates, and static files work. It also contains a working model of a Wayfinder menu, with chunks that you can look at and compare to css.

                      With wayfinder, start with
                       [[!Wayfinder? &tartId=`0`]]


                      Make rowTpl and innerTpl chunks like the documentation shows, and apply the classes and id's from your css (see Wayfinder documentation for examples). Basically you want to create chunks for the main menu row and another for the dropdowns. Depending on your menu, you may also need a chunk for the outerTpl or more (see Wayfinder documentation). Add the parameters to the Wayfinder call.

                      [[!Wayfinder? &startId=`0` &rowTpl=`rowTpl` &innerTpl=`innerTpl` &level=`0`]]


                      If your chunks accurately mimic your current menu and you've organized your resources in the tree with parents/containers and children, you should see something close to your current menu at least.

                        Frogabog- MODX Websites in Portland Oregon
                        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                        Having server issues? These guys have MODX Hosting perfected - SkyToaster