We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2685
    • 44 Posts
    I’ve been trying to design CSS for the content of the blogs.
    But it wud be hard to design it without any ids n classes.
    So I want to define chunk as a template for the doc created by the ditto.

    In default blog content...I just found the content(without any tags) and just the {{comment}} below.

    So how do we do it huh


      • 16278
      • 928 Posts
      First create a model item using standard HTML, your CSS classes and dummy contents. Then replace the contents with placeholders for the fields you want. Copy that into a chunk that will be your own template, and connect to it from your Ditto call with &tpl=`myChunk`. E.g.

      <div class="blogItem"
      <h3 class="blogHead">This is my title</h3>
      <div class="blogAuthor">By Fred Bloggs</div>
      <div class="blogDate"> 11 May 09</div>
      <div class="blogBody"> Anfd this is the content </div>
      </div>
      

      becomes
      <div class="blogItem"
      <h3 class="blogHead">[+title+]</h3>
      <div class="blogAuthor">[+author+]</div>
      <div class="blogDate">[+date+]</div>
      <div class="blogBody">[+content+]</div>
      </div>

      which you copy into a chunk called "myChunk", and call with
      [[Ditto? &tpl=`myChunk` &dateSource=`createdon` &dateFormat=`%d %b %y`]]

      Et voila!
      laugh KP
        • 2685
        • 44 Posts
        It sounded grt. fren,
        but I think there is little misunderstanding

        [!Ditto? &startID=`46` &canpost=`Site Admins` &parents=`46` &summarize=`10` &removeChunk=`Comments` &tpl=`ditto_blog` &paginate=`1`&extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags` &showItems=`1`!]

        I guess this displays the list and contents of the blogs.
        And it already includes &tpl=`ditto_blog`
        where, ditto_blog is the chunk with template for showing the list of the blogs not for the templates for the documents that are going to be created as we add blog entry


        I thought Ditto adds blog entry lipsrsealed
        but actually Newspublisher adds blog entry, as follows, doesn’t it?

        [[NewsPublisher? &folder=`46` &canpost=`Registered Users` &formtpl=`FormBlog` &footertpl=`Comments` &makefolder=`1` &rtcontent=`tvblogContent`]]



        In short smiley

        For example:

        When I add a blog entry,

        say "Starting a new company", it creates a document in the blog container.

        the doc created in container just contains

        <p> content of it </p>{{comments}}

        What I want to do is change template of this.
        Instead of just using <p></p> I want to add divs and others.

        [!NewsPublisher? &folder=`46` &canpost=`Registered Users` &template=`Deerwalk-blue-blog` &formtpl=`FormBlog` &footertpl=`Comments` &makefolder=`1` &rtcontent=`tvblogContent`!]

        &template is the setting of template of newly created doc but not its blog content wink