We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 708
    • 144 Posts
    hi

    i want to add to my template a news block...but it’s not for a blog just for a classic website...so i dont understand how it works whith ditto because i havent any articles,only contet pages and news separately of content...in a page "news" for example...

    i think many of yours have done this in past ...so i’ll very glad to receive yous tips smiley
      AipHesBlOg
      Serveur Local Linux Ubuntu - Apache 2.2.9 - Php 5.2.6 - MySQL 5.0.67
      ---------------------------------------------------------------
      French webdesigner
      • 708
      • 144 Posts
      i’ve found one solution : http://modxcms.com/forums/index.php?topic=34441.0
      is there anymore ?
        AipHesBlOg
        Serveur Local Linux Ubuntu - Apache 2.2.9 - Php 5.2.6 - MySQL 5.0.67
        ---------------------------------------------------------------
        French webdesigner
        • 708
        • 144 Posts
        questions after applying what is explained below :
        - how to parameter the number of lines of the news display in the ditto list ?
        - how to hide the autor or the date in the ditto list ?
          AipHesBlOg
          Serveur Local Linux Ubuntu - Apache 2.2.9 - Php 5.2.6 - MySQL 5.0.67
          ---------------------------------------------------------------
          French webdesigner
          • 7231
          • 4,205 Posts
          - how to parameter the number of lines of the news display in the ditto list ?
          The number of returned items &display=`10` change 10 to the number of news items you want o display

          - how to hide the autor or the date in the ditto list ?
          You should build a custom TPL to format the output the way you want.

          Displaying news, articles or any other data in Ditto is the same process if it is a blog or not.
          Create a chunk as the tpl, for example:

          <div class="news">
          <h3>[+longtitle+]</h3>
          <p>[+introtext+]</p>
          <p class="read-more"><a href="[~[+id+]~]">Read Full Story</a></p>
          </div>


          You can also use the summary extender to be able to truncate the content filed.
          Here is the Ditto support site with a list of all the available parameters:
          http://ditto.modxcms.com/files/snippet-ditto-php.html
            [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]
            • 708
            • 144 Posts
            - how to parameter the number of lines of the news display in the ditto list ?
            The number of returned items &display=`10` change 10 to the number of news items you want o display

            we dont understand each other...i want to know how to display an extract of each news to give an overview to the customer...like

            Title of the news - date
            Extract
            Link

            i go to do what you tell for the other part of my questions... wink

            just a problem; i had put a block in my right sidebar but it display news only when i’m on the news’page...not whan i’m on another...

            code like :
             <div id="actus">
                        [[Ditto?depth=`1` &display=`3` &sortBy=`editedon`&depth=`4`&noResults=`Pas d'actualités récentes`]]</div>
            		</div>
              AipHesBlOg
              Serveur Local Linux Ubuntu - Apache 2.2.9 - Php 5.2.6 - MySQL 5.0.67
              ---------------------------------------------------------------
              French webdesigner
              • 7231
              • 4,205 Posts
              just a problem; i had put a block in my right sidebar but it display news only when i’m on the news’page...not whan i’m on another...
              Include a &parents=`` parameter to define the parent ID of the news section. So if the news section ID is 13 you would add &parents=`13` to the Ditto call. By default it uses the current document that is loaded.
                [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]
                • 708
                • 144 Posts
                ok it works great smiley

                another problem in this code(in actus page not in sidebar):
                [[Ditto?depth=`1` &display=`3` &sortBy=`editedon`&depth=`4`&filter=`author,2`&noResults=`Pas d'actualités récentes`]]


                the parameter
                &noResults=`Pas d'actualités récentes`
                isnt display on globality...the screen show only "Pas d’actua"...whats wrong ?
                  AipHesBlOg
                  Serveur Local Linux Ubuntu - Apache 2.2.9 - Php 5.2.6 - MySQL 5.0.67
                  ---------------------------------------------------------------
                  French webdesigner
                  • 7231
                  • 4,205 Posts
                  isnt display on globality...the screen show only "Pas d’actua"...whats wrong ?
                  It should work. I wonder if this could be related to the é character. Test this by removing the é from the text and see if it works.
                    [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]
                    • 708
                    • 144 Posts
                    yes an accent problem...strange because in the sidebar it works good and its not html coded... huh how to resolve this ? can i html code accent in the snippet insertion ?

                    for my filter problem ,do you think the best way to dont display author is to do a chunk ? like i done for the sidebar ?


                      AipHesBlOg
                      Serveur Local Linux Ubuntu - Apache 2.2.9 - Php 5.2.6 - MySQL 5.0.67
                      ---------------------------------------------------------------
                      French webdesigner
                      • 7231
                      • 4,205 Posts
                      If it work in one place it should work in the other as well. Try re-typing it to make sure that when you paste it no char data gets sent with it.

                      for my filter problem ,do you think the best way to dont display author is to do a chunk ? like i done for the sidebar ?
                      Yes. THe author is being displayed as part of Dittos default tpl, the only way to overwrite it is to have your own chunk tpl.
                        [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]