We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Quote from: identity at Nov 27, 2006, 08:22 PM

    Okay, through some experimentation and lots of frustration... haven’t figured it out, but have discovered some interesting things...

    After creating a blog entry or a news story... both using NewsEditor, it is still just appending the raw id to the end of the domain... something.com/32. After I edit and save a file in the manager, any file, doesn’t even have to be the blog or news story, and then refresh the front end, the proper URL shows for the blog entry or news item... something.com/blog/article-1164680020

    But I’m no closer to figuring out the cause..... open for any ideas! :’( huh :’(

    NewsManager needs to clear the cache after adding a page, otherwise, the alias is not in the site map loaded from the siteCache file.
      • 12652
      • 228 Posts
      I’m calling all of the snippets uncached, but is that not enough?

      [!Ditto? &startID=`2` &summarize=`2` &total=`20` &commentsChunk=`JotComments`!]

      [!NewsEditor? &folder=`2` &postid=`2` &canpost=`Site Admins` &formtpl=`FormBlog` &footertpl=`JotComments` &makefolder=`1` &rtcontent=`tvrteContent`!]


      What I don’t understand is that, at least as far as I can remember, it worked fine on the 0.9.2.1 version. As it stands then, there would be no point in the NewsPublisher/NewsEditor snippets to create blogs or news on the front end because they would result in 404’s until something was saved on the backend in the Manager.
        | Identity Developments delivers SEO focused web design and web presence services
        - it's not about websites, it's about your identity. |
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I believe that the NewsEditor snippet has an option to clear the cache that needs to be set - &clearcache=`1`
          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
          • 12652
          • 228 Posts
          kiss kiss kiss

          Brilliant!

          That appears to have done it. I saw the option but forgot about it and it worked before changing to the new version so I didn’t think much about it.

          Thanks, as always!
            | Identity Developments delivers SEO focused web design and web presence services
            - it's not about websites, it's about your identity. |
            • 8960
            • 150 Posts
            I’m seeing 2 issues with NewsManager.

            First:
            The buttons listed on the actual NewsManager page are:


            • Show
            • Edit
            • Delete
            • Move on Top
            • ???
            • Unpublish

            I know item #5 is ’hide/show in menu’, but where do I edit the NewsManager snippet to actually show me the value for this button?

            Second:
            When I create a new news item through the News Editor, it automatically get dropped in the root of my document tree instead of in the folder I specified as my News folder.

            Other than that, this is a brilliant snippet!
              • 29577
              • 11 Posts
              Hi,

              Quote from: er16004 at Dec 12, 2006, 06:46 PM

              I’m seeing 2 issues with NewsManager.

              First:
              The buttons listed on the actual NewsManager page are:


              • Show
              • Edit
              • Delete
              • Move on Top
              • ???
              • Unpublish

              I know item #5 is ’hide/show in menu’, but where do I edit the NewsManager snippet to actually show me the value for this button?

              Second:
              When I create a new news item through the News Editor, it automatically get dropped in the root of my document tree instead of in the folder I specified as my News folder.

              Other than that, this is a brilliant snippet!


              The NewsManager snippet uses a default template with the following code for the hide/show menu button at line 201:

                    <div class="nm_button">
                      <!-- Hide/show in menu -->
                      <form name="formhide" method="post" action="">
                        <input name="hidemenuvalue" type="hidden" value="[+hidevalue+]" />
                        <input name="hidemenuid" type="hidden" value="[+id+]" />
                        <input type="submit" class="button" name="hidemenu" value="[+hidemenu+]" />
                      </form>
                    </div>
              


              The placeholders [tt]hidevalue[/tt] and [tt]hidemenu[/tt] have their value according to the value of the current news topic. Note that hidemenuid must be set to the id of the news topic if you want to create a custom template.

              The NewsEditor snippet must have &folder set to the news folder id, did you do that? If yes can you send the code of the newsmanager the newseditor call?

              Kind regards,

              Ronald
                • 8960
                • 150 Posts
                The NewsEditor snippet must have &folder set to the news folder id, did you do that? If yes can you send the code of the newsmanager the newseditor call?

                Here’s my code for both the NewsEditor & NewsManager. You’ll notice it is quite simple:
                [!NewsEditor? &folder='26' &postid=`64` !]

                [!NewsManager? &folder=`26` &editformid=`65` !]
                <p><a href="[~65~]">Create new post.</a></p>


                Folder 26 is my Latest News folder. When I create a new post, like I said, the new post gets dropped into the root (id 0) and not the Latest News folder (26).

                ********************

                As for my other issue with the buttons (I’ve attached a picture), I’m using the default snippet code, just like you posted, but you’ll notice the 5th button isn’t being displayed. When checking the source code, there’s no value in the input tag for that line, even though my unchanged snippet code shows the exact same code you posted (line 206 on my HTML editor).

                I’m using MODx 0.9.5 in case that comes up.
                  • 7923
                  • 4,213 Posts
                  Use backticks ` in snippet calls instead of single quotes ’


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 8960
                    • 150 Posts
                    Crap! Great catch, doze!

                    It’s an easy mistake to make when you copy-n-paste this code from different resources. I should have triple checked that (especially since I double checked it already).
                      • 16885
                      • 255 Posts
                      This is going to be one big hell of a bump, but since the actual autogenerated topic doesn’t work I don’t have much of a choice :p

                      I’m using this nice system right now, but I’m facing a problem, as my webpage is send as application/xhtml+xml, Firefox and Opera wont display the content if theres a (big) error in the code given. In the case of NewsManager that is the fact that it simply outputs the & used in snippet calls (and it also outputs the complete parsed chunk you specify as footer, which I don’t get at all; why doesn’t it just return the {{Chunkname}}?

                      Anyway, I’d love to hear how I can fix this, if I can get rid of the chunk being parsed I’ve solved the biggest part of the problem already wink