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

Recent

Welcome to TinyPortal. Please login or sign up.

April 16, 2024, 06:41:20 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,161
  • Total Topics: 21,219
  • Online today: 106
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 72
  • Total: 73
  • @rjen

Force this heigth on each block

Started by allvip, April 07, 2016, 05:55:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

allvip

I'm trying to use Force this heigth on each block 150 for Top Panel on the original TP in the Panel Settings but I don't see the changes.

How this setting should be used?

lurkalot

Quote from: allvip on April 07, 2016, 05:55:38 PM
I'm trying to use Force this heigth on each block 150 for Top Panel on the original TP in the Panel Settings but I don't see the changes.

How this setting should be used?

Good question, and one I don't have to answer for unfortunately.  Pretty sure this has been brought up before in the past, I'll have to back track and see if I can find any info.

illori

in TPortalAdmin.template.php we have

<input name="tp_blockwidth_'.$panl.'" size="5" maxsize="5" type="text" value="' ,$context['TPortal']['blockwidth_'.$panl], '"><br />
<span class="middletext">'.$txt['tp-blockheight'].':</span>
<input name="tp_blockheight_'.$panl.'" size="5" maxsize="5" type="text" value="' ,$context['TPortal']['blockheight_'.$panl], '">


in TPsubs.template.php we have

if($double)
{
// figure out the height
$h = $context['TPortal']['blockheight_'.$side];
if(substr($context['TPortal']['blockheight_'.$side],strlen($context['TPortal']['blockheight_'.$side])-2,2) == 'px')
$nh = ((substr($context['TPortal']['blockheight_'.$side],0,strlen($context['TPortal']['blockheight_'.$side])-2)*2) + 43).'px';
elseif(substr($context['TPortal']['blockheight_'.$side],strlen($context['TPortal']['blockheight_'.$side])-1,1) == '%')
$nh = (substr($context['TPortal']['blockheight_'.$side],0,strlen($context['TPortal']['blockheight_'.$side])-1)*2).'%';
}
echo '<div class="blockbody" style="overflow: auto;' , !empty($context['TPortal']['blockheight_'.$side]) ? 'height: '. ($double ? $nh : $context['TPortal']['blockheight_'.$side]) .';' : '' , '">';
$func($block['id']);
echo '</div>';
}
else
echo '<div class="blockbody" style="overflow: auto;' , !empty($context['TPortal']['blockheight_'.$side]) ? 'height: '.$context['TPortal']['blockheight_'.$side].';' : '' , '">' , parse_bbc($block['body']) , '</div>';


last i checked $panl != $side so this function does not really function.

lurkalot

#3
Illori, is this something which can be easily fixed? I'm pretty sure I mentioned the this function didn't seem to work when we built the front page.  Can't see when it got broken though.

Edit: And does the same apply for the force width? Not sure if this works either tbh.

illori

i could look into it, but i think better would be to remove it. given that i dont think many have reported this issue i dont think they actually use it. you can set an overall width of the panels already in the admin panel, why do you need to set each panel to a width additional? why would one panel have blocks of different width or height?

looking at the code quickly it looks like the block width may not work as well... if we are going to head toward responsive that should define the width of the blocks rather then a set width elsewhere IMO.

allvip

#5
Quote from: illori on April 08, 2016, 10:20:38 AM
i could look into it, but i think better would be to remove it. given that i dont think many have reported this issue i dont think they actually use it.

It works when Display the blocks horizontally is ON.
Adds the height on the block body not on the column like the width.
I just forgot to add px or %. I typed only 150 and of course it did not worked.
Oops!

I like this future because allows each block to have the same height and it has overflow auto to scroll if the block has more content then the given height.

Why remove an extra future? Some users may like it.
Usefull for a table like look.


Quote from: illori on April 08, 2016, 10:20:38 AM
why would one panel have blocks of different width or height?

Every block column (not just one) gets the same px or % width and/or height.

Quote from: illori on April 08, 2016, 10:20:38 AM
looking at the code quickly it looks like the block width may not work as well...

It works when Display the blocks horizontally is ON.

Quote from: illori on April 08, 2016, 10:20:38 AM
if we are going to head toward responsive that should define the width of the blocks rather then a set width elsewhere IMO.

Quote from: illori on April 08, 2016, 10:20:38 AM
you can set an overall width of the panels already in the admin panel, why do you need to set each panel to a width additional?

They get 100% width on smaller screens.

Is a very usefull future.
If I have 10 block in the front panel and I give them 20% width, it will display 2 rows with 5 columns.
With 33% I get 3 blocks per row if I have 6 blocks and 6 block per row with 16.6%.

Actually is not even working without any width set.
The code is written without width for Display the blocks horizontally so users can set it according to how many blocks they have or how many blocks per row they want.

It's a cool future.

If they use px and not % is because they like fixed widths.
Anyway on smaller screens they get 100% width no matter what they used (px or % for the width).
The blocks need 100% because there is no place to display more then 1 block.

I think I will set 33% (3 blocks per row) under 600px and 50% (2 blocks per row) under 400px and 100% (1 block per row) for screens smaller then 300px.

allvip

Display the blocks horizontally ON.
Width 33% and height 150px or width 16.6% and height 150px.
This way I can set how many I want per row and a fixed height so they won't take to much height from the layout.

Also gives the blocks a table look unlike the ones with no height that gives the blocks a masonry look.

Depends what users like.
I love the scripts with lots of options.
Great script bloc  O0

See attachments.

lurkalot

Quote from: allvip on April 08, 2016, 01:24:19 PM
Display the blocks horizontally ON.


Just tested this and it works with "Display the blocks in 4 columns" as well.  Strange because I'm sure I tried this when I was putting the front page together here, and then I couldn't get it to work.  Perhaps it was because I also missed putting the px in.

Here it is with four columns http://cctestsite.info/testsite2/index.php

allvip

Quote from: lurkalot on April 08, 2016, 05:30:24 PM
Quote from: allvip on April 08, 2016, 01:24:19 PM
Display the blocks horizontally ON.


Just tested this and it works with "Display the blocks in 4 columns" as well.  Strange because I'm sure I tried this when I was putting the front page together here, and then I couldn't get it to work.  Perhaps it was because I also missed putting the px in.

Here it is with four columns http://cctestsite.info/testsite2/index.php

Thanks.

lurkalot

Don't thank me. Thank you for making me try it again, lol..  8)

Quote from: allvip on April 08, 2016, 12:31:15 PM

Why remove an extra future? Some users may like it.
Usefull for a table like look.


I would like this feature to stay if possible, it will be handy, which is why I guess bloc added it in the first place.  Especially handy now I know it works.

I'd rather maintain or increase the amount of features instead of stripping them out. Where possible of course.