We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24245
    • 9 Posts
    Hello I want to use FDM and have a little problem with generating the aliases for new pages.
    i try to use:
     &aliastype=`%id% %pagetittle%`
    as described in the documentation but the alias is always cut off after the first parameter no matter what i try. But in the documentation it says
    &aliastype=`Artìclé %id% %pagetittle% %tvcategory% %D%`
    can produce an alias like :
    "article 15_my_page_title_category1_09_09_07"


    does anyone have an idea what i could be doing wrong?

    thank you very much in advance
      • 13428 ☆ A M B ☆
      • 1,031 Posts
      &aliastype=`%id% %pagetitle%`


      Only one ’t’
        • 24245
        • 9 Posts
        sorry, that was my mistake, i just copied it from the documentation into the board...

        but in my template i have it right - doesn’t help :-(

        for example if i put it that way:
        &aliastype=`%pagetitle% %id%`

        the result only shows the pagetitle but not the id
          • 6272
          • 95 Posts
          The same problem. &aliastype=`%id%` or &aliastype=`%Y%.%m%.%d%` works correctly. But &aliastype=`%id%.%Y%.%m%.%d%` does not work, disappears id. Why?
            • 29525
            • 388 Posts

            I’m trying to use a checkbox and radio buttons to populate TVs in new FDM document. I’ve been successful in populating Template Variables with simple text fields using this in my form.
            <fieldset>
            	<input type="hidden" name="formid" value="fdmForm" />
                   <input type="hidden" name="fdmid" value="[+fdmid+]" eform="::0::" /> 
            	<legend>Tells us about your project.</legend>
            
                    <label for="tvclientname">Client Name</label>
                    <input name="tvclientname" id ="tvclientname" name="tvclientname" value="[+tvclientname+]" type="text" /><br /> 

            Can someone tell me how to add a check box or radio buttons to fill in a TV? Here’s what I’ve got now in my form but the TVs are not populated. I don’t know what this should look like.
            <input name="tvprojecttype"  type="checkbox" value="[+tvprojecttype+]" value="Document Services"  />Document Services <br />
            <input name="tvprojecttype" id ="tvprojecttype" name="tvprojecttype" value="[+tvprojecttype+]" value="Multi-Media Presentation"/>Multi-Media Presentation<br />

            Any help would be really appreciated!
            Terry
              www.terrybarthdesign.com
              • 36624
              • 535 Posts
              Terry, i think  have the solution for you. Bruno did this little snippet and i just hacked it a bit to use it multiple time in my FDM form:
              <?php
              /*
              ==================================================
              GetInputByTv
              ==================================================
              Renders a TV input as in Manager to the frontend
              Author: Bruno Perner [email protected]
              Version:
              --------------------------------------------------
              */
              //global $modx; // i dont need this
              $idname=(isset($idname)) ? $idname:"";
              $fields= "*";
              $docid= (isset($docid)) ? $docid :"";
              $published= 1;
              $tv = $modx->getTemplateVar($idname, $fields, $docid, $published);
              require_once ('tmplvars.inc.php'); // require_once is required if you need to call the snippet multiple time in the form.
              $output=renderFormElement($tv['type'], $tv['name'], $tv['default_text'], $tv['elements'], $tv['value'], $tv['style']);
              return $output;
              ?>


              use it like that :

              [[GetInputByTv? &idname=`YourTVName` &docid=`[+id+]`]]

              hope it help.
                CTRL+SHIFT+U - Clear Cache
                CTRL+SHIFT+H - Hiding Heft Panel
                CTRL+SHIFT+N - Fast Create Resource
                CTRL+ALT+P - Preview Recource (in edit resorce window)
                CTRL+ALT+S - Save
                • 29525
                • 388 Posts
                Manu

                Thank you. This looks like it could be useful in a variety of situations. Although, I’m not sure how this is supposed to work with FDM.

                I created a new TV (droplist) with three possible values and added it to the FDM model document.

                I added the GetInputByTv call to the FDM model document.

                When I create a new document using FDM, the TV specified by GetInputByTv doesn’t appear on the page for me to select a value. If I complete the form and view the newly created document, the TV now appears on the page as a droplist with three choices. Of course it doesn’t do anything at this point.

                So I’m not sure how this helps me? I think I’m missing something.

                I had thought I need only change the &eform_tpl called by FDM to use a different field type (checkbox instead of text). The check box appears on the page just fine, but the TV isn’t populated when the FDM document is submitted.

                The type=text works just fine, but I want to have the user select pre-defined values to populate the TV.
                  www.terrybarthdesign.com
                  • 36624
                  • 535 Posts
                  Quote from: Terry at Mar 23, 2009, 05:07 PM


                  I added the GetInputByTv call to the FDM model document.


                  No ! you must add the snippet call in the FDM eform tpl not in the model.

                  in your model you must have the tv associated that’s right.

                  here’s how i use this snippet in my FDM to add a select input where you can choose a color for a tv :

                  there is my FDM call : [!FDM? &canmoderate=`test` &tplLinks=`iconesRF` &redirect=`174` &id=`[*id*]` &model=`21` &parent=`174` &disableedit=`1` &disablepublish=`1` &disableunpublish=`1` &disabledelete=`1` &eform_tpl=`fdmEformTable`!]

                  ..&eform_tpl=`fdmEformTable`... code is :

                  
                  ....
                  <td>
                  <!-- date -->
                  	<label for="longtitle">Intervention:</label>
                  	<input name="longtitle" id="longtitle" value="[+longtitle+]" type="text"  />
                  [[GetInputByTv? &idname=`longtitleColor` &docid=`[+id+]`]]
                  </td>
                  ....
                  
                  


                  my tv name is "longtitleColor" and is set to "dropDownList" (but you can use want you want it work the same..) and the optionals values are "||rouge==rouge||bleu==bleu||vert==vert".

                  the final output is :
                  <select onchange="documentDirty=true;" size="1" name="tvlongtitleColor" id="tvlongtitleColor"><option value=""/><option value="rouge">rouge</option><option value="bleu">bleu</option><option value="vert">vert</option></select>
                    CTRL+SHIFT+U - Clear Cache
                    CTRL+SHIFT+H - Hiding Heft Panel
                    CTRL+SHIFT+N - Fast Create Resource
                    CTRL+ALT+P - Preview Recource (in edit resorce window)
                    CTRL+ALT+S - Save
                    • 16903
                    • 39 Posts
                    Aloa,

                    i like to use the "GetInputByTv" and integrated as mentioned above, but when i click the edit button all i get is an empty, white page.

                    I used the following code in my FDM template:
                    [[GetInputByTv? &idname=`types` &docid=`[+id+]`]]


                    My TV "types" is set as "Checkbox"...

                    Any ideas?

                    See’ya
                    Rohal.
                      • 36624
                      • 535 Posts
                      i had the same white page with the original snippet found here : http://www.modxcms.de/forum/comments.php?DiscussionID=1001#Item_2 and because i use the original snippet twice in my form.
                        CTRL+SHIFT+U - Clear Cache
                        CTRL+SHIFT+H - Hiding Heft Panel
                        CTRL+SHIFT+N - Fast Create Resource
                        CTRL+ALT+P - Preview Recource (in edit resorce window)
                        CTRL+ALT+S - Save