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

    I have a home page which displays two separate boxes...one with a welcome message (left box) and one is a feature box (right box).

    In the specific ’Home’ template i have got the [*content*] showing where the welcome box should be on the left....which displays just fine.

    I’ve never used TV’s before so bear with me...
    To get the feature box (right box) to display I’ve created a chunk ( {{homeright}} ) with the html code and then added the chunk call to the TV ( [*righthomebox*] ) with a setting of ’RichText’. The chunk ( {{homeright}} ) has been added to the ’Default Value’ area.
    Then i’ve added the TV call to the Home template (i’ve also assigned the TV to the Home template with the ’template access’ checkbox...
    Home Template code:
    <div  class="float-left-box">
        <h2>Welcome</h2>
            [*#content*]
    </div>
    [*righthomebox*]    
    

    Here’s the right chunk:
    <div class="float-right-box">
         <div class="float-right-box-text">
              <h3 class="featured-bullet">Featured Product</h3>
                    [*content*]
                  <div class="float-right-box-bottom"> <a href="#" title="find out more" class="read-more">Read more</a></div>
           </div>      
     </div>
    


    I can enter content to the ’Home’ page in Template variable area but the css styling is not displaying and neither is the <h3 class="featured-bullet">Featured Product</h3> part of the chunk.

    Could anyone explain to me what i’m doing wrong and where to put this right?
    This probably the incorrect way to use Tv’s...but I’ve trawled the forums and documentation and can’t seem to find anything that simplifies this scenario in a step by step manner...once i’ve finally grasped TV’s i shall document something myself for future users.

    Thanks for any help.

    J
      www.9thwave.co.uk
         WEB | DESIGN | PRINT
      • 4041
      • 788 Posts
      First thing I see is you have [*content*] used twice, once in the main content area and also in the chunk. Although they are spelled diff, both send the same info per document. Try replacing the [*content*] call and adding some html to the chunk and see what happens.

      [*#content*] = quickedit editable content
      [*content*] = normal non editable content

        xforum
        http://frsbuilders.net (under construction) forum for evolution
        • 3749
        • 24,544 Posts
        Breezer is right, you don’t want to user the "content" name twice.  You might try it first without a chunk at all. Later, you can move content into a chunk if you still want to once you have things working. I think what you might want in your template is something like this :

        <div  class="float-left-box">
            <h2>Welcome</h2>
                [*#content*]
        </div>
        <div class="float-right-box">
             <div class="float-right-box-text">
                  <h3 class="featured-bullet">Featured Product</h3>
                        [*righthomebox*]
                      <div class="float-right-box-bottom"> <a href="#" title="find out more" class="read-more">Read more</a></div>
               </div>      
         </div>
        


        Then create your TV  called righthomebox and assign it to that page template.

        Then create a document and make sure it’s set to use that template.

        When you edit the document in the MODx Manager, you should see an area to enter your "content" and another area to enter the content for the "righthomebox" TV. Whatever you enter in the righthomebox area will appear where you have [*righthomebox*] in the template.

        Hope this helps. (ps: I’d suggest not using a rich text TV unless you have a specific need for using the rich text editor.)
          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
          • 36549
          • 572 Posts
          Hi,

          Thanks so much for your replies.
          That makes TV’s a little clearer....so i don’t need to specify anything in the Default Value of the TV?...what is that used for then?

          Now my one issue is that i want the ability to add images and text in the TV content area so thought ’rich text’ was the option to choose but is there another way?
          Why shouldn’t i use Rich Text?

          Thanks again for your help.

          J
            www.9thwave.co.uk
               WEB | DESIGN | PRINT
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            The "default value" is for when you don’t specify a value in a TV for every document. For example, if you want to have images, but you want a default image displayed if no image is selected for a document. It’s fine to just leave it empty, though.

            Rich Text can cause problems with certain characters and structural layout. But if you want to insert images and links and stuff, it’s very useful. Just be aware that it might "helpfully" trash your input, especially if you’re making complicated snippet calls in the TV’s content.
              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
              • 36549
              • 572 Posts
              Hi Sottwell,

              the TV will just be used for displaying some content in a unique container to one page and will contain one link, one image and some text.
              Would there perhaps be a way to seperate the image from the text so i could have one TV with a text as the input type and then another TV just for the image, so i negate the need to coose RichText as the input type?
              ...i guess it would be the same as i’ve done with my [*righthomebox*] but for where the image should be??
              something like:
              <img src="[*callToTV*]" class="float-right" alt="feature product"/>?

              Thanks

              J
                www.9thwave.co.uk
                   WEB | DESIGN | PRINT
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                I would just use a Rich Text TV. As they say, horses for courses wink
                  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
                  J,

                  sottwell has done a lot more of this kind of thing than I have, so her advice is more valuable than mine. She knows more about using rich text boxes with images and making the results look good. For myself, I’d be inclined to have a separate TV for the image just as you put in your example. It would be easier for me to control the styling of the page that way, although the extra TV might create a small bit of extra overhead in processing the page.
                    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
                    • 36549
                    • 572 Posts
                    thank you, you’ve been a great help.
                      www.9thwave.co.uk
                         WEB | DESIGN | PRINT