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.

Displaying a member's location in comments?

April 30, 2009 7:13pm

Subscribe [3]
  • #1 / Apr 30, 2009 7:13pm

    Tony Gravett

    34 posts

    Here is the code I’m using, but the {location} field is never displaying any data:

    {exp:comment:entries weblog="{my_weblog}" limit="25" entry_id="{segment_3}"}
    
       <b>{name}</b>{if location} <i>({location})</i>{/if} says:
    
       <div class="entryBodyComment">{comment}</div>
    
       <div class="entryPosted">{comment_date format='%l, %F %j, '%y'}</div>
    
    {/exp:comment:entries}

    Thsi is of course inside a {exp:weblog:entries} tag.

    I can verify that some geographic information has been added to the field for certain members, but it never displays.

  • #2 / Apr 30, 2009 7:19pm

    Arun S.

    792 posts

    Have you tried moving it outside the weblog:entries tag?  The comment:entries tag does not need to be inside it and I’m wondering if that’s causing any interference here.

    Try moving the comment:entries tag outside of weblog:entries and see if it works.

  • #3 / Apr 30, 2009 7:29pm

    lebisol

    2234 posts

    what Arun S. said and also try removing the condition.
    Perhaps your weblog has the same custom field of {location}?

  • #4 / Apr 30, 2009 7:44pm

    Arun S.

    792 posts

    Ahh, I didn’t notice the conditional.  That construction has caused me some problems in the past.  It works in certain circumstances but doesn’t in others.  I’m not sure what the determining factor is. 

    You might also try this conditional:

    {if location != ""}{location}{/if}
  • #5 / Apr 30, 2009 10:23pm

    Tony Gravett

    34 posts

    I didn’t test which of these did the trick, but I changed both, and they fixed the problem!

    I’ll test some more when I’m clear of the launch threshold, and will report back.

    Many thanks for helping me think outside the {brackets} !

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases