We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20349 ☆ A M B ☆
    • 453 Posts
    I have a few questions:

    -> When I create new document, it outputs the date 31-12-1969 16:00:22 . WHY?

    -> How can I add TV in my form? Any rules in adding except "tv" prefix?

    -> My newly created document has UNchecked: rich text. Why?

    -> Is it possible to uncheck "Show in menu" checkbox by default ?
      BASE - Web Design Studio
      MODX Ambassador

      Website
      • 4429
      • 429 Posts
      @ Rossco - I think you did (with the help of Dimmy) exactly what I want for my site. Any chance you could post your findings?

      Quote from: c-m at Oct 17, 2008, 08:35 AM

      I have installed FDM and set it up to work with tinymce without much problem.

      However I have two issues at the moment:

      1) I have a TV called "tags" which allows for the tagging of content using a check box. How do I include this TV for use with my FDM call?

      2) I have structure like follows:

      --USERS(container)
      ---User1 (container / contains the FDM call)
      ------user1 page1
      ------user1 page 3
      --User2 (container / contains the FDM call)
      ------user2 page10

      My FDM call is contained in a templated which is used when the User container is automatically generated. the call is:

      [!FDM? &eform_tpl=`fdmEform` &canpost=`users` &disableedit=`1` &disablepublish=`1` &disableunpublish=`1` &disabledelete=`1`  &redirect=`[*id*]` &trusted=`users` &model=`9` &script=`tinyfdm`!]


      Now with that A) how do i make it so only the author can edit content but everyone can view? B) so new user pages are created under the correct container.

      thanks


        • 36592
        • 970 Posts
        Quote from: Mproject at Oct 22, 2008, 09:51 AM

        -> When I create new document, it outputs the date 31-12-1969 16:00:22 . WHY?
        Which date ? How do you output that date ?

        -> How can I add TV in my form? Any rules in adding except "tv" prefix?
        I’m using this code in the fdmEform chunk for text TV ’documentTags’.
        <input name="tvdocumentTags" id="tvdocumentTags" value="[+tvdocumentTags+]" type="text" eform="documentTags:string:0" />
        


        -> My newly created document has UNchecked: rich text. Why?
        -> Is it possible to uncheck "Show in menu" checkbox by default ?
        Why don’t you use &model parameter ?
          • 4429
          • 429 Posts
          Still none the wiser with this:

          My FDM call is bellow.

          [!FDM? &eform_tpl=`fdmEform` &canpost=`users` &disableedit=`1` &disablepublish=`1` &disableunpublish=`1` &disabledelete=`1` &redirect=`[*id*]` &trusted=`users` &model=`9` &script=`tinyfdm`!]

          I want the following:

          1) New FDM pages to be created under this one
          2) Only the owner/creator to be able to edit them?

          A few of you have done this - It would be great if you could share how

          Thanks
            • 36416
            • 589 Posts
            Quote from: c-m at Oct 30, 2008, 05:59 AM

            I want the following:
            1) New FDM pages to be created under this one
            2) Only the owner/creator to be able to edit them?

            1. add &parent=`[*id*]` to FDM parameters
            2. if this is about editing only from the front-end, try dynamically calculating &disable[action] FDM parameters from document "ownership" (createdby field?) and current weblogged user
              • 4429
              • 429 Posts
              #1 worked great.

              I don’t understand your answer to #2 though.

              when a user creates a new page I wanted that user to be automatically redirected to the new page they have created. shouldn’t &redirect=`[*id*]` handle that? I’ve tired it but its not working, there is no redirect.

              [!FDM? &eform_tpl=`fdmEform` &canpost=`users` &disableedit=`1` &disablepublish=`1` &disableunpublish=`1` &disabledelete=`1`  &parent=`[*id*]`  &trusted=`users` &model=`78` &script=`tinyfdm` &redirect=`[*id*]`!]
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                [*id*] is referring to the ID of the page with the FDM snippet call (it returns the id of the current page). Maybe [+id+] would work?
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 12983
                  • 108 Posts
                  Quote from: c-m at Oct 30, 2008, 11:57 AM

                  #1 worked great.

                  I don’t understand your answer to #2 though.

                  I’ll try to explain Eol’s interesting answer to your question #2.
                  You asked: "Only the owner/creator to be able to edit them?"

                  I think Eol’s suggesting to use php and query the DB (e.g. using the DB API) in order to know the "createdby" field of the document; if there is correspondence between the current weblogged user and the createdby info, you know that FDM should render, say, the "edit" and "delete" buttons. So, you could make the FDM call from php, using the
                  $modx->runSnippet('FDM', $Params)
                  way, where the $Params will be dynamically generated with that previously explained knowledge; that is, something like this in a foreach or whatever:
                  $Params['disable'. $disablethat] = '1';
                  

                  ...even if I suspect that syntax won’t work but I hope it makes the idea; probably you will use something like:
                  eval("$Params['disable'". $disablethat ."] = '1';")
                  

                    • 4429
                    • 429 Posts
                    Quote from: sottwell at Oct 30, 2008, 12:09 PM

                    [*id*] is referring to the ID of the page with the FDM snippet call (it returns the id of the current page). Maybe [+id+] would work?

                    nope [+id+] doesn’t work either. sad
                      • 4429
                      • 429 Posts
                      Quote from: insert_nick at Oct 30, 2008, 05:16 PM

                      Quote from: c-m at Oct 30, 2008, 11:57 AM

                      #1 worked great.

                      I don’t understand your answer to #2 though.

                      I’ll try to explain Eol’s interesting answer to your question #2.
                      You asked: "Only the owner/creator to be able to edit them?"

                      I think Eol’s suggesting to use php and query the DB (e.g. using the DB API) in order to know the "createdby" field of the document; if there is correspondence between the current weblogged user and the createdby info, you know that FDM should render, say, the "edit" and "delete" buttons. So, you could make the FDM call from php, using the
                      $modx->runSnippet('FDM', $Params)
                      way, where the $Params will be dynamically generated with that previously explained knowledge; that is, something like this in a foreach or whatever:
                      $Params['disable'. $disablethat] = '1';
                      

                      ...even if I suspect that syntax won’t work but I hope it makes the idea; probably you will use something like:
                      eval("$Params['disable'". $disablethat ."] = '1';")
                      



                      Rossco with help from Dimmy has done exactly what I want to achieve. He did promise a write up, but I expect he has been busy. In anycase I’ve tried PMing him but as of yet have no reply.