We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21610
    • 360 Posts
    Here and at me a question...
    I cause Ditto and I use a following pattern:
    <h1>
      <a href="[(base_url)][~[+id+]~]">
         [+pagetitle+]
      </a>
    </h1>
    
    <div class="author">Author [+author+] - [+date+]</div>
    
    <div class="news">
      <p>[+introtext+]</p>
      <div class="more">[+link+]</div>
    </div>
    



    1) the Problem:
    if [+introtext +] the document empty to deduce "content" the document without the reference is more detailed on it.
    Type:
    <h1>
      <a href="[(base_url)][~[+id+]~]">
         [+pagetitle+]
      </a>
    </h1>
    
    <div class="author">Author [+author+] - [+date+]</div>
    
    <div class="news">
        <p>[+content+]</p>
    </div>
    
    



    1) the Problem: I tried to make check of type:
    if (strlen("[+introtext+]">0))
       {
       return "<p>[+introtext+]</p>
       <div class=\"more\">[+link+]</div>";
    }
    else
    {
       return "[+content+]";
    }
    



    Has not worked :-( And whether there is such attribute at Ditto as [+content +]!?

    P.S.:
    If to solve this problem it will be possible to facilitate to itself a life... I.e. if your news not greater, and you would not want that the user pressed the button "more in detail" and read too most. You simply fill news in [*content *] both leave "introtext" empty and are not soared in this occasion)

    P.P.S.: Thanks the translator www.translate.ru
      Разработка сайтов на MODx
      • 18397
      • 3,250 Posts
      Use [+summary+]
        • 21610
        • 360 Posts
        Where it to use or instead of what!?
          Разработка сайтов на MODx
          • 4295
          • 98 Posts
          ...instead of [+introtext+]
            • 21610
            • 360 Posts
            Check in a pattern

            if (strlen("[+summary+]">0))
               {
               return "<p>[+introtext+]</p>
               <div class=\"more\">[+link+]</div>";
            }
            else
            {
               return "[+content+]";
            }





            tpl:
            <h1>
              <a href="[(base_url)][~[+id+]~]">
              [[imgnews]][+pagetitle+]
              </a>
            </h1>
            
               <div class="author">Íàïèñàë [+author+] - [+date+]</div>
            
            <div class="news">
               [[pro]]
            </div>
            


            Does not work

            http://www.fifateam.ru/x/news.html
              Разработка сайтов на MODx
              • 18397
              • 3,250 Posts
              Just use [+summary+]. It performs this pattern check for you.
                • 21610
                • 360 Posts
                Excuse but I for the first time collide with Ditto and to me much is not clear :-(

                You could not help me

                So I cause Ditto
                [!Ditto? &tpl=`ditto_news` &sortBy=`pub_date` &summarize=`10` &dateFormat=`%d.%m.%Y` &truncText=`ïîäðîáíåå` &paginate=1  &startID=`82`!]
                


                tpl (ditto_news):
                <h1>
                  <a href="[(base_url)][~[+id+]~]">
                  [+pagetitle+]
                  </a>
                </h1>
                
                   <div class="author">Íàïèñàë [+author+] - [+date+]</div>
                
                <div class="news">
                   [[prointrotext]]
                </div>
                


                snippet (prointrotext):
                if (strlen("[+introtext+]">0))
                   {
                   return "<p>[+introtext+]</p>
                   <div class=\"more\">[+link+]</div>";
                }
                else
                {
                   return "[+content+]";
                }
                


                Where I am not right!? Help to write competently.
                  Разработка сайтов на MODx
                  • 21610
                  • 360 Posts
                  Can much clearly...

                  But the purpose it is achieved in that what if news is deduced completely, there was no reference "more in detail" on it separately...
                    Разработка сайтов на MODx
                    • 21610
                    • 360 Posts
                    I so have understood it in general to make it is impossible...?
                      Разработка сайтов на MODx
                      • 18397
                      • 3,250 Posts
                      Replace [[prointrotext]] with [+summary+]. Ditto will do the rest....

                      Now I remember why I hate free translation services.............