1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Adding YouTube to Member Profile Page

Discussion in 'Styling and Customization Questions' started by Sheldon, Apr 7, 2012.

  1. Sheldon

    Sheldon Well-Known Member

    Alright, I am 100% a complete noob on this, so please hang with me. What I am attempting, I have hardcoded on my local install. Here is the image showing such:
    [​IMG]

    My members are all about customization, and if they like it, we attempt to bring it in to them. The area I hardcoded this at is inside the ad_member_view_below_avatar. I realize that likely this won't be an option to use that template, but I just wanted to attempt to get the video to show, which was a success. Now, I am hoping somehow, I can set it up to allow this as a Custom Profile Field (like ArnyVee's Panoramic image display he added.

    Here is the hardcode of what I have
    Code:
    <xen:hook name="ad_member_view_below_avatar" />
    <iframe width="192" height="156" src="http://www.youtube.com/embed/X2HYBosYQNo" frameborder="0" allowfullscreen></iframe>
    Again, I realize it can't be done this way, especially for user customization. I am just lost at where to begin. Thus far, I have created a custom userfield called YouTube...
    Field ID: YouTube
    Title: YouTube
    Description: blah blah blah
    Display: Preferences ???

    Field Type: Single-Line Text Box ???
    Value Match: URL ???

    User Editable = checked

    I am assuming I can somehow use the example Arny has provided, and tweak the code to allow it to show somewhere in that template?
    Code:
    <xen:if is="{$user.customFields.testfield}">
        <img src="path/to/images/{$user.customFields.testfield}.jpg" />
    </xen:if>
    I am not sure what code to edit, I assume it would be the img scr part, and of course replacing the testfield bit.

    Am I headed in the correct direction with this? Can anyone help, or point me in the correct place. Just trying to add something that can be used by the community, as well as start learning xenForo a bit better.

    I appreciate any and all help.
     
  2. Sheldon

    Sheldon Well-Known Member

    Ok, moving onto the next step, and I am sure I have it wrong, considering... :oops:

    I attempted to mess around with the example from Arny's post. I left my original video hardcoded below, for reference to see if anything would change, or I could get something to appear. I now have this:
    [​IMG]

    Here is what I have coded in that template from above:
    Code:
    <xen:hook name="ad_member_view_below_avatar" />
    <xen:if is="{$user.customFields.YouTube}">
        <iframe width="192" height="156" src="{$user.customFields.YouTube.$value}" frameborder="0" allowfullscreen></iframe>
    </xen:if>
     
    <iframe width="192" height="156" src="http://www.youtube.com/embed/X2HYBosYQNo" frameborder="0" allowfullscreen></iframe>
    Where am I going wrong? I mean, honestly, I am glad I got something to at least appear... hah.

    In Firebug is shows the source coming from "h"
    [​IMG]
    o_O
     
  3. Sheldon

    Sheldon Well-Known Member

    Ok, no matter what I have tried, I cannot get this:
    [​IMG]

    To transfer EXACT into the code part of:
    Code:
    <iframe width="192" height="156" src="{$user.customFields.YouTube.$value}" frameborder="0" allowfullscreen></iframe>
    Does it just need to be $value or $valueUrl ?
     
  4. ArnyVee

    ArnyVee Well-Known Member

    Stew, I'm finishing dinner, but you may want to try just the YagboJGglfA&ob part of the code in the profile field (the part after the =) and see if that works.
     
  5. Sheldon

    Sheldon Well-Known Member

    Yeah, trying that now... still not getting it to transfer over.

    Got this coded:
    Code:
    <xen:hook name="ad_member_view_below_avatar" />
    <xen:if is="{$user.customFields.YouTube}">
        <iframe width="192" height="156" src="http://www.youtube.com/watch?{$user.customFields.YouTube.$value}" frameborder="0" allowfullscreen></iframe>
    </xen:if>
    
    In Firebug, I get this:
    [​IMG]

    So, it is attempting to gather something... the "v". I have tried multiple things, just not sure where it is incorrect at.
     
  6. Sheldon

    Sheldon Well-Known Member

    Ok.

    Got it to grab the exact info.
    [​IMG]

    It just isn't displaying a video... hahaha.
     
  7. Sheldon

    Sheldon Well-Known Member

    Done. Wooooooooohooooooooo.

    [​IMG]

    Now to wrap this beast in conditionals... hehe.
     
    ArnyVee likes this.
  8. ArnyVee

    ArnyVee Well-Known Member

    Alright! :D
     
  9. Sheldon

    Sheldon Well-Known Member

    Just confused on how to wrap multiple custom profile fields in conditionals now...
     

Share This Page