We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21279
    • 13 Posts
    Hmmm .. I haven’t specified any parameters so it shouldn’t be looking for a template. Is that how it works?

    EDIT: sorry ignore this ... I actually read the documentation this time wink the default for &eform_tpl is fdmEform
      • 27889
      • 415 Posts
      I’m currently moving FDM to use XPDO, lot of thing to do so be patient.
        MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
        MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
        • 27708 MODX Staff
        • 2,502 Posts
        I am having problems with FDM 0.0.99.

        I have a News Page with a Ditto call and an FDM call:

        [!FDM? &editorpageid=`14` &model=`0` &eform_noemail=`1` &redirect=`4` &parent=`4`!]
        [!Ditto? &startID=`4` &display=`10` &tpl=`NewsTemplate`!]
        


        and it points to a new page on which to edit the posts so not on the news page with the identical call as above.

        The form is working okay but when I click save the new document is created and the pagetitle is right but none of the content is posted to the content body of the document. I also tried it using the &model but then it wouldn’t overwrite the content in the model document.

        I want to be able to have all my content make it into the document.

        Once I debug this I hope to be able to set an event date based on a date in unixtime format from the form but I can’t get that far as the content won’t write to the db at this point.

        I am also hoping for an alias from title or alias formfield to put into the form.

        Any help would be appreciated. I will be willing to contribute to documentation or help in some other way to help out. I think this is a great part of the project and want to see it hit 1.0.

        Cheers,

        Jay
          Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
          • 27889
          • 415 Posts
          @Jay try to use it without editorpageid
            MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
            MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
            • 27708 MODX Staff
            • 2,502 Posts
            I have changed the call now to have the following:
            [!FDM? &model=`59` &eform_noemail=`1` &parent=`4`!]
            [!Ditto? &startID=`4` &display=`10` &tpl=`tplNews`!] 
            

            The problem I am having is that I can create a new document and edit the page title, my event date (TV) and Publication Date. I can edit the content textarea but the content in the content textarea is not being saved.

            Here is my eForm template:

            [+validationmessage+]
            <form method="post" action="[~[*id*]~]"  id="fdmForm">
            <fieldset>
            	<legend>News or Event</legend>
            		<div><input type="hidden" name="formid" value="fdmForm">
            		<input type="hidden" name="fdmid" value="[+fdmid+]" eform="::0::"><div>
            	<p>
            		<label for="pagetitle">News Headline or Event Title</label>
            		<input name="pagetitle" id="pagetitle" value="[+pagetitle+]" type="text" eform="Title of the page:string:1"  >
            	</p>
            	<p>
             	<label for="tvevent_date">Event Date:</label>
              <input name="tvevent_date" id="tvevent_date" type="text" value="[+tvevent_date+]" size="30" readonly="readonly">
                    <a onClick="nwev_cal1.popup();" title="Select the Date of the Event">
            		<img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Select Event Date"></a>
                    <a 	onClick="document.forms['fdmForm'].elements['tvevent_date'].value=''; return true;" >
            		<img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Clear Event Date"></a>
            	</p>
                <p>
             	<label for="pub_date">Publish Date:</label>
              <input name="pub_date" id="pub_date" type="text" value="[+pub_date+]" size="30" readonly="readonly">
                    <a onClick="nwpub_cal1.popup();" title="Choose the publish date">
            		<img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Select date"></a>
                    <a 	onClick="document.forms['fdmForm'].elements['pub_date'].value=''; return true;" >
            		<img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Remove date"></a>
            	</p>
            	<p>	<label for="event_details">News or Event Details</label>
            			<textarea name="event_details" id="event_details" rows="5" cols="50">[+content+]</textarea>
            	</p>
            </fieldset>
            
            <p><input name="fdmsubmit" value="Submit" type="submit" />  <a href="[~[*id*]~]" tile="Abort operation">Abort</a></p>
            </form>
            
            <form id="abort" style="position:relative;" method="post" action="[~[*id*]~]">
            	<input type="submit" name="clickabort" value="Abort" />
            </form>
            
            <script language="JavaScript" src="manager/media/script/datefunctions.js"></script>
            <script type="text/javascript">
            	var elm_txt = {}; // dummy
            	var pub = document.forms["fdmForm"].elements["pub_date"];
            	var nwpub_cal1 = new calendar1(pub,elm_txt);
            	nwpub_cal1.path="[(base_url)]manager/media/";
            	nwpub_cal1.year_scroll = true;
            	nwpub_cal1.time_comp = true;	
            </script>
            <script type="text/javascript">
            	var evelm_txt = {}; // dummy
            	var ev = document.forms["fdmForm"].elements["tvevent_date"];
            	var nwev_cal1 = new calendar1(ev,evelm_txt);
            	nwev_cal1.path="[(base_url)]manager/media/";
            	nwev_cal1.year_scroll = true;
            	nwev_cal1.time_comp = true;	
            </script>
            

            What if anything do I need to change to make this work? I have tried it with and without FDM in the model. I have removed the ditto call. I have removed the model call (a mistake) and I have not been able to get it to work. I have it working on another site with a similar setup but I just can’t get it to save the [+content+]. Is there a chance that this is tied to the ids of the input element? I don’t know how it should be but I am at a loss and I have to get this project done.

            Any help by anyone would be appreciated.
              Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
              • 27708 MODX Staff
              • 2,502 Posts
              Okay,

              I have looked further at this and I have nailed it down to FDM requiring that the id of the container has to be the same as the name of the field being retrieved or written from or by FDM.

              So as an example the following will work:
              <p>	<label for="content">News or Event Details</label>
              			<textarea name="content" id="content" rows="5" cols="50">[+content+]</textarea>
              </p>
              

              but this won’t:
              <p>	<label for="event_details">News or Event Details</label>
              			<textarea name="event_details" id="event_details" rows="5" cols="50">[+content+]</textarea>
              </p>
              


              The problem is that while the form displayed I cannot have a valid page because I use an ID #content in all my templates for body content. This I can live with but at least I can work with it and save the data. Please verify that this is the case and let me know. I would ideally be able to change the for, name and id values to whatever I want (obviously they should be the same but "content" should be a reserved word as it is in many people’s templates as the container div id.

              Also I still seem to be getting an alias of "0" for my posts when using a model. I would like it to give a underscore linked version of the pagetitle as the alias incase I want fURLs to work with them.

              All the best,

              Jay
                Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                • 27708 MODX Staff
                • 2,502 Posts
                Yet another problem. I now want to add the unpub_date to the form but it will no longer save the pubdate or unpub date for the document. Here is the template:

                [+validationmessage+]
                <form method="post" action="[~[*id*]~]"  id="fdmForm">
                <fieldset>
                	<legend>News or Event</legend>
                		<div><input type="hidden" name="formid" value="fdmForm">
                		<input type="hidden" name="fdmid" value="[+fdmid+]" eform="::0::"><div>
                	<p>
                		<label for="pagetitle">News Headline or Event Title</label>
                		<input name="pagetitle" id="pagetitle" value="[+pagetitle+]" type="text" eform="Title of the page:string:1"  >
                	</p>
                <p>
                		<label for="introtext">Item Summary</label>
                		<textarea name="introtext" id="intortext" rows="3" columns"50" eform="Summary of Item:string:1">[+introtext+]</textarea>
                	</p>
                	<p>
                 	<label for="tvevent_date">Event Date:</label>
                  <input name="tvevent_date" id="tvevent_date" type="text" value="[+tvevent_date+]" size="30" readonly="readonly">
                        <a onClick="nwev_cal1.popup();" title="Select the Date of the Event">
                		<img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Select Event Date"></a>
                        <a onClick="document.forms['fdmForm'].elements['tvevent_date'].value=''; return true;" >
                		<img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Clear Event Date"></a>
                	</p>
                    <p>
                 	<label for="pub_date">Publish Date:</label>
                  <input name="pub_date" id="pub_date" type="text" value="[+pub_date+]" size="30" readonly="readonly">
                        <a onClick="nwpub_cal1.popup();" title="Choose the publish date">
                		<img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Select date"></a>
                        <a onClick="document.forms['fdmForm'].elements['pub_date'].value=''; return true;" >
                		<img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Remove date"></a>
                	</p>
                	<p>
                	<label for="unpub_date">Unpublish Date:</label>
                  <input name="unpub_date" id="unpub_date" type="text" value="[+unpub_date+]" size="30" readonly="readonly">
                        <a onClick="nwunpub_cal1.popup();" title="Choose the unpublish date">
                		<img align="absmiddle" src="manager/media/calendar/img/cal.gif" width="16" height="16" border="0" alt="Select date"></a>
                        <a onClick="document.forms['fdmForm'].elements['unpub_date'].value=''; return true;" >
                		<img align="absmiddle" src="manager/media/style/MODx/images/icons/event3.gif" width="16" height="16" border="0" alt="Remove date"></a>
                	</p>
                	<p>	<label for="content">News or Event Details</label>
                			<textarea name="content" id="content" rows="5" cols="50" eform="Page Content:string:1">[+content+]</textarea>
                	</p>
                </fieldset>
                
                <p><input name="fdmsubmit" value="Submit" type="submit" />  <a href="[~[*id*]~]" tile="Abort operation">Abort</a></p>
                </form>
                
                <form id="abort" style="position:relative;" method="post" action="[~[*id*]~]">
                	<input type="submit" name="clickabort" value="Abort" />
                </form>
                
                <script language="JavaScript" src="manager/media/script/datefunctions.js"></script>
                <script type="text/javascript">
                	var elm_txt = {}; // dummy
                	var pub = document.forms["fdmForm"].elements["pub_date"];
                	var nwpub_cal1 = new calendar1(pub,elm_txt);
                	nwpub_cal1.path="[(base_url)]manager/media/";
                	nwpub_cal1.year_scroll = true;
                	nwpub_cal1.time_comp = true;	
                </script>
                <script type="text/javascript">
                	var evelm_txt = {}; // dummy
                	var ev = document.forms["fdmForm"].elements["tvevent_date"];
                	var nwev_cal1 = new calendar1(ev,evelm_txt);
                	nwev_cal1.path="[(base_url)]manager/media/";
                	nwev_cal1.year_scroll = true;
                	nwev_cal1.time_comp = true;	
                </script>
                <script type="text/javascript">
                	var unelm_txt = {}; // dummy
                	var unpub = document.forms["fdmForm"].elements["unpub_date"];
                	var nwunpub_cal1 = new calendar1(unpub,unelm_txt);
                	nwunpub_cal1.path="[(base_url)]manager/media/";
                	nwunpub_cal1.year_scroll = true;
                	nwunpub_cal1.time_comp = true;	
                </script>


                I am getting a little bleary eyed over this and want to get this solved. Please any help you can offer--guesses and expert alike.

                All the best,

                Jay
                  Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                  • 27708 MODX Staff
                  • 2,502 Posts
                  One new thing I discovered when I was in the fdm.db.class.inc.php file was that the alias being set to the pagetitle seems dependent in fURLs being enabled.

                  While this makes sense immediately it has created an issue for me as I usually develop with fURLs off and deploy and turn fURls on once the site is on the deployment server.

                  Do you think it is necessary to make the alias dependent on fURLs on or not. I think it would be better to make a parameter to "pageTitleSource" that would allow a source of pagetitle, TV, or integer with an appended date or some such.

                  I would think that the condition for the alias could just be dropped in the SetAlias() and allow the alias just to be written based on the Pagetitle regardless of fURLs.

                  BTW: I really like FDM and really use it alot so any criticisms are just related to my love of this snippet.

                  All the best,

                  Jay
                    Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                    • 10998
                    • 7 Posts
                    Hi,

                    Just installed FDM, when I enter FDM module, I get this:

                    Installation de FDM.
                    Installation des Snippets.
                    
                    /www/110mb.com/e/f/p/_/_/_/_/_/efp/htdocs/assets/snippets/FDM/install/[snippet]FDM.php not found.
                    Installation des Chunks.
                    
                    /www/110mb.com/e/f/p/_/_/_/_/_/efp/htdocs/assets/snippets/FDM/install/[chunk]FDMeFormTpl_EN.html not found.
                    
                    Warning: opendir(/www/110mb.com/e/f/p/_/_/_/_/_/efp/htdocs/assets/snippets/FDM/install/) [function.opendir]: failed to open dir: No such file or directory in /www/110mb.com/e/f/p/_/_/_/_/_/efp/htdocs/assets/snippets/FDM/includes/install.class.inc.php on line 103
                    
                    Warning: readdir(): supplied argument is not a valid Directory resource in /www/110mb.com/e/f/p/_/_/_/_/_/efp/htdocs/assets/snippets/FDM/includes/install.class.inc.php on line 104
                    
                    Warning: closedir(): supplied argument is not a valid Directory resource in /www/110mb.com/e/f/p/_/_/_/_/_/efp/htdocs/assets/snippets/FDM/includes/install.class.inc.php on line 112
                    
                    Can't erase /www/110mb.com/e/f/p/_/_/_/_/_/efp/htdocs/assets/snippets/FDM/install/ This directory is no more needed


                    What am I doing wrong?

                    Thank you
                      • 7231
                      • 4,205 Posts
                      Did you upload the FDM folder into assets/snippets/ directory of your site? I just installed yesterday and it went without any problems. Since the errors are complaining about not found docs I think that you forgot to upload the directory.

                      @smashingred: did you find a solution for not using FURL? I to develop with it off and only implement it on the final server to avoid any problems.
                        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                        Something is happening here, but you don&#39;t know what it is.
                        Do you, Mr. Jones? - [bob dylan]