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

Add "Start Conversation" button to userbit?

Discussion in 'Styling and Customization Questions' started by Morgain, Feb 9, 2012.

  1. Morgain

    Morgain Well-Known Member

    I's like to add a "Start Conversation" button to userbit?
    that is under the avatar and title that sits beside a message.

    My "Start Conversation" is Phrased as "TALK!"
    so it wouldn't get in the way.

    What do I add and where?
  2. Morgain

    Morgain Well-Known Member

    I think it's the message_user_info template
    I can get my trusty test word "POOH" :) to show up under the avatar or under the user title.

    I tried copying in the same code that works under the user avatar and title on the Profile page
    <!-- TALK BUTTON -->
    <xen:hook name="member_view_info_block">
    <br /><xen:if is="{$canStartConversation}">
    <dd><a href="{xen:link 'conversations/add', '', 'to={$user.username}'}">
    <input type="submit" class="button primary" value="{xen:phrase start_conversation}" />
    but no effect. Tried it in various positions but I can only get my test word to show up- not the conversation button.

    Also I notice in that template there are blocks of code further down this template which can display various items of data like the user's Location, but somehow they are not enabled to show up. How do I control that please?
  3. steel_curtain

    steel_curtain Well-Known Member

    It doesn't look like $canStartConversation is exposed in that template, so won't be possible to do that way without an add on. However, you could change that up a bit and do something like this...

    <xen:if is="{$visitor.user_id}"><a href="{xen:link 'conversations/add', '', 'to={$user.username}'}">
    <input type="button" value="{xen:phrase start_conversation}" class="button primary" /></a></xen:if>
    Doing it that way will only show the link to logged in users.

    Also, to turn on the extra user info you'll need to enable the Show custom user fields option in message elements.

    ACP > Appearance > Styles > Your Style > Message Elements > Settings
    Tracy Perry likes this.
  4. Morgain

    Morgain Well-Known Member

    DID IT!
    Used the Convo button I'd got on the Memberlist item.

    <!-- CONVO BUTTON -->
    <div style="float: left; margin-left: 20px; margin-top: 13px; margin-bottom: 3px;">
            <xen:if is="{$visitor.user_id} AND {$user.user_id} != {$visitor.user_id}">
            <div><a href="{xen:link conversations/add, '', 'to={$user.username}'}" class="button" style="background-color: #99cc99; letter-spacing: 3pt;">{xen:phrase start_conversation}</a>
        <xen:if hascontent="true">
            <div class="extraUserInfo">
    The blue code is there already I just included it as a landmark.
    Jake Bunce and Tracy Perry like this.
  5. Morgain

    Morgain Well-Known Member

    Oh Steel thank you I didn't see your post as I composed mine.
    Thanks for the tip on the custom fields. Actually that's a whole lot of help because I hadn't discovered that section.
  6. Mutt

    Mutt Well-Known Member

    damn, I wish I could get canstartconvo to work in message_user_info
  7. sforum

    sforum Active Member

    Thanks for this, Morgain; that's exactly where I wanted the PM button as well. :)

    Can anyone help me with styling it? At the moment it looks pretty terrible, and I don't think some newbies even realise it's a button:


    If anyone can help me with a nice CSS button, I'd really appreciate it. Or even using an image as a button - I'd prefer CSS, but either is fine. :)

  8. Morgain

    Morgain Well-Known Member

    There's a control for buttons in Style Properties.
  9. sforum

    sforum Active Member

    Thanks - I've just had a look at it, but it's all a bit over my head, I'm afraid. I don't want to change anything in case it messes up other buttons/parts of the style!

    If you/anyone can help with how I might just style that one button in the userbit, I'd really appreciate it.
  10. erich37

    erich37 Well-Known Member

  11. sforum

    sforum Active Member

  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    What changes do you want to make to the button? Color? Font? If you can be specific and post a URL to your forum then I can help with some custom CSS.
  13. sforum

    sforum Active Member

    Thanks very much! Link is in my sig, or you can see how it looks in the screenshot a few posts above this.

    I basically want the Private Message button to stand out, and look like an obvious button (at the moment it just looks like a shaded box). A nice bright blue button, with rounded edges, would be perfect! :)
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I see no link.
  15. sforum

    sforum Active Member

    Sorry Jake - I had to remove it, as I started getting inundated with spammers a few hours after I put it in my sig! I usually get about 1 spammer a day, whereas since I put the link in my sig yesterday I have had at least 30! :eek:

    I have since changed my forum to Arty's Soft Responsive style, which I gather is more complicated than your 'average' style, so I will ask the question in his support thread in case there is anything specific to his style that one has to bear in mind when styling this link/button.

    Thanks for your help. :)

Share This Page