We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25121
    • 4 Posts
    By request i am opening a topic in this section to help new comings to modx (like myself) understand the features that have been added to the original etomite cms.

    Maybe this could be the first of a series that covers all new features? thoughts please.

    I would like the more experienced users to post examples of TVs they have made and their purpose so that we new comers can understand the flexability and power of the feature.

    Maybe the next release of modx could include example TVs for the example site that is installed...

    The first example is using TVs for assigning blocks of content to pages - the tutorial is in the tips section and can found here: http://modxcms.com/forums/index.php/topic,294.msg1728.html#msg1728

    any others..?
    • Thanks ritchie,

      I think you’ll like the default content coming in TP3.3, as it is very much along the lines of what you suggest. smiley

        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 14267
        • 113 Posts
        You can process a TV through a snippet to allow users to input/edit formatted content that might otherwise be difficult for them to do. For example, here is a simple snippet called "FactTable" that formats a TV to display a 2-column table with alternating background color for the rows:

        // usage: [[FactTable?tvname=sometvname]]
        $output="<table class='quicktable'>";
        foreach ($rows as $row) {
           if ($x % 2!=0) $color="bgcolor=#eeeeee"; else $color="" ;
           $output.="<tr ".$color." ><td style='font-weight:bold'>".$columns[0]."</td><td>".$columns[1]."</td></tr>\n";
        $output.="</table><quickedit:".$tvname." />";
        return $output;

        You can then include instructions in the description field for the TV. In this case, something like "List a category and a fact on each line in the format category:fact. Number of lines is not limited."

        Then put as in the default value field:
        category 1: fact 1
        category 2: fact 2

        As you can see the snippet outputs a QuickEdit link to allow manager users to edit the TV on the page.

          • 18397
          • 3,250 Posts