• 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

#43
Is there a way to use this on the main page of my website, so outside the code of the forum/gallery itself? Basically as a independent included block/div I can add to the index-page of my website (which is not part of the forum-code itself).

Raymond
 

Martok

Well-known member
#44
Is there a way to use this on the main page of my website, so outside the code of the forum/gallery itself? Basically as a independent included block/div I can add to the index-page of my website (which is not part of the forum-code itself).

Raymond
No, the code is specific to XenForo.
 

Martok

Well-known member
#46
great article, but my portal (xenporta 2 ) do not show this.:cry:
This resource only supports XenPorta 1, not XenPorta 2 (the resource description states which portals this resource supports). You will have to ask in the discussion thread for that add-on for support with getting the media block to show in the XenPorta 2 sidebar.
 

ibaker

Well-known member
#47
Thanks Martok for the guide. I have been using this on my home page for a long time now.

There is one think that I am desperate to know, is there any way you can make it just display one specific user's album?
 

Martok

Well-known member
#48
There is one think that I am desperate to know, is there any way you can make it just display one specific user's album?
This resource just replicates what the standard XFMG media block does, it doesn't (and can't) add additional functionality. The answer therefore is no.
 
#49
I'm using the original XenPorta, and I just can't get this to work. I don't know if I've done something wrong, but the block simply does not display from the portal page. Help would be much appreciated!

Screenshot of block edit:


Code:
Code:
<div class="section" align="center">
<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">24</xen:set> // Any number. Number of images that are visible in the slider.
    <xen:set var="$limit">200</xen:set> // Any number. Number of images to be loaded (not all are visible).
    <xen:set var="$slideWidth">860</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>
 

Martok

Well-known member
#50
Remove the code and replace it with the word Test, then save. Can you now see the block? If not, it's not related to the code. Double check the other steps in the guide for XenPorta 1. If it still doesn't work, it's a XenPorta 1 issue, in which case you will need to ask the author for support.
 
#51
Remove the code and replace it with the word Test, then save. Can you now see the block? If not, it's not related to the code. Double check the other steps in the guide for XenPorta 1. If it still doesn't work, it's a XenPorta 1 issue, in which case you will need to ask the author for support.
Thanks for the quick response! Yeah, the "Test" text didn't do anything. It's odd though that blocks like Recent Threads show up just fine. I don't know enough about it to know why, but I'm more sad than anything, seeing as it's unmaintained, and the update is too high a Xenforo version to go with the current software I'm using. :(
 

marremp2

Active member
#52
Hello
Thanks a lot for this resource, I use this code to display videos in a widget through widget framework and it works very well. I just have one problem : one of the video suddenly disppeared from the selection. The only difference I can see between this video and others is that it received a rating. I tried to remove the rating, but the video is still absent.
How can I fix this ?
Thanks !
 

Martok

Well-known member
#53
Hello
Thanks a lot for this resource, I use this code to display videos in a widget through widget framework and it works very well. I just have one problem : one of the video suddenly disppeared from the selection. The only difference I can see between this video and others is that it received a rating. I tried to remove the rating, but the video is still absent.
How can I fix this ?
Thanks !
I've just tested this and adding a rating does not affect whether a media item appears or not (all of the ones I rated remained visible). There must be some other reason for it to disappear. Double check the template code. Also check to see if it was moved to a category or album that is not listed in the template code. Beyond that, I can't think of any reason why the video wouldn't be displayed.
 

Martok

Well-known member
#57
Hello !
Would it be possible to add a condition in the widget code to select media according to a media custom field value ?
That is beyond the scope of this guide. The code itself was provided by @Chris D and I don't think that data is exposed to be able to do this (if it was, you'd be able to do it in the built-in sidebar block that comes with the XFMG add-on).