Welcome to Geeklog Saturday, August 24 2019 @ 08:17 am EDT

Geeklog Forums

Story title color by topic


Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
Hi,

I wonder if some one get a way to allow story theming by topic?

What I want to do is to display story title from topic 1 in red, and story title from topic 2 in blue.

Thanks,

Ben
I'm available to customise your themes or plugins for your Geeklog CMS

Status: offline

suprsidr

Forum User
Full Member
Registered: 29/12/04
Posts: 555
Location:Champaign, Illinois
Since the topic is not present in the url request variables, you could query the story's content for the topic icon and base the title color based on which icon is present.
jQuery comes to mind.

-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/05
Posts: 1369
I hope to allow admins to specify a theme for each topic in Geeklog 1.8.1
One of the Geeklog Core Developers.

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
After reading some posts I maked a simple hack Frown in the lib-story.php file (STORY_renderArticle function) and add my new
storytext.thtml, storybodytext.thtml, featuredstorytext.thtml, featuredstorybodytext.thtml, archivestorytext.thtml, archivestorybodytext.thtml files
to my layout/professional/topics/General folder

PHP Formatted Code

Near line 92

        if ( is_dir($_CONF['path_layout'] . '/topics/' . $story->DisplayElements('tid')) ) {
                $article = new Template( $_CONF['path_layout'] . '/topics/' . $story->DisplayElements('tid') );
        } else {
                $article = new Template( $_CONF['path_layout'] );
        }
 


Thanks,

Ben
I'm available to customise your themes or plugins for your Geeklog CMS

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
With geeklog 1.8.0 replace line 98 in lib-story.php file (STORY_renderArticle function)

PHP Formatted Code
$article = COM_newTemplate($_CONF['path_layout']);

by

PHP Formatted Code

        if ( is_dir($_CONF['path_layout'] . '/topics/' . $story->DisplayElements('tid')) ) {
                        $article = COM_newTemplate( $_CONF['path_layout'] . '/topics/' . $story->DisplayElements('tid') );
        } else {
                        $article = COM_newTemplate( $_CONF['path_layout'] );
        }


Ben
I'm available to customise your themes or plugins for your Geeklog CMS

All times are EDT. The time is now 08:17 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content