TinyPortal

Development => Support => Topic started by: ApplianceJunk on March 02, 2008, 12:33:35 PM

Title: How can I center my block titles?
Post by: ApplianceJunk on March 02, 2008, 12:33:35 PM
The block titles are to the left. I would like to center them like in this forum.
http://www.rebelrosenetworks.com/forum/index.php (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.  ;)
Title: Re: How can I center my block titles?
Post by: IchBin on March 02, 2008, 01:54:42 PM
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>',
Title: Re: How can I center my block titles?
Post by: Nokonium on March 02, 2008, 02:09:43 PM
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.

Title: Re: How can I center my block titles?
Post by: ApplianceJunk on March 02, 2008, 02:16:58 PM
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
Title: Re: How can I center my block titles?
Post by: IchBin on March 02, 2008, 02:18:30 PM
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>
Title: Re: How can I center my block titles?
Post by: ApplianceJunk on March 02, 2008, 02:31:47 PM
echo '<center>',$block['title'],'</center>

That did the trick, thanks!
Title: Re: How can I center my block titles?
Post by: FERNSIDEâ„¢ on March 03, 2008, 09:16:51 AM
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 ;)
Title: Re: How can I center my block titles?
Post by: IchBin on March 03, 2008, 06:12:53 PM
Haha. Never occurred to me to even try that... :up: