We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27889
    • 415 Posts
    @Eol, Yes I can add others parameters, but are they needed in edit mode ?
      MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
      MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
      • 36416
      • 589 Posts
      Quote from: Soda at Dec 20, 2007, 03:11 AM

      @Eol, Yes I can add others parameters, but are they needed in edit mode ?

      Well, I’ve combined paged Ditto & FDM on my frontend editors page to allow some kind of browsing with "inline editing" capabilities - looks like I’ll need to rewrite FDM0.1b to pass parameters and anchors in edit mode.
        • 3743
        • 42 Posts
        Quote from: Soda at Dec 20, 2007, 01:57 AM

        I must use it to pass parameter between the different pages, and it allow text link to perform somes actions and placeholder to the redirect page.
        Snippet parameters ? from where ?

        In snippet call of course (-;
        like [!FDM? &action=`edit`!]
        To display form instead of buttons.

        I’ve made i quick-hack allowing this, but i’m not sure it is universal to publish it (more to say, i’m almost sure it is not universal (((-;), so i kindly asking a developer to implement something like this.

        PS:I agree with Eol about keeping existing get parameters, maybe it would be an option.
          • 27708 MODX Staff
          • 2,502 Posts
          FDM TinyMCE Tip

          I was trying to figure out how to enable Logged In Manager Users to use the file browser and Link List in TinyMCE using FDM. After pulling my hair out trying to use a TV or a snippet or hack of FDM it donned on me that I should see what the TinyMCE call is for QuickEdit and lo-and-behold it does everything I wanted it to.

          In the FDM instructions it says to place the following code inside a chunk:

          <script language="javascript" type="text/javascript">
          
          // Configuration detail check http://wiki.moxiecode.com/index.php/TinyMCE:Configuration
          tinyMCE.init({
          	theme : "advanced",
          	mode : "exact", // textareas:    Converts all textarea elements to editors when the page loads. exact: Converts elements of the specified names, as listed in the elements option.
          // This option should contain a comma separated list of element id's to convert into editor instances. This option is only used if mode is set to "exact".
          //	ie:	elements : "elm1,elm2"
          	elements : "content"
          });
          </script>
          


          Instead of that use the following:
          <script language="javascript" type="text/javascript" src="[(base_url)]assets/plugins/tinymce212/jscripts/tiny_mce/tiny_mce.js"></script>
          <script language="javascript" type="text/javascript" src="[(base_url)]assets/plugins/tinymce212/xconfig.js"></script>
          <script language="javascript" type="text/javascript">
          	tinyMCE.init({
          		  theme : "advanced",
          		  mode : "exact",
          		  width : "100%",
          		  height : "400px",
          		  relative_urls : true,
          		  document_base_url : "[(base_url)]",
          		  remove_script_host : true,
          		  language : "en",
          		  elements : "fdmContent",
          		  valid_elements : tinymce_valid_elements,
          		  extended_valid_elements : tinymce_extended_valid_elements,
          		  invalid_elements : tinymce_invalid_elements,
          		  entity_encoding : "named",
          		  cleanup: true,
          		  apply_source_formatting : true,
          		  remove_linebreaks : false,
          		  convert_fonts_to_spans : "true",
          		  onchange_callback : "tvOnTinyMCEChangeCallBack",
          		  external_link_list_url : "[(base_url)]assets/plugins/tinymce212/tinymce.linklist.php",
          		  resource_browser_path : "[(base_url)]manager/media/browser/mcpuk/browser.html?Connector=[(base_url)]manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=[(base_url)]",
          		  file_browser_callback : "fileBrowserCallBack",
          		  theme_advanced_blockformats : "p,h1,h2,h3,h4,h5,h6,div,blockquote,code,pre,address",
          		  plugins : "style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media",
          		  theme_advanced_buttons0 : "",
          		  theme_advanced_buttons1 : "undo,redo,selectall,separator,pastetext,pasteword,separator,search,replace,separator,nonbreaking,hr,charmap,separator,image,link,unlink,anchor,media,separator,cleanup,removeformat,separator,fullscreen,print,code,help",
          		  theme_advanced_buttons2 : "bold,italic,underline,strikethrough,sub,sup,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect,separator,styleprops",
          		  theme_advanced_buttons3 : "",
          		  theme_advanced_buttons4 : "",
          		  theme_advanced_toolbar_location : "top",
          		  theme_advanced_toolbar_align : "left",
          		  theme_advanced_path_location : "bottom",
          		  theme_advanced_disable : "",
          		  theme_advanced_resizing : false,
          		  theme_advanced_resize_horizontal : false,
          		  plugin_insertdate_dateFormat : "%Y-%m-%d",
          		  plugin_insertdate_timeFormat : "%H:%M:%S",
          		  button_tile_map : false 
          
          	});
          	function fileBrowserCallBack(field_name, url, type, win) {
          		// This is where you insert your custom filebrowser logic
          		var win=tinyMCE.getWindowArg("window");
          		win.BrowseServer(field_name);
          	}
            function tvOnTinyMCEChangeCallBack(i){
              if (i.oldTargetElement.onchange) {
                i.oldTargetElement.onchange();
              }
            }	
          </script>
          


          The critical part to change for your code is to make sure that the TinyInit Parameter elements : "fdmContent", needs to be the id of the container of your main content box as in fdmEform.

          Also keep an eye on your TinyMCE location. In the default .0.9.6.1 install it is in assets/plugins/tinymce212/

          This will enable your Manager Users to access the Link List and the Filemanager as they do when using Quickedit even if Quickedit is disabled.

          Hope this helps.

            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
            • 21191
            • 236 Posts
            anyone know how to upload a file using the FDM?
              ~Shawn Himmelberger
              Check out my MODx Development and MODx Design Company - Himmelberger Design
              • 36416
              • 589 Posts
              Quote from: smashingred at Nov 07, 2007, 02:46 PM

              I really need to sort out why FDM is not saving the pub_date and unpub_date using the dhtml calendar from MODx. The site is live but I can’t use FDM (0.1b) becuase the dates keep saving as NULL and returning the unix timestamp zero hour of January 1, 1970. I don’t know if this has to do with the Model Document or the way FDM is retreiving them from the database. They should be returned styled as part of the field but show up as the raw timestamp (if I had gone into the manager to edit them).

              Have you resolved published date problem?
              Someone just asked me to allow free tinkering with their newslist and I thought the easiest way is with editing pub_date field and sorting it on that field in Ditto call...
                • 27708 MODX Staff
                • 2,502 Posts
                I didn’t yet sort it out. If your client wants to just publish today all will be fine but if you are using model and want to change the pubdate then you may have problems. I think that the answer is that the dates are being handled by a loop as a string and if I look at the way News Publisher does it is not the same.

                I am too busy to work this out now but I was planning on working on modding FDM so that it is not going to have date problems as well as as add some functions now that have learned how to write snippets and create parameters. It won’t be for at least 4 weeks.
                <OT>
                Personally I’d like to see others get involved with FDM as I see it as a far more functional and more powerful snippet than NewsPublisher. I’d love to see the profile of this snippet rise up and possibly replace NewsPublisher as the core snippet for front end document handling in MODx.
                </OT>

                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
                  • 36416
                  • 589 Posts
                  Quote from: smashingred at Jan 08, 2008, 08:46 AM

                  If didn’t sort it out. If your client wants to just publish today all will be fine but if you are using model and want to change the pubdate then you may have problems. I think that the answer is that the dates are being handled by a loop as a string and if I look at the way News Publisher does it is not the same.

                  I certainly have problems - about to jump in FDM code and see where’s the problem... most NewsPublisher comes with default MODx installation and is snippet-only (without included file classes), right?

                  Quote from: smashingred at Jan 08, 2008, 08:46 AM

                  Personally I’d like to see others get involved with FDM as I see it as a far more functional and more powerful snippet than NewsPublisher. I’d love to see the profile of this snippet rise up and possibly replace NewsPublisher as the core snippet for front end document handling in MODx.

                  Me too - it is more promising with better TV & alias handling.
                    • 6726
                    • 7,075 Posts
                    Quote from: smashingred at Jan 08, 2008, 08:46 AM
                    Personally I’d like to see others get involved with FDM as I see it as a far more functional and more powerful snippet than NewsPublisher. I’d love to see the profile of this snippet rise up and possibly replace NewsPublisher as the core snippet for front end document handling in MODx.

                    +1 here, I have been talking a lot about this snippet on the forums, and rightly so : it opens a lot of doors and with everyone’s contribution this could become a core snippet indeed smiley
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l&#39;outil id
                      • 27708 MODX Staff
                      • 2,502 Posts
                      davidm, eol,

                      Thanks for your support. I will be sending Soda some proposed changes in the next weeks. Round up the gang and get all the PHP wonks on board with pushing FDM. Maybe Mr. Kaplan might want to get involved as well.

                      In the mean time here is a fix for the Chunkie Class conflict between Jot and FDM on the same page:

                      Change all instances to the word "CChunkie" in /snippets/FDM/includes/fdm.class.inc.php and /snippets/FDM/includes/fdmchunkie.class.inc.php to "fdmCChunkie".
                        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