We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20364
    • 89 Posts
    Is there a way to allow selecting a blank/null entry for a Resource List tv?
      • 25636
      • 21 Posts
      I posted this same question last week.

      I haven’t solved this yet, but as a workaround, I created an empty unpublished document in the folder that my Resource List TV uses as a parent. I can use this as my "blank" option.

      Hopefully someone else has a better solution.
        Linux 2.6.32.8-grsec-2.1.14-modsign-xeon-64, PHP 5.2.14, MySQL 5.0.51a(client) 5.1.39-log (server), --with-pdo-mysql, Firefox/3.6.12
        • 17883
        • 1,039 Posts
        You could modify (or better duplicate with a new name and then modify) /core/model/modx/processors/element/tv/renders/mgr/input/resourcelist.php:

        Find (line 42):
        /* iterate */
        $opts = array();
        


        and add after that:

        $opts[] = array(
        	'value' => null,
                'text' => 'please select',
                'selected' => false
        );


        Perhaps it is better to take ’’ (empty) as value, depends on what you want to achieve and what you are more comfortable to request in your template.
          • 25636
          • 21 Posts
          Thanks MadeMyDay. It’s a shame this requires a core edit.
            Linux 2.6.32.8-grsec-2.1.14-modsign-xeon-64, PHP 5.2.14, MySQL 5.0.51a(client) 5.1.39-log (server), --with-pdo-mysql, Firefox/3.6.12
            • 28215
            • 4,149 Posts
            It’s already been addressed for 2.1:

            https://github.com/modxcms/revolution/pull/106
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 25636
              • 21 Posts
              Awesome.
                Linux 2.6.32.8-grsec-2.1.14-modsign-xeon-64, PHP 5.2.14, MySQL 5.0.51a(client) 5.1.39-log (server), --with-pdo-mysql, Firefox/3.6.12