We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15745
    • 92 Posts
    Quote from: sottwell at Jul 17, 2009, 01:49 AM

    The links in the <h4> tags work fine. The [+introtext+] placeholders should work; are you sure you have content in the individual documents’ summary (introtext) fields? Or see this... http://www.pogwatch.com/ditto/ditto-extenders/ditto-summary.html

    The text for the [+link+] placeholder is set by &truncText, default being `Read more...` (or equivalent in the relevant language file). You can set the code for the link using &tplTrunc to point to a chunk, file or code string of your own.

    The links do not take you to the actual document you just remain on the same page. Each document has two paragraphs of dummy text.
      Version: 0.9.6.3
      North Shore Web Design
      • 16278
      • 928 Posts
      I think the ambiguity of the term "template" is causing problems here. Looking at your id=60 page right now, I see three trailers down the right column for pages 63, 62 and 61, and the links take you to those pages. They happen to look exactly the same as each other, probably because you have put the Ditto call in a site template which you’ve attached to all these pages.

      Pages 61, 62 and 63 don’t need a Ditto call to display the full articles, so they need a template without one -- whether they can share one with other pages depends on how you’ve arranged things elsewhere.

      The term "blog" isn’t that well defined either - as I read it, you want trailers on your home page to lead to one of two pages that are themselves containers for the full articles. Each of those pages would have a Ditto call generating an index to its children. You’d have two Ditto calls on the front page, each restricting its display to one item using &total=`1` (so only the first item in your chosen order will be retrieved from the database). Your tpl chunk for the front-page items will have a static link to the relevant container for each category.

      Letting page 60 stand in for the home page:
      60) Home page with trailers to latest News and Reports
      70) News folder
      --71) news item
      --72) news item
      --73) news item
      80) Reports folder
      --81) report item
      --82) report item
      --83) report item

      page 60 Ditto calls:
      [!Ditto? &parents=`70` &total=`1` &tpl=`tpl.news.trailer`!]
      [!Ditto? &parents=`80` &total=`1` &tpl=`tpl.report.trailer`!]

      tpl.news.trailer includes:
      <h4><a href="[~70~">[+title+]</a></h4>

      tpl.report.trailer includes:
      <h4><a href="[~80~]">[+title+]</a></h4>

      page 70 Ditto call includes &tpl=`tpl.news.blog`, linking to the full articles and defining the "blog" display as you want it
      <h4><a href="[~[+id+]~]">[+title+]</a></h4>

      If page 70 is the parent of the news articles, there’s no need to set &parents, just specify how many to display, order, pagination etc. in the other parameters. Page 80 would have a similar call naming tpl.report.blog as the chunk.

      This structure means creating a number of pages and chunks, but you can see where you are with it. I’m sure it could be reduced down to fewer elements using tagging and smarter coding, but I suggest you keep it as simple and open as possible while you sort things out. I just hope it’s what you are looking for!
      laugh KP
        • 15745
        • 92 Posts
        I’ve been looking over the info you gave me. I don’t kno why but I just ain’t getting it undecided.
        Here’s what I’ve done (my numbers are in red for reference) and I put the code I’m using in each section

        60(60) Home page with trailers to latest News and Reports
        this page uses the template ’blog’ which has the following code in it
        [!Ditto? &parents=`64` &total=`1` &tpl=`tpl.news.trailer`!]
        [!Ditto? &parents=`67` &total=`1` &tpl=`tpl.reports.trailer`!]
        the page can be seen here http://www.massflyfishing.com/cms/index.php?id=60

        70(64) News folder This page uses the following call(this is where I’m messing things up:
        <P>[[Ditto? &tpl=`tpl.news.blog' ]] </P>
        <DIV class=ditto_item id=ditto_item_[+id+] &tpl="tpl.news.blog">
        <H3 class=ditto_pageTitle><A href="http://massflyfishing.com/cms/[~[+id+]~]" mce_href="[~[+id+]~]">[+pagetitle+]</A></H3>
        <DIV class=ditto_documentInfo>by <STRONG>[+author+]</STRONG> on [+date+]</DIV>
        <DIV class=ditto_introText>[+introtext+]</DIV></DIV>

        The two items below are documents(articles) for the blog.
        --71(65) news item - just has regular text in it (should there be some kind of ditto call?)
        --72(66) news item - just has regular text in it (should there be some kind of ditto call?)

        80(67) Reports folder again, this page uses the following call(this is where I’m messing things up:
        <DIV class=ditto_item id=ditto_item_[+id+]>
        <H3 class=ditto_pageTitle><A href="http://massflyfishing.com/cms/[~[+id+]~]" mce_href="[~[+id+]~]">[+pagetitle+]</A></H3>
        <DIV class=ditto_documentInfo>by <STRONG>[+author+]</STRONG> on [+date+]</DIV>
        <DIV class=ditto_introText>[+introtext+]</DIV></DIV>

        The three items below are documents(articles) for the blog.
        --81(68) report item - just has regular text in it (should there be some kind of ditto call?)
        --82(69) report item - just has regular text in it (should there be some kind of ditto call?)
        --83(72) report item - just has regular text in it (should there be some kind of ditto call?)

        Here are the chunks I created (thanks KP):
        tpl.news.blog
        <h3><a href="[~[+id+]~]">[+title+]</a></h3>

        tpl.news.trailer
        <h4><a href="[~64~]">[+title+]</a></h4>

        tpl.reports.blog
        <h3><a href="[~[+id+]~]">[+title+]</a></h3>

        tpl.reports.trailer
        <h4><a href="[~67~]">[+title+]</a></h4>



        All I’m trying to do is create two blogs(#64, #67) with links from the homepage. The links should have a brief description but I couldn’t get that to work either. You’ll notice nothing shows up when you click from the (id=60) page to a blog link. I want all the blogs to show but they don’t. I tried several different things (you see the code is different on the blogs) I’m at a point where a little knowledge is dangerous and I’m not seeing where my errors are. Sorry to be such a pain in the a-- but I know I’m close.
          Version: 0.9.6.3
          North Shore Web Design
          • 16278
          • 928 Posts
          Things have progressed a little... lipsrsealed
          One major problem with the Ditto call on your p64, two lesser ones:
          <P>[[Ditto? &tpl=`tpl.news.blog' ]] </P>
          That apostrophe after `tpl.news.blog’ should be a backtick, `tpl.news.blog`. Then, I think, the reference to the tpl chunk will work.

          It works if you use &amp; instead of a plain ampersand for parameters, but it is distracting. It’s safer to work on snippet calls in plain text rather than the rich-text editor (RTE), which as well as converting ampsersands to entities, might make less harmless changes. You can set the document to not use the RTE in the Page Settings tab, so you don’t have to keep selecting "None" in the "Editor to use".

          Your page declares itself as XHTML 1.0 Transitional, so all the HTML tags should be in lower case. It will still work in most browsers, but it won’t ever validate. All attributes in your template chunks’ HTML, should have quotes around the data, e.g. class="ditto_item".

          Still a little way to go on structure. Your blog page (64) should contain the Ditto call, and will output the result of the Ditto call. The content and format of the result is determined by the tpl chunk, and that’s where the tags and placeholders go, not after the Ditto call.

          Once you sort out the call on p64 and the tpl.news.blog chunk, it will simply be a case of copying it to p67 and changing the chunk name. Maybe not even that, if the format is the same for both blog pages, they could share a template chunk.

          The actual articles (p68 etc.) are just plain old documents, they don’t need anything to link them up to Ditto and the template chunks. They do, however, need to contain anything that Ditto and the template chunks refer to, so if you’re using [+introtext+] in a chunk, you have to write something in the Introtext field of the full item for the chunk to extract.
          smiley KP
            • 15745
            • 92 Posts
            ok - it’s starting to sink in grin. One thing I was confusing was pages 64 & 67. I want these two pages to show all the blog posts. Right now I have them set up with links to yet another page. So if someone wants to read the blog, he’d have to go through three pages (homepage, 64 or 67, and then the actual blog entry) I’m going to fix the calls on 64 and 67 and see what I come up with. Thanks again for all your help.
              Version: 0.9.6.3
              North Shore Web Design