1. REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Resolved Sportsbook thumbnail image

Discussion in 'Sportsbook Support' started by colcar, Sep 21, 2020.

  1. colcar

    colcar Member AMS Premium Pickem Sportsbook

    Hi Bob, is there any awy to specify a custom thumbnail image for Sportsbook?

    At the moment it just shows the logo of my forum, I'd prefer to put something more related to betting in its place.

    [URL unfurl="true"]https://cardiffcityforum.com/sportsbook/[/URL]
     
  2. colcar

    colcar Member AMS Premium Pickem Sportsbook

    Ah, it didn't unfurl :LOL:

    Well the thumbnail it shows is my forum logo, you can trust me on that, lol
     
  3. Bob

    Bob Developer Staff Member

    That is an XF2 feature. This site is running XF 1.5 ;)

    What do you mean by Cover Image? Sportsbook doesn't have one (its never had one). AMS has a Cover Image, however, that is specific functionality built into AMS.

    Sportsbook does have an ICON (Category Image), however, that is not something that can be set as an OG IMAGE as its too small (OG requires at least 400x400).
     
  4. colcar

    colcar Member AMS Premium Pickem Sportsbook

    Hey Bob, what I'm wondering is if there is an option somewhere to set the image for SportsBook in the samae way I can set an image for a thread so that when I post a link to it that image shows up instead of the forum logo.

    For example, if I type the link to SportsBook into Sharing Debugger - Facebook for Developers the image they fetch is my forum logo:

    [​IMG]

    I would like to know if I can specify a different image for that.
     
  5. Bob

    Bob Developer Staff Member

    Threads do not set a OG image. As you can see below, threads are NOT passing in OG related arg data to the metadata macro (which means that the OG image being reported in the <head> is the SITE LOGO).

    Code:
    <xf:macro template="metadata_macros" name="metadata"
        arg-description="{$fpSnippet}"
        arg-shareUrl="{{ link('canonical:threads', $thread) }}"
        arg-canonicalUrl="{{ link('canonical:threads', $thread, {'page': $page}) }}" />
    What threads DO HAVE however are POSTS with IMAGES and sometimes, the Facebook Debuger (not always) will pick out one of those attachment images and use that as the OG image instead of the Site Logo (that is controlled by facebook tho, not XF).

    There are also some 3rd party addons that do things like add Cover Image functionality to Threads, which includes reporting that cover image as the OG image. Also, I believe that in XF 2.2.0 RC 2, the new Article Threads are also setting an OG image if the Article Thread System determines that there is an acceptable image in the first post of the thread (nobody has seen that code yet as XF 2.2.0 RC 2 has not been released yet.... well, as I am tying this, they release RC 2 lol).

    As I've said, the only thing currently that a Sportsbook event has that could even be used to set an OG image, would be the Category Icon, however, its TOO SMALL, so Facebook would REJECT it even if I did set it.

    What might work for you RIGHT NOW is editing the template 'event_view' and pass in a custom image via arg-ImageUrl to set a custom OG image for Sportsbook.

    This is what Sportsbook is using currently (which as you can see, is the same as threads).
    Code:
    <xf:macro template="metadata_macros" name="metadata"
        arg-description="{$descSnippet}"
        arg-shareUrl="{{ link('canonical:sportsbook', $event) }}"
        arg-canonicalUrl="{{ link('canonical:sportsbook', $event, {'page': $page > 1 ? $page : null}) }}" />
    Modifying it to pass in an image url and setting the twitter card to large (optional) might look a bit better than facebook displaying the site logo when sharing sportsbook events on Facebook.

    Code:
    <xf:macro template="metadata_macros" name="metadata"
        arg-description="{$descSnippet}"
        arg-shareUrl="{{ link('canonical:sportsbook', $event) }}"
        arg-canonicalUrl="{{ link('canonical:sportsbook', $event, {'page': $page > 1 ? $page : null}) }}"
        arg-imageUrl="{{ base_url('styles/default/xenaddons/sportsbook/category_images/sb_cover_image.png', true) }}"
        arg-twitterCard="summary_large_image" />
    Note: You'll need to upload your custom image to styles/default/xenaddons/sportsbook/category_images/image_name.extension as well as change the sb_cover_image.png to what ever your image name and extension is.

    As for CHANGES in Sportsbook... there is at least 1 suggestion for being able set set a Cover Image (similar to AMS) and if that happens, I'd be adding in a generic cover image that would be used as the OG image if an event didn't have a cover image set.
     
  6. colcar

    colcar Member AMS Premium Pickem Sportsbook

    That's wondeful Bob, thanks for that, I will give it a try and report back!
     
    Bob likes this.
  7. colcar

    colcar Member AMS Premium Pickem Sportsbook

    Ah, doesn't seem to have worked for me unfortunately, just getting the forum logo as og image again.
     
  8. Bob

    Bob Developer Staff Member

    Its not going to change any existing SHARED events, only NEW ones (unless you clear and recache). ALSO, its up to Facebook or Twitter to decide if the OG image you have in your header meets THEIR requirements.

    Can you post a LINK to one of your Sportsbook events so that I can see what is in the HEAD of your event.
     
  9. colcar

    colcar Member AMS Premium Pickem Sportsbook

    Ah, it HAS worked for events, that's great, thanks!

    [​IMG]

    I was looking to get an og image to show for this address: Sportsbook

    Is there a way to do that?
     
  10. Bob

    Bob Developer Staff Member

    You'd need to edit the index template and do something similar. Index pages usually do not have OG images, so Sportsbook Index is only setting the cononical_url (which uses a different macro).

    Template: xa_sb_index

    Code:
    <xf:macro template="metadata_macros" name="canonical_url"
        arg-canonicalUrl="{{ link('canonical:sportsbook', null, {'page': $page > 1 ? $page : null}) }}" />
    Try replacing that block with this block (obviously you will need to modify this to add your own description and image).

    Code:
    <xf:macro template="metadata_macros" name="metadata"
        arg-description="add your description here"
        arg-shareUrl="{{ link('canonical:sportsbook') }}"
        arg-canonicalUrl="{{ link('canonical:sportsbook', null, {'page': $page > 1 ? $page : null}) }}"
        arg-imageUrl="{{ base_url('styles/default/xenaddons/sportsbook/category_images/sb_index_cover_image.png', true) }}"
        arg-twitterCard="summary_large_image" />
     
  11. colcar

    colcar Member AMS Premium Pickem Sportsbook

    That worked a charm, thanks again for that Bob! (y)
     
  12. colcar

    colcar Member AMS Premium Pickem Sportsbook

    OK, I'm really sorry about this Bob, you're going to hate me but it turns out the bookies were asking me if it was possible to set thumbnail images for EVENTS, I got it mixed up and thought they were asking about og images for SportsBook.

    So, the question is, is it possible to specify an image for each event because at the moment all the events have the same thumbnail image:

    [​IMG]
     
  13. colcar

    colcar Member AMS Premium Pickem Sportsbook

    Also Bob, if you were able to create an addon that provides a field where a moderator can specify the og image for that thread then you would sell a lot of them.

    For example, it would be great to have a field in this section when you can put a URL that will be used as the OG Image by Facebook and Twitter.
    [​IMG]

    The thing is, this was available in XF1 and lots of people used it but there isn't an addon for it in XF2 and people are crying out for it.

    I would be your first customer for it, this addon is desperately needed.
     
  14. EasyEazy

    EasyEazy Member CAS Premium RMS Premium UBS Premium Pickem Sportsbook

    As far as im aware you cant im sure Bob will correct me if im wrong. Just looking at your site could you not have more categories for your bets?

    As you can see by my list I have broken them down into categories which you can then assign the correct image too.
     

    Attached Files:

    Bob likes this.
  15. colcar

    colcar Member AMS Premium Pickem Sportsbook

    Yes, I am actually in the process of creating a few new categories today. That will probably have to suffice.

    Thanks for chipping in (y)
     
    EasyEazy likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.