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

    Sorry to waste your time...

    I just finished creating a front-end news publishing page that allows a basic user to publish news items without accessing the manager.

    Here’s my snippett call
    [!NewsPublisher? &folder=`2` &canpost=`Site Admins` &formtpl=`FormBlog` &makefolder=`1` &rtcontent=`blogContent`!]


    As you can see, I have a chunk (FormBlog) used for the form template and a TV (blogContent) used for the editior.
    That replaced the original textarea as suggested by the docs.

    Here’s the chunk
        <form name="NewsPublisher" method="post" action="[~[*id*]~]">
            <input name="NewsPublisherForm" type="hidden" value="on" />
            <p>Note: Leaving the Publish Date empty will immediately publish your blog entry.</p>
            <fieldset class="wrap_blue">
              <legend>Entête du document</legend>
              <label>Titre</label>
              <input type="text" name="pagetitle" id="pagetitle" value="[+pagetitle+]" class="input" />          
              <label>Sous titre</label>
              <input type="text" name="longtitle" id="longtitle" value="[+longtitle+]" class="input" />          
              <label>Description</label>
              <input name="description" type="text" class="input" id="description" value="[+description+]" />          
              <label>Resume</label>
              <textarea name="introtext" rows="1" class="summury" id="introtext">[+introtext+]</textarea>          
            </fieldset>
    
            <fieldset class="wrap_grey">
              <legend>Contenu du document</legend>
              <label>Contenu</label>
              [*blogContent*]        
            </fieldset>
            
            <fieldset class="wrap_blue">
              <legend>Publication</legend>
              <label>Date de publication</label>
            <div>
                <div class="datepick_icon"><a onClick="nwpub_cal1.popup();" onMouseOver="window.status='Select date'; return true;" onMouseOut="window.status=''; return true;"><img src="manager/media/style/MODxLight/images/icons/cal.gif" width="16" height="16" alt="Select date" /></a></div>
                <div class="datepick_icon"><a onClick="document.NewsPublisher.pub_date.value=''; return true;" onMouseOver="window.status='Remove date'; return true;" onMouseOut="window.status=''; return true;"><img src="manager/media/style/MODxLight/images/icons/cal_nodate.gif" width="16" height="16" alt="Remove date" /></a></div>
                <input type="text" name="pub_date" id="pub_date" value="[+pub_date+]" class="input" />
            </div>
              <div class="buttons">
                <input name="send" type="submit" value="PUBLIER L'ARTICLE" class="button" />
              </div>          
            </fieldset>
          </form>
    	<script type="JavaScript" src="manager/media/script/datefunctions.js"></script>
        <script type="text/javascript">
                var elm_txt = {}; // dummy
                var pub = document.forms["NewsPublisher"].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>      
    
    



    When I try to publish a test article, I get "Missing News Content". I followed the steps sugegsted in the documentation and even read a few posts including http://modxcms.com/forums/index.php/topic,10726.0.html and http://modxcms.com/forums/index.php?topic=881.0, but nobody seems to be able to figure out what’s going on.

    Am I doing anything wrong here?
      A MODx Fanatic
      • 36592
      • 970 Posts
      Try changing
      &rtcontent=`blogContent`

      to
      &rtcontent=`tvblogContent`

        • 30585
        • 833 Posts
        Quote from: tkfm at Feb 20, 2009, 02:52 PM

        Try changing
        &rtcontent=`blogContent`

        to
        &rtcontent=`tvblogContent`



        It worked. Thanks a lot!

        Do you know why though? Just curious,
          A MODx Fanatic
          • 7231
          • 4,205 Posts
          Do you know why though?
          In some of the older snippets TVs were identified like that (not sure why, must have been a reason). Even Ditto used that syntax until a short while back (well maybe not that short). A good habit to get into is to read the notes in the code for each snippet to see the specific syntax it expects. Since anyone can produce a snippet they come with all sorts of peculiarities grin
            [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]