We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    Quote from: prioritypie at Jul 08, 2011, 07:29 AM

    Thank you Bruno,

    The problem I was having was that a "Resource List" TV type just outputs the ids, so I couldn’t have the pagetitle included in the option string and I was trying to get it from within the (grid) rendering function. I’ve resorted to using a standard drop down list TV with a snippet to output the relevant resources in the pagetitle:id format as you suggested.

    to complete this, the snippet-code for getResourceList:

    <?php
    $parent=$modx->getOption('parent',$scriptProperties,'0');
    $sortby=$modx->getOption('sortby',$scriptProperties,'pagetitle');
    
    $c = $modx->newQuery('modResource');
    $c->where(array('parent'=>$parent));
    $c->sortby($sortby);
    $collection = $modx->getCollection('modResource',$c);
    
    $output='kein Partner==0';
    foreach ($collection as $o){
    $output .= '||'.$o->get('pagetitle').'=='.$o->get('pagetitle').':'.$o->get('id');
    }
    return $output;


    and then use this input-option-values:
    @EVAL return $modx->runSnippet('getResourceList',array('parent'=>'3'));
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 17422
      • 225 Posts
      Hi Bruno,

      have you tested with 2.1.2 pl ?

      i have installed on this version and when i clic on buton for create new, the popup open but i have Loading...

      i try with your example

      Laurent
        • 17422
        • 225 Posts
        the problem is gone, I do not know how smiley
          • 17422
          • 225 Posts
          it is possible to use the inputTV with autoTag ?

            • 35322
            • 20 Posts
            Hi Bruno (and everyone),

            I’ve added MIGX to my project and added some form tabs. I’m using "image" as an inputTV, but when I go to create an entry in the resource, the image field is merely a text field. I’ve tried copying and pasting multiple JSON examples from this post into my forms field, so I know it’s not my JSON that’s at fault. Should I, perhaps, have installed something else to make this work?

            I have MODX Revolution 2.1.2-pl (traditional) installed.

            Thanks,
            Lee
              • 4172
              • 5,888 Posts
              Hi Lee,

              when you use ’image’ as inputTV you need to create another TV, which is a image-TV with name image.
              You should not assign this image-TV to any template.
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 4172
                • 5,888 Posts
                Quote from: lolotlm at Jul 11, 2011, 06:03 AM

                it is possible to use the inputTV with autoTag ?



                didn’t try that. I will do it and report how it does.
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 35322
                  • 20 Posts
                  Quote from: Bruno17 at Jul 11, 2011, 01:41 PM

                  Hi Lee,

                  when you use ’image’ as inputTV you need to create another TV, which is a image-TV with name image.
                  You should not assign this image-TV to any template.

                  Thank you, that solved it smiley
                    • 35322
                    • 20 Posts
                    Hi Bruno,

                    The image is now working a treat. However, I’m now trying the same with a URL TV. I’ve added the following JSON for the tabs :

                    [
                    {"caption":"Info", "fields": [
                        {"field":"title","caption":"Title"},
                        {"field":"body","caption":"Body"},
                        {"field":"linkLabel","caption":"Link Label"},
                        {"field":"linkUrl","caption":"Link URL","inputTV":"URL"}
                    ]},
                    {"caption":"Image", "fields":[
                        {"field":"image","caption":"Image","inputTV":"image"}
                    ]}
                    ]
                    


                    And created an unused TV, called linkUrl with type URL, just in case that’s needed. However, when used, the URL shows as a simple text field.

                    Any ideas?

                    Thanks loads,
                    Lee
                      • 4172
                      • 5,888 Posts
                      And created an unused TV, called linkUrl with type URL, just in case that’s needed.

                      what’s the name of your URL-TV. You will need the name of your TV for inputTV, not the type.

                      {"field":"linkUrl","caption":"Link URL","inputTV":"linkUrl"}
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!

                      This discussion is closed to further replies. Keep calm and carry on.