We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42753
    • 17 Posts
    I use "Peoples" snippet to list the users. Users have a checkbox in theirs profile: "My profile is public". So I need to use somewhat about this in the output chunk (I use Peoples's default pplUser):

    [[+showprofile:is=`on`:then=`User info`]]


    But it doesn't work. How could I achieve this?

    This question has been answered by nir-z. See the first response.

      • 36996
      • 211 Posts
      If User info is the chunk name, I would change the name to User_info, and:
      [[[[+showprofile:is=`on`:then=`$User_info`]]]]
        • 42753
        • 17 Posts
        Quote from: nir-z at Feb 21, 2013, 12:42 AM
        If User info is the chunk name, I would change the name to User_info, and:
        [[[[+showprofile:is=`on`:then=`$User_info`]]]]

        Tried. Doesn't work at all - returns a blank page.
        • discuss.answer
          • 36996
          • 211 Posts
          Since showprofile is an extended field you need a prefix for the placeholder
          [[+extended.nameOfExtendedAttribute]]

          I hope this will make it work.
            • 42753
            • 17 Posts
            Quote from: nir-z at Feb 21, 2013, 01:33 AM
            Since showprofile is an extended field you need a prefix for the placeholder
            [[+extended.nameOfExtendedAttribute]]

            I hope this will make it work.

            Yes, that's the cause. But the variant with the chunk doesn't work, it shows properly only the first user, for other all the user fields are empty. But without a chunk everything works nornally:

            [[+extended.showprofile:is=`on`:then=`<li>
                <div class="row-fluid">
                    <div class="span1">
                        <img class="avatar" src="assets/users/[[!If? subject=`[[+photo]]` &operator=`notempty` &then=`[[+id]]/[[+photo]]` &else=`default-avatar.png`]]">
                    </div>
                    <div class="span5">
                        <strong>[[+username]]</strong>
                        <br>
                        [[!outputGamesArray? &id=`[[+id]]` &preText=`<span class="label label-info">` &postText=`</span>`]]
                    </div>
                    <div class="span3">
                        <small class="[[!switch? &get=`[[+extended.status]]` &c1=`Занят` &do1=`busy` &c2=`Свободен` &do2=`free`]]"><i class="icon-time"></i> [[+extended.status]]</small>
                    </div>
                    <div class="span3">
                        <small><strong>[[+extended.price]] руб. / [[+extended.pricefor]]</strong></small>
                    </div>                    
                </div>
            </li>`]]