- Tham gia
- 28/02/2015
- Bài viết
- 16,829
- Được Like
- 12,690
Thêm vào bên dưới nút download font-awesome và tooltip cho tab tài nguyên
Trong diễn đàn của tôi, đôi khi người dùng (chủ yếu là người dùng mới) không thể tìm thêm thông tin về các nguồn tài nguyên (như các phiên bản, cập nhật, các tab tùy chỉnh và ...).
Và bởi vì chúng tôi sử dụng font awesome cho các tab danh hiệu, vì vậy vấn đề này sẽ xảy ra nhiều hơn.
Bây giờ chúng ta hãy xem làm thế nào chúng ta có thể thêm các tab (sử dụng font awesome + tooltip) ngay bên dưới nút download, do đó tất cả những người tải về tài nguyên chắc chắn sẽ nhìn thấy chúng.
Mở template "resource_view_header" và tìm đoạn code sau:
Thay thế bằng đoạn code sau:
Điều này cũng sẽ hỗ trợ Commercial Resource's Buyer Tab By "[bd] paygate".
Lưu ý: Xin vui lòng chỉnh sửa phần này:
Và thêm vào điều kiện những gì bạn thích cho các tab tùy chỉnh các biểu tượng của bạn.
Chúc các bạn thành công.
Trong diễn đàn của tôi, đôi khi người dùng (chủ yếu là người dùng mới) không thể tìm thêm thông tin về các nguồn tài nguyên (như các phiên bản, cập nhật, các tab tùy chỉnh và ...).
Và bởi vì chúng tôi sử dụng font awesome cho các tab danh hiệu, vì vậy vấn đề này sẽ xảy ra nhiều hơn.
Bây giờ chúng ta hãy xem làm thế nào chúng ta có thể thêm các tab (sử dụng font awesome + tooltip) ngay bên dưới nút download, do đó tất cả những người tải về tài nguyên chắc chắn sẽ nhìn thấy chúng.
Mã:
<xen:elseif is="!{$resource.is_fileless}" />
<li><label class="downloadButton {xen:if '!{$resource.canDownload}', downloadDisabled}">
<a href="{xen:link resources/download, $resource, 'version={$resource.current_version_id}'}" class="inner">
<xen:if is="{$resource.canDownload}">{xen:phrase download_now}<xen:else />{xen:phrase download_not_available}</xen:if>
<xen:if is="{$resource.download_url}">
<small class="minorText">{xen:phrase via_external_site}</small>
<xen:else />
<small class="minorText">{xen:number $resource.attachment.file_size, 'size'} .{$resource.attachment.extension}</small>
</xen:if>
</a>
</label></li>
</xen:if>
Thay thế bằng đoạn code sau:
Mã:
<xen:elseif is="!{$resource.is_fileless}" />
<li><label class="downloadButton {xen:if '!{$resource.canDownload}', downloadDisabled}">
<a href="{xen:link resources/download, $resource, 'version={$resource.current_version_id}'}" class="inner">
<xen:if is="{$resource.canDownload}">{xen:phrase download_now}<xen:else />{xen:phrase download_not_available}</xen:if>
<xen:if is="{$resource.download_url}">
<small class="minorText">{xen:phrase via_external_site}</small>
<xen:else />
<small class="minorText">{xen:number $resource.attachment.file_size, 'size'} .{$resource.attachment.extension}</small>
</xen:if>
</a>
<!-- tabs next to download button start -->
<div style="margin-top: 5px;">
<a href="{xen:link resources, $resource}"><i class="fa fa-info-circle fa-lg fa-fw Tooltip" title="{xen:phrase overview}"></i></a>
<xen:if is="{$resource.showExtraInfoTab}">
<a href="{xen:link resources/extra, $resource}"><i class="fa fa-lightbulb-o fa-lg fa-fw Tooltip" title="{xen:phrase extra_info}"></i></a>
</xen:if>
<xen:if is="{$resource.customFieldTabs}">
<xen:foreach loop="{$resource.customFieldTabs}" value="$fieldId">
<a href="{xen:link resources/field, $resource, 'field={$fieldId}'}"><i class="<xen:if is="{$resource.customFields.faq}">fa fa-question-circle</xen:if> fa-lg fa-fw Tooltip" title="{xen:helper resourceFieldTitle, $fieldId}"></i></a>
</xen:foreach>
</xen:if>
<xen:if is="{$resource.update_count} or {$resourceUpdateCount}">
<a href="{xen:link resources/updates, $resource}"><i class="fa fa-line-chart fa-lg fa-fw Tooltip" title="{xen:phrase updates} ({xen:number $resourceUpdateCount})"></i></a>
</xen:if>
<xen:if is="{$resource.review_count} or {$resourceReviewCount}">
<a href="{xen:link resources/reviews, $resource}"><i class="fa fa-star fa-lg fa-fw Tooltip" title="{xen:phrase reviews} ({$resourceReviewCount})"></i></a>
</xen:if>
<xen:if is="!{$resource.isFilelessNoExternal}">
<a href="{xen:link resources/history, $resource}"><i class="fa fa-list-ol fa-lg fa-fw Tooltip" title="{xen:phrase version_history}"></i></a>
</xen:if>
<xen:if is="{$thread}">
<a href="{xen:link threads, $thread}"><i class="fa fa-comments fa-lg fa-fw Tooltip" title="{xen:phrase discussion}"></i></a>
</xen:if>
<xen:if is="!{$resource.is_fileless} AND {$resource.cost} AND {$resource.user_id} == {$visitor.user_id}">
<a href="{xen:link resources/buyers, $resource}">{xen:phrase bdpaygate_buyers}</a>
</xen:if>
</div>
<!-- tabs next to download button end -->
</label></li>
</xen:if>
Điều này cũng sẽ hỗ trợ Commercial Resource's Buyer Tab By "[bd] paygate".
Lưu ý: Xin vui lòng chỉnh sửa phần này:
Mã:
<xen:if is="{$resource.customFieldTabs}">
<xen:foreach loop="{$resource.customFieldTabs}" value="$fieldId">
<a href="{xen:link resources/field, $resource, 'field={$fieldId}'}"><i class="<xen:if is="{$resource.customFields.faq}">fa fa-question-circle</xen:if> fa-lg fa-fw Tooltip" title="{xen:helper resourceFieldTitle, $fieldId}"></i></a>
</xen:foreach>
</xen:if>
Và thêm vào điều kiện những gì bạn thích cho các tab tùy chỉnh các biểu tượng của bạn.
Chúc các bạn thành công.
Nguồn: xenforo.com
Bài viết liên quan
Được quan tâm