We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36549
    • 572 Posts
    Hi,

    I have two news articles with titles, date and summary to display in a sidebar. When the user clicks on this they are taken to the full article...standard stuff.
    I have set up my chunk like this:
      <div class="news">
          <div class="date">
              <p><span>14</span>
    AUG</p>
          </div>
          <div class="article">
            <p><a href="[~[+id+]~]">[+pagetitle+]</a>
    [+introtext+]</p>
        </div>
    </div>

    ...but how do i replace the
    <p><span>14</span><br />AUG</p>
    so that it’s dynamically generated.

    My other issue is that when the actual ’News’ page is displayed...
    [!Ditto? &amp;tpl=`articlePreview` &amp;display=`all`!]
    ...it displays exctly the same as it does on the sidebar (obviously) but i don’t want the width constrained as it is in the sidebar, instead i’d just like the news items to be listed and taking up the full width of the content area
    Hope that makes sense.

    Thanks for any help

    J
      www.9thwave.co.uk
         WEB | DESIGN | PRINT
      • 36592
      • 970 Posts
      Quote from: janice171 at Aug 20, 2008, 03:53 PM

      ...but how do i replace the
      <p><span>14</span><br />AUG</p>

      so that it’s dynamically generated.
      You can use [+date+] placeholder in your Ditto template.
      And you should check &dateSource and &dateFormat parameter to set the [+date+] placeholder.
        • 36549
        • 572 Posts
        Hi

        thanks for the reply.
        So how would i seperate the number and the month...as you will see from the html the number appears above month with a break (
        ) seperating them??
          www.9thwave.co.uk
             WEB | DESIGN | PRINT
          • 36592
          • 970 Posts
          For example, you can use this parameter.
          &dateFormat=`<p><span>%d</span><br />%b</p>`
          

          where %d is replaced by 2 digit day number and %b by the shortened form of the month name.
            • 36549
            • 572 Posts
            Hi,

            Thanks for that info.
            I’m a bit confused though so forgive me for the simple questions...
            Presumably i add the %d and %b to the CHUNK and the &dateFormat to the ditto call???

            If this is correct what do i add to the call &dateFormat=` `

            UPDATE: i just got it...i needed to add the [+date+] placeholder in the html chunk where the date is to be displayed...ok i’m getting there:-)

            I have one more issue that i need some advice on...
            my ditto call is:
            [!Ditto? &tpl=`articlePreview` &display=`all` &dateFormat=`<p><span>%d</span>
            %b</p>`!]

            ...and this displays as i want it in the sidebar of my template but i want it to display differently on the ’News’ page...a simple list of the articles would be fine with title and maybe the date...do i create another chunk and call this?

            Thanks again for any help
              www.9thwave.co.uk
                 WEB | DESIGN | PRINT
              • 36592
              • 970 Posts
              Quote from: janice171 at Aug 21, 2008, 04:21 AM

              i want it to display differently on the ’News’ page...a simple list of the articles would be fine with title and maybe the date...do i create another chunk and call this?
              Yes, you have to change Ditto template(=chunk) for that News page.

              There are some way of doing this.
              1) Create another site template,which contain another Ditto call, and asign this to that News page.
              2) Create template variable, which stores the Ditto template(=chunk) name and use in &tpl parameter.
              or threre might be other solutions for this.