TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,021
  • Total Topics: 21,332
  • Online today: 582
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 475
  • Total: 475

Resize text for article category blocks

Started by Skhilled, August 21, 2011, 09:17:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Skhilled

The frontpage blocks on my site have only categories listing articles within them. The article titles that are listed in each block all seem to be in bold. How can I make them "unbold" or even add other text decorations without creating a custom block and a custom php/html block and doing it the old fashioned way?

I searched but could only find this which didn't seem to help:

http://www.tinyportal.net/index.php?topic=11644.0

This shows the same way using Curves or a custom theme.

IchBin

I think that the function TPortal_categorybox() in TPsubs.template.php is the one that holds the HTML that you need to edit for this. It may have some bold tags in it. Let me know if that's not it.

Skhilled

That was it. This is the function:

// category listing blocktype
function TPortal_categorybox()
{
    global $context, $settings, $options, $txt, $scripturl;

   if(isset($context['TPortal']['blockarticle_titles'][$context['TPortal']['blocklisting']])){
      echo '<div class="middletext" ', (sizeof($context['TPortal']['blockarticle_titles'][$context['TPortal']['blocklisting']])>$context['TPortal']['blocklisting_height'] && $context['TPortal']['blocklisting_height']!='0') ? ' style="overflow: auto; width: 100%; height: '.$context['TPortal']['blocklisting_height'].'em;"' : '' ,'>';
      foreach($context['TPortal']['blockarticle_titles'][$context['TPortal']['blocklisting']] as $listing){
         if($listing['category']==$context['TPortal']['blocklisting'])
            echo '<a href="'.$scripturl.'?page='.$listing['shortname'].'">'.$listing['subject'].'[/url] ' , $context['TPortal']['blocklisting_author']=='1' ? $txt['by'].' '.$listing['poster'] : '' , '[br /]';
      }
      echo '</div>';
   }
}


This is the line you wish to edit to remove the bold tags:
echo '<a href="'.$scripturl.'?page='.$listing['shortname'].'">'.$listing['subject'].'[/url]

Hmmm, something is either wrong with this code or SMF. I code in the first one is exactly the same as the 2nd but if you use code tags try to preview it the bold tags disappear!!! There must be difference between the function code and just using the line of code...

Quote// category listing blocktype
function TPortal_categorybox()
{
    global $context, $settings, $options, $txt, $scripturl;

    if(isset($context['TPortal']['blockarticle_titles'][$context['TPortal']['blocklisting']])){
        echo '<div class="middletext" ', (sizeof($context['TPortal']['blockarticle_titles'][$context['TPortal']['blocklisting']])>$context['TPortal']['blocklisting_height'] && $context['TPortal']['blocklisting_height']!='0') ? ' style="overflow: auto; width: 100%; height: '.$context['TPortal']['blocklisting_height'].'em;"' : '' ,'>';
        foreach($context['TPortal']['blockarticle_titles'][$context['TPortal']['blocklisting']] as $listing){
            if($listing['category']==$context['TPortal']['blocklisting'])
                echo '<a href="'.$scripturl.'?page='.$listing['shortname'].'">'.$listing['subject'].' ' , $context['TPortal']['blocklisting_author']=='1' ? $txt['by'].' '.$listing['poster'] : '' , '
';
        }
        echo '</div>';
    }
}

Even in the quote it shows that line in bold but not the tags...

EDIT: Got to be something with the preview! The single line of code worked and showed the bold tags until I edited it using preview. Think I found another smf bug. :P

Skhilled

echo '<b><a href="'.$scripturl.'?page='.$listing['shortname'].'">'.$listing['subject'].'</a></b>

Skhilled

You can see it works in the above post and is because I did not use preview before posting it. If I try to modify it, it will screw up again. :P

IchBin


Skhilled

Along with the rest I've reported. LOL

There is another one I keep forgetting to report as well...

This website is proudly hosted on Crocweb Cloud Website Hosting.