We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17554
    • 41 Posts
    Hi

    I dont know if it is a correct place to put my question but I will try :0

    I whant to create catalog of product so I folow the solution that I found on
    http://wiki.modxcms.com/index.php/Howto_catalogue
    and it wok but with some problems

    FIRST on form that I create new document I dont see my TV name "category" like dropdown list ??
    my template variable is colled "category" and a form look like

    [+validationmessage+]
    <form method="post" action="[~[*id*]~]" id="fdmForm">
    <fieldset>
    <legend>Procduct fields</legend>
    <input type="hidden" name="formid" value="fdmForm" />
    <p><label for="pagetitle">Name of product</label><input name="pagetitle" id ="pagetitle" value="[+pagetitle+]" type="text" eform="Product’s name:string:1" /></p>
    <p><label for="longtitle">Short description</label><input name="longtitle" id ="longtitle" value="[+longtitle+]" type="text" /></p>
    <p><label for="tvcategory">Category</label><input name="tvcategory" id ="tvcategory" value="[+category+]" type="text" /></p>
    <p><label for="tvprice">Price</label><input name="tvprice" id ="tvprice" value="[+tvprice+]" type="text" /></p>
    <p><label for="description">Description</label>
    <textarea name="description" id="description" rows="5" cols="50" eform="Du texte:html:1">[+description+]</textarea></p>
    </fieldset>
    <p>
    <input name="fdmsubmit" value="Enregistrer" type="submit" />
    </p>
    </form>

    maybe is the problem in row
    <p><label for="tvcategory">Category</label><input name="tvcategory" id ="tvcategory" value="[+category+]" type="text" /></p>

    I dont know????


    And seccond ancualy the real problem I need one more TV called "subCategory" and it have to change his available values depending on "categoty" TV values.

    so If I put on "category" food||drink||..etc in "subcategory" one I get "chees||meat||apple..." and seccond "wother||wisky||vodka"

    is it possible to do that ?

    help
      • 18830
      • 161 Posts
      Quote from: lpastor at Nov 09, 2008, 03:58 PM



      maybe is the problem in row
      <p><label for="tvcategory">Category</label><input name="tvcategory" id ="tvcategory" value="[+category+]" type="text" /></p>



      Yes, this is the problem wink

      A dropdown with subcategories list looks like this:


      <label for="cat">Category</label>
      <select name="cat" id="cat"   >
            <optgroup label="supercat a">
              <option label="cat1">cat1</option>
              <option label="cat2">cat2</option>
             </optgroup>
            <optgroup label="supercat b">
              <option label="cat1">Cat 1</option>
              <option label="cat2">Cat "</option>
                </optgroup>
          </select>
      </select>
      


      and so on.

      I´m not sure, if you could achive this with a dopdown TV for the frontend. Maybe it is better to create a document with the optgropus an the options as content an then include this with the GetField snippet.