Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: landyvlad on November 14, 2021, 10:29:18 PM

Title: News feature
Post by: landyvlad on November 14, 2021, 10:29:18 PM
In SMF 2.1

Can the news feature be used to display images rather than text? If so what image size should be used.
Can the news text be bbc or html formatted, or can it only be plain text?
Can the word "News" be removed so it actually only shows the content of the field

What I'd like to do is replace 'News' with an inspirational quote sort of thing.
Title: Re: News feature
Post by: Sir Osis of Liver on November 14, 2021, 10:49:36 PM
Image can be displayed in img tags, you'd have to experiment with image size.  BBC formatting tags also work.  The 'News:' label is in index.template.php -


    <div class="news">
        <h2>', $txt['news'], ': </h2>
        <p>', $context['random_news_line'], '</p>
    </div>';

Title: Re: News feature
Post by: shadav on November 14, 2021, 10:53:12 PM
bbc works, it seems html doesn't work

in index.template.php
find and remove
<h2>', $txt['news'], ': </h2>
[edit] lol sir osis posted while i was testing
Title: Re: News feature
Post by: Shades. on November 15, 2021, 06:03:55 AM
Quote from: landyvlad on November 14, 2021, 10:29:18 PMIn SMF 2.1

Can the word "News" be removed so it actually only shows the content of the field

Not sure about the rest but here is how to remove "News:"...

In Themes>default>index.template.php

Find:
                        <h2>', $txt['news'], ': </h2>
Replace with:
                        <h2>', $txt['news'], '</h2>
In Themes>default>languages>index.english.php

Find:
$txt['news'] = 'News';
Replace with:
$txt['news'] = '';
Title: Re: News feature
Post by: landyvlad on November 26, 2021, 07:06:27 AM
Hmm just noticed it says Updates not News.

I wonder if perhaps that's the feather theme...
Title: Re: News feature
Post by: Shades. on November 26, 2021, 10:16:47 AM
Must be because default is "News". ;)
Title: Re: News feature
Post by: Mick. on November 27, 2021, 08:49:02 PM
Quote from: landyvlad on November 26, 2021, 07:06:27 AMHmm just noticed it says Updates not News.

I wonder if perhaps that's the feather theme...
It is. It's in the language file in feather.
Title: Re: News feature
Post by: shawnb61 on November 27, 2021, 08:56:40 PM
I you have a youtube bbc going, it can even show video.

There are a couple settings that govern placement.  One makes it look like its own category, & centers it.