This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

How to add icon image?


avatar
error 232
From: -
How to add icon image?

How to add different icon images next to block titles?

Thanks

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: How to add icon image?
avatar
Editor
0
From: -
You can do this with the site_block template.

Here an example:

Replace in the HTML part:
 <h1>{$insert['block_name']}</h1>


with:
 <h1><img src="https://www.contentteller.com/images/{$block_image}" alt="" /> {$insert['block_name']}</h1>


and add the following PHP part:
$block_image = "default.gif";


if ( $insert['block_name'] == "News" )
{
$block_image = "news.gif";
}
elseif ( $insert['block_name'] == "Content" )
{
$block_image = "content.gif";
}
elseif ( $insert['block_name'] == "Knowledgebase" )
{
$block_image = "knowledgebase.gif";
}


This small script change the block icon image based on the block title. For example, the news block will use images/news.gif as block icon etc.

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.