RM 2.0 Thumbnail dimensions

ChrisTERiS

Active member
Hello,

In xF1 version, in file library/XenResource/Model/Resource.php there was a variable:
Code:
public static $iconSize = 96;
which I was able to edit for changing thumbnail width.

Where this variable is locating for xF2 version?

Thank you
Chris
 

Mike

XenForo developer
Staff member
It's mapped to avatar sizes in XF2:
Code:
$targetSize = $this->app->container('avatarSizeMap')['m'];
In src/addons/XFRM/Service/ResourceItem/Icon.php.
 

3rd AnGle

Well-known member
It's mapped to avatar sizes in XF2:
Code:
$targetSize = $this->app->container('avatarSizeMap')['m'];
In src/addons/XFRM/Service/ResourceItem/Icon.php.
so how can we define the dimensions in this line of code to change the icon size to 200px X 150px ?
 

ibaker

Well-known member
It's mapped to avatar sizes in XF2:
Code:
$targetSize = $this->app->container('avatarSizeMap')['m'];
In src/addons/XFRM/Service/ResourceItem/Icon.php.
So how do you change it to a "square" say 100px x 100px
 

ibaker

Well-known member
Thanks Chris but that doesn't do anything. The thumbnails stay the same at 48px square:
1.jpg

2.jpg
 

Chris D

XenForo developer
Staff member
Yeah it will need some CSS/Less too. In extra.less try:
Less:
.structItem.structItem--resource
{
   .structItem-cell--icon.structItem-cell--iconExpanded
   {
      width: 116px;

      .structItem-iconContainer
      {
         .avatar:not(.structItem-secondaryIcon)
         {
            .m-avatarSize(100px);
         }
      }
   }
}
 

ibaker

Well-known member
Perfect @Chris D (as always from you)

Although personally I think it is much better placed in the xfrm.less with a xf:comment. This way it only gets pulled up when using the RM instead of so much extra baggage that is pulled up when a user access any and every page in a site when always placing stuff in the extra.less. For example if placed in the extra.less, this code would be pulled up when looking at the Forum List Page, the Thread List page etc etc etc even though it is not needed at all. So many people put so much in the extra.less and they don't realise that they are always pulling all that stuff up on every single site page load yet 90% of it is not relevant to that page thus increasing load times, site bandwidth, user data etc. plus how do they know if something is fixed/changed in a template at an update that would effect the code in the extra.less...a real headache. The inclusion/use of the extra.less is very bad in just my humble opinion

Thanks again Chris
 
Top