THEME_NEWS_IMAGE - custom news thumbnail

Images
Images
Images
Images

Way how override core news shortcodes

custom THEME_NEWS_IMAGE

At first, I used directly core news image shortcode, but then...  legacy shortcodes file was created, but the template still uses them. What is correct? News_image or newsimage?

So I create custom theme shortcode and used it in news templates...

 /* {THEME_NEWS_IMAGE} */
function sc_theme_news_image( $parm = array() ) // add override of news_image shortcode
{
$sc = e107::getScBatch('news'); 
$data = $sc->getScVar('news_item');
$news_images = explode(',', $data['news_thumbnail']);

$thumbnail = $news_images[0]; 
$thumbnail_src = e107::getParser()->replaceConstants($thumbnail , 'abs');
$class = 'theme-news-image';
$news_category = '<div class="hs-text"><div class="label"><span>'.$data['category_name'].'</span></div></div>';
if($parm['class']) {$class = $parm['class']; } 
$text = '<div class="'.$class.' set-bg" data-setbg="'.$thumbnail_src.'">'.$news_category.'</div>';

return $text;
}

 Used in:

Metis (news image)
Appstrap (news date) 

Chatbox

You must be logged in to post comments on this site - please either log in from the Login box or from here.


Jimako
Jimako 3 months ago

Thanks for testing. And next funny thing - I forgot to uninstall APOS plugin, so it still created welcome post for you in forum, but forum is not installed... Just a reminder to look at it.

Tgtje
Tgtje 3 months ago

@Jimako just info : 1st activ. mail not received (2 day wait), resend ok (20 seconds) wink .

Jimako
Jimako 4 months ago

test first message biglaugh confused

Jimako
Jimako 6 months ago

@Alex try this one: https://cookie-script.com/

Jimako
Jimako 1 year ago

In fact, I have never notice this because with WP plugin it is free. I will see what it does after free trial.

Alex
Alex 1 year ago

Well it's nice but 10 dollar a month for a business use pro domain... that costs more than the hosting frown

Jimako
Jimako 1 year ago

And yes, it works very nicely... I use it long time. Just first or second time used on e107 site.

Jimako
Jimako 1 year ago

@Alex I have that free version. It is enough for me, I was just curious what cookies are used with e107. You can add new one manually too. There is similar WP plugin, I had almost e107 version too. But I needed that scan and WP version is very limited agains online solution.

Alex
Alex 1 year ago

Hmmmm.... https://www.cookieyes.com/pricing/ ?

Alex
Alex 1 year ago

Wow nice cookies.... these work as it's supposed to.... how?


Latest Comments

news LGSL plugin released 4 months ago

Updated path where download this older version.

Posted by Jimako

10 Years

GLORIOUS YEARS

100%

SATISFACTION RATE

20+

e107 THEMES

10+

e107 PLUGINS

Images