ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

comments question

February 01, 2011 6:29pm

Subscribe [4]
  • #1 / Feb 01, 2011 6:29pm

    Crnaovca

    627 posts

    Maybe I use it wrong, but if someone can take a look.

    I have code like this:

    {exp:comment:entries sort="desc" limit="20" orderby="date" entry_id="{segment_2}"}
                <div class='komentar'>
    {if avatar}{avatar_url}{/if}              
    <a href="#" class='kom_username'>{name}</a><small> - {comment_date format="%d %m %Y"}</small>
    
                  
    
                  {comment}
                </div>
    {/exp:comment:entries}
    
    
    {exp:comment:form} 
    {if logged_out}
                <div class='komentar'>
                  <a href="#" class='kom_username'>www.site.com</a>
                  
    
                  some text
                </div>
    
    {/if}
    {/exp:comment:form}
    
                <div class='floatfresh'> </div>
              </div>
            </div>
    
    {exp:comment:form} 
    {if logged_in}
           <div id='dodaj_komentar' class='box box_vijest'>
              <div class='box_naslov2'><span></span><h4>Add comment</h4><p><small></small></div><br />
              <div class='vijest_slike'><br />
                <div class='komentar'><br />
         {if avatar}{avatar_url}{/if} <br />
                    <textarea class='kom_textarea' name="comment">{comment}</textarea><br />
                    <input value='Add comment' type='submit' class='kom_submit' name="submit" /><br />
                </div><br />
                <div class='floatfresh'> </div><br />
              </div><br />
            </div><br />
            <div class='floatfresh'> </div><br />
    {/if}<br />
    {/exp:comment:form}

    in this part

    {if logged_in}
           <div id='dodaj_komentar' class='box box_vijest'>
              <div class='box_naslov2'><span></span><h4>Add comment</h4><p><small></small></div><br />
              <div class='vijest_slike'><br />
                <div class='komentar'><br />
         {if avatar}{avatar_url}{/if} <br />
                    <textarea class='kom_textarea' name="comment">{comment}</textarea><br />
                    <input value='Add comment' type='submit' class='kom_submit' name="submit" /><br />
                </div><br />
                <div class='floatfresh'> </div><br />
              </div><br />
            </div><br />
            <div class='floatfresh'> </div><br />
    {/if}

    avatar is not displayed. But on this part of code

    {exp:comment:entries sort="desc" limit="20" orderby="date" entry_id="{segment_2}"}
                <div class='komentar'>
    {if avatar}{avatar_url}{/if}              
    <a href="#" class='kom_username'>{name}</a><small> - {comment_date format="%d %m %Y"}</small>
    
                  
    
                  {comment}
                </div>
    {/exp:comment:entries}


    it is displaying. How to fix that? Also, can I write this part of code in this way?

    {if avatar}
    {avatar_url}
    {elseif}    
    There is no picture
    {/if}
  • #2 / Feb 02, 2011 2:29pm

    Ingmar

    29245 posts

    What version and build of EE are you using? Why do you have two comment forms on one page?

  • #3 / Feb 02, 2011 5:33pm

    Crnaovca

    627 posts

    u have a point there :D
    obviusly since I was doing some changes I forgot to delete. Thank for that. What about avatar picture?

    Version 2.1.3 Build 20101220

  • #4 / Feb 03, 2011 8:28am

    Sue Crocker

    26054 posts

    Hi, Crnaovca. In EE 2.1.4 using the Agile theme, the avatar displays correctly in a comment.

  • #5 / Feb 03, 2011 8:42am

    Crnaovca

    627 posts

    ok ... i will look into agile theme and if needed even copy paste solution.

    How to question - if there is avatar, then show avatar, if there is no avatar, show some other picture?
    can I do like

    {if avatar}

    do this

    {elseif}

    do that

    {/if}

  • #6 / Feb 04, 2011 3:46am

    John Henry Donovan

    12339 posts

    Crnaovca,

    Your if:else syntax is incorrect. Try this

    {if avatar}
    {avatar_url}
    {if:else}
    There is no avatar
    {/if}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases