TinyPortal

Development => Support => Topic started by: davo88 on February 04, 2024, 08:01:41 PM

Title: How to get matching title styles on Front Page articles
Post by: davo88 on February 04, 2024, 08:01:41 PM
Link to my forum: Test forum only
SMF version: SMF ver 2.1.4
TP version: TP ver 3.0.0
Default Forum Language: English
Theme name and version: Default SMF Curve2
Browser Name and Version: Brave 1.62.156
Mods installed: None. All screens are fresh installs with no settings changed other than described below.
Related Error messages: None.

After a fresh install of TP with no settings changed, the front page looks like this.
2024-02-05_05-01-56.png
All Panel styles are set to this default setting
2024-02-05_05-06-14.png
Then I change all Panel styles to this setting with no other changes.
2024-02-05_05-02-48.png
Now the Front Page looks like this with a continuous blue background in the top row of title bars across the full width of the page.
2024-02-05_05-19-15.png
When in the forum, we see the same continuous blue in the top bar across the page.
2024-02-05_06-36-56.png
Next I want to remove the Center panel and mix in articles with forum topics on the Front Page. So I add an article and set it to display on Front Page. Now we have a different style of title bar displayed for the article.
2024-02-05_06-39-44.png
The article has been left at its default setting of "Use frame and title style from theme". All the category settings are at their defaults.
2024-02-05_06-42-29.png

I can't figure out how to get articles to display on the Front Page using the same "catbg+windowbg" style as all the blocks and in the forum. The goal is to have a uniform look and continuous blue title bars in the top row across the full width of the page. Anyone know how to do this?
Title: Re: How to get matching title styles on Front Page articles
Post by: @rjen on February 04, 2024, 08:26:00 PM
Check the settings under Settings & Frontpage > Frontpage

2024-02-04_212347.jpg
Title: Re: How to get matching title styles on Front Page articles
Post by: davo88 on February 04, 2024, 08:53:56 PM
Tried the settings as shown in your snip but it remains the same - the article has a different style bar. Tried changing to a few other settings in the drop downs but couldn't find a combination that changes the article title bar. The changes do affect the forum title bar displayed on the front page, but not the article title bar.
Title: Re: How to get matching title styles on Front Page articles
Post by: @rjen on February 04, 2024, 09:43:57 PM
Sorry, thought you were looking for the forum topics setting.
Title: Re: How to get matching title styles on Front Page articles
Post by: @rjen on February 04, 2024, 09:52:22 PM
I don't think there is a setting that allows you to change it. It will require a code edit...
Title: Re: How to get matching title styles on Front Page articles
Post by: @rjen on February 04, 2024, 10:00:49 PM
Yep, may be a nice feature for a new version. I will put it on the backlog...

For now, if you reaaly need it, you can change this part in TPsubs.template.php

Find
// decide the header style, different for forumposts
    $usetitlestyle = in_array($context['TPortal']['article']['frame'], array('theme', 'title'));
    $useframestyle = in_array($context['TPortal']['article']['frame'], array('theme', 'frame'));
$divheader = isset($context['TPortal']['article']['boardnews']) ? $context['TPortal']['boardnews_divheader'] : 'title_bar';
$headerstyle = isset($context['TPortal']['article']['boardnews']) ? $context['TPortal']['boardnews_headerstyle'] : 'titlebg';
$divbody = isset($context['TPortal']['article']['boardnews']) ? $context['TPortal']['boardnews_divbody'] : ($usetitlestyle ? 'windowbg noup' : 'windowbg');
$showtitle = in_array('title', $context['TPortal']['article']['visual_options']);


And change to
// decide the header style, different for forumposts
    $usetitlestyle = in_array($context['TPortal']['article']['frame'], array('theme', 'title'));
    $useframestyle = in_array($context['TPortal']['article']['frame'], array('theme', 'frame'));
$divheader = isset($context['TPortal']['article']['boardnews']) ? $context['TPortal']['boardnews_divheader'] : 'cat_bar';
$headerstyle = isset($context['TPortal']['article']['boardnews']) ? $context['TPortal']['boardnews_headerstyle'] : 'catbg';
$divbody = isset($context['TPortal']['article']['boardnews']) ? $context['TPortal']['boardnews_divbody'] : ($usetitlestyle ? 'windowbg tp_block21' : 'windowbg');
$showtitle = in_array('title', $context['TPortal']['article']['visual_options']);
Title: Re: How to get matching title styles on Front Page articles
Post by: davo88 on February 04, 2024, 11:58:47 PM
Beautiful. Now the articles and forum topics on the front page have similar styling. Makes a big difference. Thank you @rjen.
Before code edit
2024.02.05-10.53 - Screenshot.png
After code edit
2024.02.05-10.52 - Screenshot.png