We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29697
    • 24 Posts
    How do you get a snippet to respond to an class name assingned in an external css sheet included in the mother template.
    i can not get the snippet to run if i put a class identifier in the script

    Help please
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Can you post a sample of your snippet code where you are putting the class identifier? make sure to enclose it in the
      ...
      tags for easier reading.
        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
        • 29697
        • 24 Posts
        $global_dbh = mysql_connect(’JONSERV’, ’thegent’, ’gringo’);
        mysql_select_db(’formula1’, $global_dbh);

        function display_db_table($connection )
        {
        $query_string = "SELECT * FROM drivers";
        $result_id = mysql_query($query_string);
        $column_count = mysql_num_fields($result_id);

        print("<table border=0>\n");
        while ($row = mysql_fetch_row($result_id))
        {
        print("<tr align=left valign=top color=#ff0000>");
        for ($column_num = 0;
        $column_num < $column_count;
        $column_num++)
        print("<td
        ...class="Venue3L"...
        >$row[$column_num]</td>\n");
        print("</tr>\n");
        }

        that class is defined in an external css file which is included in the template containing snippet
        }
        display_db_table($global_dbh);
          • 7923
          • 4,213 Posts
          You have to escape the quotes, instead of class="Venue3L" use class=\"Venue3L\"


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 29697
            • 24 Posts
            Thanks Doze
            sorted