XF tips Add a button that requires Like to download Resource using code

xenforo

Well-known member
Staff member
Administrator
Moderator
Premium
Mar 18, 2019
779
3,427
Today, I introduce to you how to add a button that requires Like to download Resource in short and simple code.
Note:
1. This button is only for clarifying the requirement that you want to give to members as to Like to download Resource.
2. This button is only displayed in Overview page, not on other pages.

First, open the sample xfrm_resource_view and look to the line <div class = "block-outer" > and insert the following code:
Code:
<!-- This is place to write the code for XFRM information-->
            <div align="center">
            <div class="button"><i class="fas fa-smile"></i> You must click like in order to download this resource.
            <div class="button"><i class="fas fa-download"></i> You can download 20 resources per day.
                </div></div></div>
            <!-- End of placement for code for XFRM Information -->
Then open the Extra.less file and add the following code:

Code:
.button {
  background-color: #008CBA; /* Light Blue */
  border-radius: 12px;
  border: none;
  color: white;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
}


1591402400654.png


Here is another customization of the above code:
Customization 1:

1591402484260.png
 
  • Like
Reactions: Gestionar

Mascot art byDigitalKaiju