We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3002
    • 25 Posts
    I’ve been trying to get my head around this, please bear with me:

    I have a folder which holds my News articles, the title of which is in a TV called NewsTitle. In my main news page, I am trying to populate a dropdown list with the NewsTitle TV, but all I get is an empty dropdown.

    In my article page, I call Ditto like this:
    <form method="post">     
    <select>  
    [[Ditto? &tpl=`DittoSearchNewsTemplate` &summarize=`10` &displayArchive=`0` &startID=`53`]]
    </select> 
    <input type="submit" value="Submit" /> 
    </form>
    
    <br />
    [[Ditto? &tpl=`DittoNewsTemplate` &summarize=`1` &displayArchive=`0` &startID=`53`]]
    


    My DittoSearchNewsTemplate chunk looks like this:
    <option value ="[~[+id+]~]">[+tvNewsTitle+]</option>
    


    (The second Ditto call is just to show the first article in the folder).

    To debug, I tried outputing it as a <ul> and it worked fine. But when I tried a dropdown list, I get an empty dropdown list.

    Can anyone point this newbie in the right direction?

    Thanks.

    Bobby
      • 18397
      • 3,250 Posts
      MARKSVIRTUALDESK Reply #2, 20 years ago
      Could you copy and paste the rendered html for us here?
        • 3002
        • 25 Posts
        All I get is the following:

        	<form method="post">
            <select>   </select>  <input type="submit" value="Submit" />
        </form>
        


        The Ditto call below it churns out this code:
        <br /><br />						
        <div class="left narrow-product-image">
        <span class="upper bold">Saturday In Design 2005</span><br /><br />
        Cafe Culture were excited to be part of SID 2005. Sharing with Laminex and Hettich in the Laminex showroom in Surry Hills we have an amazing respose to our fresh look. We thank all those who dropped in for a cocktail or two. We look forward to catching up with you soon<br />
        </div>
        


        I tried toggling the "cacheable" checkbox, no dice. Any thoughts?

        Thanks for your help.

        Bobby
          • 3002
          • 25 Posts
          I explored @BINDINGS, but I really want to get this to work using Ditto (so I can use it for future projects, and mostly for my sanity’s sake!).

          I tried calling Ditto within <li> in the tpl chunk, and it spit out the right values from the TV. But when I replaced the <ul> with <select> (see code in my first post above), all I get is the blank form.

          If anyone knows of a solution to this, it would be greatly appreciated.

          Bobby
            • 18397
            • 3,250 Posts
            MARKSVIRTUALDESK Reply #5, 20 years ago
            Can you append &debug=`1` to the Ditto call and paste it here? Thanks.