Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Getting Icons to Work for Social XProfile Field Links (5 posts)

Started 9 months, 2 weeks ago by: gregfielding

  • Profile picture of gregfielding gregfielding said 9 months, 2 weeks ago:

    I’ve got links to other social sites as profile fields… Twitter, Facebook, etc. But instead of just showing the link, I’m trying to show icons. What I’m using is:

    <!--?php if ( $data = bp_get_profile_field_data( 'field=Tumblr' ) ) : ?-->
    <span><a href="<!--?php echo $data ?-->"><img class="avatar" src="http://housingstorm.com/files/2011/08/tumblr.png&quot; target="_blank"></a></span>
    <!--?php endif ?-->

    But the icon links to:
    http://housingstorm.com/gregfielding/profile/&lt;!--?php echo $data ?-->

    What am I doing wrong?

    Thanks!

  • Profile picture of Nahum Nahum said 9 months, 2 weeks ago:
    <ul>
    <?php if (bp_get_profile_field_data('field=Twitter') === "") : ?>
    <?php else:?>
    <li><a rel="me" href="<?php echo bp_get_profile_field_data( 'field=Twitter' ) ?>"><img src="yourimage"></a> </li>
    <?php endif;?>
    
    </ul>

    This is how I’ve done exactly this.

  • Profile picture of gregfielding gregfielding said 9 months, 2 weeks ago:

    Thanks!

  • Profile picture of Alan Alan said 9 months, 2 weeks ago:
    <?php $data = bp_get_profile_field_data('field=twitter'); ?>
    
                        <?php if(!empty($data)) :? >
                        <ul id="menu">
                             <li class="link">
                                 <a href="<?php echo $data; ?>" title="<?php echo $data; ?>"><img src="yourimage.jpg" alt="<?php echo $data; ?>" /><!--image --></a>
                            </li>
                        </ul>
                        <?php endif; ?>

    in case you want to add more then one social icon!

  • Profile picture of jon73 Jon Henwood said 7 months, 4 weeks ago:

    Hi

    Just what I am looking for I think. So if I understand right I create user profile fields for Facebook, twitter and linkedin and instead of displaying the user entered link it will display the icons for each.

    Next question where do and in which file do I place the suggested code?

    thanks