b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Developer Reference
  3. Website Skins/Themes
  4. Skin Tags / API
  5. Category Tags
  6. Template Tag: Category Image

Template Tag: Category Image

Displays the image associated with the current Category.

Examples

Quick Template

[Cat:image|before=|after=|size=crop-48x48|link_to=#category_url|class=category_img|placeholder=No image]

PHP Template

$Chapter->get_image_tag( array(
    'before'      => '',
    'after'       => '',
    'size'        => 'crop-48x48',
    'link_to      => '#category_url',
    'class'       => 'category_class',
    'placeholder' => 'No image',
) );

Parameters

Param

Default

Usage

before

''

Displayed before the image.

before_classes

''

Allow injecting additional classes into ‘before’.

before_legend

''

Displayed before image legend (info under image tag image desc is not empty).

after_legend

''

Displayed after the image legend.

after

''

Displayed after the image.

size

crop-48x48 for PHP templates
crop-256x256 for quick templates

Image thumbnail size

sizes

NULL

simplified sizes= attribute for browser to select correct size from srcset=. Sample value: (max-width: 430px) 400px, (max-width: 670px) 640px, (max-width: 991px) 720px, (max-width: 1199px) 698px, 848px

link_to

'' for PHP templates
#category_url for quick templates

URL for a link; #category_url for category URL; original for full image file url; Empty for no link.

link_title

$this->get( 'description' )

Title of the link, can be text or #title# or #desc#

link_rel

''

Value for attribute "rel", usefull for jQuery libraries selecting on rel=’…’, e-g: ‘lightbox[cat’.$this->ID.’]’.

class

''

CSS class applied to image.

align

''

Image align

alt

$this->get( 'name' )

Image alt

desc

#

Image description, used in legend under the image tag, # - use current description of the file.

size_x

1

Use 2 to build 2x sized thumbnail that can be used for Retina display.

tag_size

NULL

Override "width" & "height" attributes on img tag. Allows to increase pixel density for retina/HDPI screens.
Example:

  • 160 => width="160" height="160"
  • 160x320 => width="160" height="320"
  • NULL - use size defined by the thumbnail
  • none - don’t use attributes "width" & "height"

placeholder

'' for PHP templates
#folder_icon for quick templates

HTML to be displayed if no image; possible codes: #folder_icon

Return value

This tag displays content only, it does not have a return value.

Created by winskie • Last edit by fplanque on 2020-08-07 22:15 • •

No feedback yet

On this page

  • Examples
  • Quick Template
  • PHP Template
  • Parameters
  • Return value

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
    • Website Skins/Themes
      • Skin Development Primer
      • Loading additional resources into a skin
      • Where are the skin files?
      • CSS Guidelines
      • Targeted CSS Selectors
      • Introducing evoSkins
      • Modifying evoSkins
      • Creating evoSkins
      • Skin Tags / API
        • Template functions
        • Template Tags
        • Tag Plugins Call By Code
        • Tag User Subs Link
        • Tag User Register Link
        • Tag User Profile Link
        • Tag User Logout Link
        • Tag User Login Link
        • Tag Skin Get URL
        • Tag Skin Get Path
        • Tag Skin Container
        • Tag Powered By
        • Tag Is Logged In
        • Include Disp
        • Tag Display If Empty
        • Tag Comment Allowed Tags
        • Tag Blog Tagline
        • Tag Blog Name
        • Tag Blog Longdesc
        • Tag Blog Home Link
        • Tag Blog Footer
        • Tag Blog Contact Link
        • app_version();
        • Tag Request Title
        • Include Item Content
        • User::get_identity_link()
        • Item Tags
        • Category Tags
          • Template Tag: Category Background Image CSS
          • Template Tag: Category Description
          • Template Tag: Category Image
          • Template Tag: Category Image URL
          • Template Tag: Category Name
          • Template Tag: Category Permalink
        • User Tags
        • Other Tags
      • Styling widgets
      • Skin Quality Control
      • Using HTML 5 tags
      • Using Custom Item Templates
      • Using bootstrap classes in footers
      • Using Grunt
      • Dev Menu
      • How to add a Google Font (WebFont) ?
      • Custom Fields in a Template
      • Site Skins
    • Email Skins/Themes
    • b2evolution Files
    • Website Integration
    • Plugins
    • Debugging
    • Technical Reference
    • Hacks
    • Credits
    • Development
    • How to... (Customize)
    • Scheduled Tasks Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
Multiple blogs solution

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque