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

Adding the XFMG Media Block to a sidebar or portal page

Add the media block in the standard sidebar, Featured Threads, Widget Framework & XenPorta 1

  1. Martok

    Martok Well-Known Member

    Martok submitted a new resource:

    Adding the XFMG Media Block to a sidebar or portal page - Add the media block in the standard sidebar, Featured Threads, Widget Framework & XenPorta

    Read more about this resource...
     
    Cyb3r, Gemma and Chris D like this.
  2. Allan

    Allan Well-Known Member

    Thank you Martok :)

    One question, it's possible to use XFMG Media Block with tab option to Widget Framework?
     
    StonePilot likes this.
  3. Martok

    Martok Well-Known Member

    Ive never tried, I don't use the tab option but I don't see why not. Let me know if it works. :)
     
  4. Allan

    Allan Well-Known Member

  5. Martok

    Martok Well-Known Member

  6. Allan

    Allan Well-Known Member

    With tab:
    Screenshot_5.png

    Without tab:
    Screenshot_6.png

    Tested on flexile style and original style.
     
  7. estranged

    estranged Well-Known Member

    Thank you for this. It seems this is not the same block that comes with xenforo media gallery. Is there a way to make it look like exactly same as the one in the forum index?
     
  8. Martok

    Martok Well-Known Member

    It isn't the same block as that is specific to the XenForo forum index. It should be similar though and you can probably style it to be similar too. Instructions on styling the block title are in the resource. Beyond that I've not tried anything as I don't use the main block, only the sidebar block. You will need to play around with CSS to achieve the look you require.
     
    estranged likes this.
  9. Chad

    Chad Active Member

    Hey folks. Using the widget framework but having a bit of header problem.

    See attached. If I use advanced template without wrapper, it shows no header. If I use advanced template with wrapper, I get double headers.
     

    Attached Files:

  10. Martok

    Martok Well-Known Member

    It does have a header, I can see it in the screenshot. It says "Media". You would have to style this to match the block headers in your style.

    You could try using this, but you'd need to remove this line of code:

    Code:
    <xen:set var="$blockPhrase">{xen:phrase xengallery_new_media}</xen:set> // Use either {xen:phrase xengallery_new_media}, {xen:phrase xengallery_random_media} or your own custom title
    You'd then need to put an appropriate Title in the widget (which you haven't, hence it shoieing [Advanced] Template in your screenshot).
     
  11. Chad

    Chad Active Member

    Thanks. Close, but one last problem.
     

    Attached Files:

  12. Russ

    Russ Well-Known Member

    Just for kicks, in the template you created and pasted this code:

    Code:
    <xen:include template="xengallery_media_block">
    <xen:set var="$blockPhrase">{xen:phrase xengallery_new_media}</xen:set> // Use either {xen:phrase xengallery_new_media}, {xen:phrase xengallery_random_media} or your own custom title
    <xen:set var="$blockId">XFMGMediaForumListSidebar</xen:set> // This can be changed but must be something unique.
    <xen:set var="$type">new</xen:set> // You can set this to 'rand' for a random selection.
    <xen:set var="$items">2</xen:set> // Any number. Number of images that are visible in the slider.
    <xen:set var="$limit">20</xen:set> // Any number. Number of images to be loaded (not all are visible).
    <xen:set var="$slideWidth">160</xen:set> // This is the width of each slide in the slider. The slides may not be exactly this width due to responsive design resizing them dynamically.
    <xen:set var="$categories">all</xen:set> // Use a comma separated list to display images from selected categories e.g. 2,3,5,7. Set to 'all' to include all categories, 0 to exclude
    <xen:set var="$albums">1</xen:set> // Set to 1 to include images from albums, 0 to exclude
    <xen:set var="$isSidebarBlock">1</xen:set> // Sets the styling so it will look like a sidebar block
    <xen:set var="$captions">1</xen:set> // Set to 1 to show captions on hover, set to 0 to always hide.
    <xen:set var="$noResponsive">1</xen:set> // Set to 0 for responsive, 1 for fixed. Responsive will show more images at a smaller size at narrower browser widths, fixed will keep the number of images set in $items at the same size whatever the browser width.
    </xen:include>
    
    Can you wrap this div around it? Then try without the wrapper:

    Code:
    <div class="section">
    <xen:include template="xengallery_media_block">
    <xen:set var="$blockPhrase">{xen:phrase xengallery_new_media}</xen:set> // Use either {xen:phrase xengallery_new_media}, {xen:phrase xengallery_random_media} or your own custom title
    <xen:set var="$blockId">XFMGMediaForumListSidebar</xen:set> // This can be changed but must be something unique.
    <xen:set var="$type">new</xen:set> // You can set this to 'rand' for a random selection.
    <xen:set var="$items">2</xen:set> // Any number. Number of images that are visible in the slider.
    <xen:set var="$limit">20</xen:set> // Any number. Number of images to be loaded (not all are visible).
    <xen:set var="$slideWidth">160</xen:set> // This is the width of each slide in the slider. The slides may not be exactly this width due to responsive design resizing them dynamically.
    <xen:set var="$categories">all</xen:set> // Use a comma separated list to display images from selected categories e.g. 2,3,5,7. Set to 'all' to include all categories, 0 to exclude
    <xen:set var="$albums">1</xen:set> // Set to 1 to include images from albums, 0 to exclude
    <xen:set var="$isSidebarBlock">1</xen:set> // Sets the styling so it will look like a sidebar block
    <xen:set var="$captions">1</xen:set> // Set to 1 to show captions on hover, set to 0 to always hide.
    <xen:set var="$noResponsive">1</xen:set> // Set to 0 for responsive, 1 for fixed. Responsive will show more images at a smaller size at narrower browser widths, fixed will keep the number of images set in $items at the same size whatever the browser width.
    </xen:include>
    </div>
    
     
    Chris D and Chad like this.
  13. Chad

    Chad Active Member

    Bamn you got it! Thanks :)
     
  14. Martok

    Martok Well-Known Member

    Thanks @Russ, your solution for styling seems much better than mine (using Extra.css and doing it yourself). I'll update the resource shortly to use your approach. :)
     
  15. Martok

    Martok Well-Known Member

    CyclingTribe and Chris D like this.
  16. sinucello

    sinucello Well-Known Member

  17. melbo

    melbo Well-Known Member

    I'm trying to get a Font Awesome icon to display before New Media in the XFMG Sidebar widget (widget framework) but its not working by changing the template or by changing the phrase. I've also tried to remove $Blockphrase from the xengallery_media_block_sidebar template to see if I could get the block to display the widget title instead. Still no luck. Any ideas?

    The FA image I'm trying to insert:
    Code:
    fa-picture-o
    Unicode: f03e
    <i class="fa fa-picture-o"></i>
     
  18. gldtn

    gldtn Well-Known Member

    Is it possible to include videos in this widget as well? To me it seems to be pulling only images even though I have categories set to all.
     
  19. Martok

    Martok Well-Known Member

    There isn't an option to exclude videos, the block shows all media from specified albums and categories.
     
    gldtn likes this.
  20. gldtn

    gldtn Well-Known Member

    I mean INclude, it seemed to me it wasn't including videos at first since I had the block set to random.. I just did a test and changed it to new, where I knew there was a video recently added and it showed up.

    Disregard my question :p

    Thanks!
     

Share This Page