We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16085
    • 203 Posts
    I’m using a 2 column layout at the moment with the right side column dynamically pulling chunks like in the example on http://wiki.modxcms.com/index.php/Create_TV-Based_Chunks

    The thing is I want to be able to order these chunks so I can determine what chunk gets placed where. For example: (also attached)

    Chunks available: chunks 001 (logo) , chunks-002 (events) , chunks-003 (news posts)

    Page 1: uses; chunk-001, chunk-003
    Page 2: uses; chunk-003, chunk-001, chunk-002
    Page 3: uses; chunk-001, chunk-002, chunk-003


    Now if my chunks are named like, events, logo and new posts that is how they will appear in the TVs selection order.

    I know in the php script I can changed the ORDER BY but it doesn’t achieve the result I think I need. I’ve tried naming the chunks 001-logo, 002-events but I’m always going to hit a problem if one of my chunks needs to sit above another.

    So far the only way I’ve got around this is to duplicate that TVs to give me control over the ordering. This method works as expected but I end up with what I think is an unnecessary list of the same TV.

    The only thing I can think of is added the ability to add some sort of number field for the chunks similar to how ’Menu index’ numbering works for documents. Except the numbering would have to work per document.. and this right about where I get lost in just how you would implement this idea.

    Now I’m not sure if I’m just over complicating an idea but I feel it could be done better.

    Or maybe someone doing something similar and has got a better way of doing it!?!?

      • 4417
      • 6 Posts
      I’m having the exact same problem. If anyone can help us, would be great...
        • 4310
        • 2,310 Posts
        Do you use the TV checkbox method to enable other managers to select the TV content?
        If not, you could just use a simple text TV and add the chunks {{News}}{{Adsense}}{{Events}} in the TV,
        that way you decide the order/chunks page by page.
          • 16085
          • 203 Posts
          For now what I’ve done is simply replicate TV’s where I can’t control the order of the chunks, then set the ordering of the TV calls in the templates.
          				<div id="right-container">
          					{{Global-PC-Brands}}
          					[!chunkListParser?chunks=`[*Side-Block-01*]`!]
          					[!chunkListParser?chunks=`[*Side-Block-02*]`!]
          					[!chunkListParser?chunks=`[*TrainingRelated*]`!]
          					[!chunkListParser?chunks=`[*Side-Block-03*]`!]
          					[!chunkListParser?chunks=`[*Side-Block-04*]`!]
          				</div>	
          It’s still a page per page process unless I seeing obvious repetition then I simply adjust the template to call the chunk instead. Although I’m finding holes in my pre-planing for pages where chunks are repeated. So it’s been an interesting learning curve for pre-prep of template and pages! smiley