Question Resize Postbit Icons

Status
Not open for further replies.

etrd

Customer
Is there a way to limit the size of item icons in postbit say 32x32 without affecting the display size of the item icons in item shop? I understand there's a 'Maximum item icon dimension' setting but that controls the icon dimension globally, it applies both to item shop icons and postbit icons. We would prefer if we could set smaller icons in postbit and larger icons in item shop.
 
Postbit icons are already scaled to 24x24. The maximum icon dimension should be set with icons displayed in the shop list / shop page in mind, not the postbit. Optimised scaled versions are already being generated upon save.
 
So by default the icon size ratio of shop to postbit is 8. When shop icon is 192px then the postbit icon is 24px (192/24 = 8) . Where in templates can we edit to change the ratio to, say 6?
 
The shop icon system uses the avatar size system, meaning if you were to change the scaling, it would also affect your forum avatars.

The reason why it uses the avatar scaling system is that all the back-end scaling work has already been done by XF.
 
You could potentially use dbtechShopPostbit--item CSS class with avatar--xxs sub-selectors to modify the size.
 
If anyone is interested just go to dbtech_shop.less template and search for

Less:
        &.avatar--xxs
        {
            <xf:if is="$xf.options.dbtechShopItemIconMaxDimensions.width">
                width: {{ $xf.options.dbtechShopItemIconMaxDimensions.width * ($xf.options.dbtechShopItemIconMaxDimensions.disableScaling ? 1 : 0.125) }}px !important;
            </xf:if>
            <xf:if is="$xf.options.dbtechShopItemIconMaxDimensions.height">
                height: {{ $xf.options.dbtechShopItemIconMaxDimensions.height * ($xf.options.dbtechShopItemIconMaxDimensions.disableScaling ? 1 : 0.125) }}px !important;
            </xf:if>
        }

replace 0.125 with X

where X is equal to icon postbit size divided by icon itemshop size

So if you want 192x192px itemshop icons to generate 32x32px postbit icons you need to replace 0.125 with 0.167 (32/192 = 0.167) so the new code above should look like this...

Less:
        &.avatar--xxs
        {
            <xf:if is="$xf.options.dbtechShopItemIconMaxDimensions.width">
                width: {{ $xf.options.dbtechShopItemIconMaxDimensions.width * ($xf.options.dbtechShopItemIconMaxDimensions.disableScaling ? 1 : 0.167) }}px !important;
            </xf:if>
            <xf:if is="$xf.options.dbtechShopItemIconMaxDimensions.height">
                height: {{ $xf.options.dbtechShopItemIconMaxDimensions.height * ($xf.options.dbtechShopItemIconMaxDimensions.disableScaling ? 1 : 0.167) }}px !important;
            </xf:if>
        }

....
 
Hello @etrd,

We hope your ticket regarding DragonByte Shop has been addressed to your satisfaction. This ticket has now been scheduled to be closed.

If your ticket has not been resolved, you can reply to this thread at any point in the next 7 days in order to reopen the ticket, afterwards this thread will be closed.

Please do not reply to this thread if your ticket has been resolved.

Thank you.


- DragonByte Technologies, Ltd.
 
Hello @etrd,

As we have not heard back from you, your ticket regarding DragonByte Shop has now been closed.

If your ticket has not been resolved, please feel free to start a new support ticket and link back to this ticket.

If you have time, please leave a review on XenForo.com's Resource Manager.

Thank you.


- DragonByte Technologies, Ltd.
 
Status
Not open for further replies.

DragonByte Shop

XenForo 1.5.3+ XenForo 2.0.x XenForo 2.1.x XenForo 2.2.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
3,203
Customer rating
5.00 star(s) 3 ratings
Back
Top