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,004
  • Total Topics: 21,330
  • Online today: 219
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 146
  • Total: 146

How can I center my block titles?

Started by ApplianceJunk, March 02, 2008, 12:33:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ApplianceJunk

The block titles are to the left. I would like to center them like in this forum.
http://www.rebelrosenetworks.com/forum/index.php

I have search for the answer and found nothing, but then we all know how my searching skills are.  ;)

IchBin

#1
Apparently you're posting skills are just as bad. You posted this in Chit Chat? lol

I'm not sure which would be the best way. You could I guess go in to the TPortal.php file and find each instance of the $context['TPortal']['leftblock']['blocks'] code for each left/right/center block and add the center tag to the title.
'title' => '<center>',$row['title'],'</center>',

Nokonium

How adventurous are you?

Without knowing which TP version or theme you want to modify I can only give you basic info.

Unless I'm out of my tree this is where the block title style is set for TP 0.983

TPortalBlocks.template circa line 305

<div class="titlebg" style="padding: 4px; font-weight: bold;">';

If you want a quick fix and are not bothered about verification

<div class="titlebg" style="padding: 4px; font-weight: bold; text-align: center;">';

If you want to do it correctly you will need to change the class from titlebg to something else, say blocktitlebg, and create a blocktitlebg class or classes in the theme stylesheet that is a copy of all the styles for titlebg but with text-align: center;

If you change the current titlebg class alignment a lot more than just the block titles will re-align.


ApplianceJunk

QuoteApparently you're posting skills are just as bad. You posted this in Chit Chat? lol

On top of everything else I can't read very good either, lol..


QuoteHow adventurous are you?

Without knowing which TP version or theme you want to modify I can only give you basic info.

Sometimes I get to adventurous and get myself into trouble. :)

Using TinyPortal v0.9.8 SMF 1.1.4 and the Dilber MC theme.

Thanks for the replies

IchBin

Ah, forgot to check the sidebar function. :) You should be able to add to this line in the Tportalblocks.template.php file.
echo $block['title'],'

echo '<center>',$block['title'],'</center>

ApplianceJunk

echo '<center>',$block['title'],'</center>

That did the trick, thanks!

FERNSIDEâ„¢

LOL
All I've been doing is

<center>Your Title Here</center>

Works fine for me, and just in case I dont need it to be centered, it doesnt require any change to a template ;)

IchBin

Haha. Never occurred to me to even try that... :up:

This website is proudly hosted on Crocweb Cloud Website Hosting.