We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12027
    • 63 Posts
    Made Ditto list my articles. A list with headings is not what anyone wants for a blog page though!

    If (small) pictures are possible in the intro text, I’d like Ditto to display the intro text with pictures. Failing that, I’d like it to include the first paragraph of the main text (with pictures). Failing that, I’d like it to output the whole article.

    If you know how to solve this, or have other suggestions on how to make my blog page go from a dull list of headings into a page that is interesting to look at (so the members will be happy), I’m happy to listen! smiley

    Here’s what I’m working on (wear eye protection as needed cool) http://scoopex1988.org/photon.html
      • 1634
      • 51 Posts
      Hi. Post your ditto call so we know how you’re doing it and can see what needs to be changed.
      AndyFlan wink
        Hmmmmm.

        It's all a delusion
        • 11975
        • 2,542 Posts
        Hi,

        I presume that your ditto call is minimal.
        You have to create a chunk in which you will write which placeholders (doc properties and tvs) to use.


        For instance, create a chunk called myTpl

        <h4>[+longtitle+]</h4>
        <p>[+introtext+]</p>

        add &tpl=`myTpl` to your ditto call.

        :-)
          Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
          • 12027
          • 63 Posts
          Thanks for the replies guys! smiley

          Here’s the entire blog document:

          [[Ditto? &startID=`18` &summarize=`10` &total=`40` &commentschunk=`FormBlogComments` &tpl=`nl_blog` &paginate=`1` &alwaysshow=`1`]]

          Showing [+start+] - [+stop+] of [+total+] articles.
          Listing pages: [+previous+] [+pages+] [+next+] {{mynewspubl}}


          Here’s the nl_blog chunk:

          <div class="nl_summaryPost">
          <h3><a href="[~[+id+]~]" title="[+title+]">[+title+]</a></h3>
          <div class="nl_info" >By <strong>[+author+]</strong> on [+date+]. <a href="[~[+id+]~]#commentsAnchor">Comments
          ([!Jot?&docid=`[+id+]`&action=`count-comments`!])</a></div>
          [+summary+]
          <div id="nl_comments_[+id+]" style="display: none;">
          [[Jot?&docid=`[+id+]`&action=`comments`]]
          </div>
          <p class="nl_link">[+link+]</p>
          </div>


          My main problem with pics in introtext is there seems to be no formatting/WYSIWYG editor for the intro text, is it possible?
            • 10449
            • 956 Posts
            For more control / options re: intro-texts, you can decide to not use the default introtext field, but create your own template variable and use that instead: e.g. a TV with a rich-text editor.
            There is no "out of the box" method for Ditto to check whether your content contains images or not (at least not that I’m aware of).
            Instead of using a WYSIWYG TV for the intro-portion, you could also just create an image-TV and combine it with the default introtext.
              • 1634
              • 51 Posts
              How about adding an image tv to your template then outputting that tv (using the image widget) in your layout.

              If you look back at heliotrope’s post and change the chunk as follows:

              <h4>[+longtitle+]</h4>
              [+myimagetv+]
              <p>[+introtext+]</p>
              
                Hmmmmm.

                It&#39;s all a delusion
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                I know that there was a plugin to make the introtext field use the rich text editor a long time ago, but I can’t find any reference to this now.
                  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
                  • 12027
                  • 63 Posts
                  Cool! Thanks again, this forums is *very* responsive I must say smiley

                  Hm, sorry, it might sound like I just wanna use MODx for a blog! Not so ofc, since it will be a full site with galleries, downloads, etc.

                  What I’m after is some way of presenting a interesting looking blog. That means outputting like the first paragraph of the blog post (optionally with any picture, or 1 picture if possible).

                  These pages will be edited by the members, so any coding magic I’d make would have to allow them to add a picture.

                  In the meantime, what’s wrong with my code above - ie. how do I at least make it output the intro text WITHOUT pictures?
                    • 10449
                    • 956 Posts
                      • 12027
                      • 63 Posts
                      Thanks guys!

                      I think I will use heading, picture, introtext as suggested.

                      adding [+myimagetv+] will automatically get the first image in the main article, if it exists?


                      Edit: Oh, I get it. But the point is that the members will create articles. Will they ’get it’? And does the TV only apply to the scope of the single article, or is it global?

                      Maybe I should include the whole article - but I’d need to cut it off after the first <p> of the main text, like Wordpress blogs or so - with a "More..." link.