Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72416

Blogger B:if for comments and b:loop tag for displaying commnets

$
0
0

i have a blog on blogger: Mobtakr I wanted to display comments in posts using the blogger tag b:loop instead of this data code

<data:post.commentHtml/>

So i used this code cause i wanted to implement schema markup for comments : ​

<ol id="top-ra">
<b:loop values='data:post.comments' var='comment'>
  <li itemscope='itemscope' itemtype='https://schema.org/Comment'  class="comment" expr:id='data:comment.anchorName'>
<div class="comment-block">
<div class="comment-header">
<b:if cond='data:comment.authorUrl'>
<a expr:href='data:comment.authorUrl' itemprop='author' itemscope='itemscope' itemtype='https://schema.org/Person' rel='nofollow'>
<span itemprop="name">
<data:comment.author/>
  </span>
</a>
<b:else/>
<a expr:href='data:comment.authorUrl' itemprop='author' itemscope='itemscope' itemtype='https://schema.org/Person' rel='nofollow'>
<data:comment.author/></a>
</b:if>
<time expr:datetime="data:comment.timestamp" itemprop="dateCreated"  class="datetime secondary-text">
<data:comment.timestamp/>
  </time>
  </div>
<p  class='comment-body' expr:id='data:widget.instanceId + data:comment.cmtBodyIdPostfix' itemprop='text'>
<data:comment.body/>
</p>
    </div> 
<div class="comment-replies"> 
<ol >

<b:loop values='data:post.comments-replies' var='comment'>
/*
So i want to loop the replies here and add some custom styles to them */ 
</b:loop> 
</ol>
    </div> 
</li>
</b:loop>
</ol>

the problem is i cant find a condition for comment replies or if the comment has replies then loop its replies with some style to make the replies different from the comment itself and margin the replies.

So, can anyone help me ?

Is there a b:if tag with the condition cond="hasReplies" ?


Viewing all articles
Browse latest Browse all 72416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>