Skip to main content
[ADDON] SimplePortal Started by Spuds · · Read 348373 times 0 Members and 4 Guests are viewing this topic. previous topic - next topic

Re: [ADDON] SimplePortal

Reply #300

I'm pretty sure B1 was still using a table layout with some CSS hacks to make it kind of responsive.  

B2 I converted everything over to a div layout so it would be easier to use CSS media querys. 

I'm Not sure on what order I set it up as, or if there is a correct one to start with when they get "stacked".  I guess it would be header->left->top->bottom->right->footer ????
Last Edit: April 04, 2017, 09:59:49 pm by Spuds

Re: [ADDON] SimplePortal

Reply #301

Depends what result you want. IIRC (not having used SP live myself) your header and footer blocks are full width, with top and bottom blocks being sandwiched between the right and left blocks.

If that is the case, I'd be inclined to mark them up as header->left->top->right->bottom->footer. Alternatively, header->top->left->right->bottom->footer might work, but I have a feeling it'd be harder to arrange the presentation (haven't thought it through much yet).

Although you could argue for other arrangements. It shouldn't matter that much if you are disabling the blocks on mobile, or simply stacking them vertically on mobile. I'd just go with whatever gives the simplest and most flexible CSS for the full desktop version, and let them stack however they like on small screens. They'll all be the same width then anyway.
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: [ADDON] SimplePortal

Reply #302

Quote from: Spuds –  I guess it would be header->left->top->bottom->right->footer ????
Yes, that's the order set in SPortal beta 2.

I don't know which could be the ideal order or if is there any that may feet most forums, but in the last years using Joomla and several templates I noticed that usually they are all set in this order: header > top > bottom > left > right >footer
Here just a quick example found using Google images:
desktop:  and mobile 
sorry for my bad english

Re: [ADDON] SimplePortal

Reply #303

Sorry if I insist on this, but is there any chance that Sportal will be modified to show on mobile this order of blocks?
Header > Top > Left > Right > Bottom > Footer?
IMO this is more flexibile, and if someone wants to show first the left and right blocks it's just enough to use the bottom block instead of top block for Board news. As it is set now, Top and Bottom blocks are not having much sense to exist, they are identical.
Usually the left and right blocks are "static" blocks" and is better to show first the latest news rather than the classic blocks we set on left/right (statistics, staff block, social pages, who's online, etc...)


Another think I found is that using article bbc the tables are not rendered correctly (see attached)
table-1.png   table-2.png

EDIT
After saving the article bbc table code is changed from: 
Code: [Select]
[table][tr][td][b]Dimensioni esterne[/b][/td]
[td]
[/td]
[/tr]
[tr][td]Lunghezza [mm][/td]
[td]4697[/td]
[/tr]
[tr][td]Larghezza [mm][/td]
[td]1882[/td]
[/tr]
[tr][td]Altezza [mm][/td]
[td]1655[/td]
[/tr]
[tr][td]Passo [mm][/td]
[td]2791[/td]
[/tr]
[tr][td]Altezza libera da terra [mm][/td]
[td]187 {188}[/td]
[/tr]
[tr][td]Carreggiata anteriore [mm][/td]
[td]1586[/td]
[/tr]
[tr][td]Carreggiata posteriore [mm][/td]
[td]1576[/td]
[/tr]
[/table]

to:

Code: [Select]
[table][tr][td][b]Dimensioni esterne[/b][/td]
[/tr]
[/table]
[table][tr][td]
[/td]
[/tr]
[/table]

[table][tr][td]Lunghezza [mm][/td]
[/tr]
[/table]
[table][tr][td]4697[/td]
[/tr]
[/table]

[table][tr][td]Larghezza [mm][/td]
[/tr]
[/table]
[table][tr][td]1882[/td]
[/tr]
[/table]

[table][tr][td]Altezza [mm][/td]
[/tr]
[/table]
[table][tr][td]1655[/td]
[/tr]
[/table]

[table][tr][td]Passo [mm][/td]
[/tr]
[/table]
[table][tr][td]2791[/td]
[/tr]
[/table]

[table][tr][td]Altezza libera da terra [mm][/td]
[/tr]
[/table]
[table][tr][td]187 {188}[/td]
[/tr]
[/table]

[table][tr][td]Carreggiata anteriore [mm][/td]
[/tr]
[/table]
[table][tr][td]1586[/td]
[/tr]
[/table]

[table][tr][td]Carreggiata posteriore [mm][/td]
[/tr]
[/table]
[table][tr][td]1576[/td]
[/tr]
[/table]
Last Edit: April 07, 2017, 05:17:41 am by radu81
sorry for my bad english

Re: [ADDON] SimplePortal

Reply #304

Just something I noticed while installing B2, I'm not sure if it can be considered a bug or not because I had a very old install. Anyway the column "mobile_view" was not present in the database and the installer choked.
I just added a check for it in:
Code: [Select]
		// Add visibility profile col to sp_blocks
$db_table->db_add_column('{db_prefix}sp_blocks', array('name' => 'visibility', 'type' => 'mediumint', 'size' => 8, 'default' => 0, 'unsigned' => true));

if (isset($block_cols['mobile_view']))
{
// Read in the "old" data
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] SimplePortal

Reply #305

Quote from: radu81 – Sorry if I insist on this, but is there any chance that Sportal will be modified to show on mobile this order of blocks?
Header > Top > Left > Right > Bottom > Footer?
I've tweaked the css and template so this can be achieved, however it will only work on modern browsers, an no I will not do anything for browsers that this does not work with. 

There is also one change on the desktop layout that this causes, the bottom / top blocks are no longer constrained to  be the same width.  This means if the right or left blocks don't stop the bottom blocks from reaching the right or left side, then it will (see pictures)
Quote from: radu81 – IMO this is more flexibile, and if someone wants to show first the left and right blocks it's just enough to use the bottom block instead of top block for Board news.
There is never going to be a right answer here, no matter what, someone will think another way makes more sense. 

Remember that an option for showing things where you want is to use the mobile view.  You can always show a right block on desktop, and then that same block could appear in the bottom section only for mobile.  You just place the same block in two places, one shows on mobile, one does not.

Quote from: radu81 –
Another think I found is that using article bbc the tables are not rendered correctly (see attached)
Have not looked into this yet

Re: [ADDON] SimplePortal

Reply #306

Thanks for your answer Spuds.

QuoteRemember that an option for showing things where you want is to use the mobile view. You can always show a right block on desktop, and then that same block could appear in the bottom section only for mobile.  You just place the same block in two places, one shows on mobile, one does not.
I already thought about a similar trick duplicating blocks and set them to be visible only on mobile, but there is no way (or at least I did not found it) ... If a block is set to be visible on mobile automaticaly will be displayed in desktop version too. What is missing is a "hide on desktop option" am I right?

QuoteThere is never going to be a right answer here, no matter what, someone will think another way makes more sense. 
I agree on this, it's more like a personal taste...  Probably the order I prefer is just because using other CMS I get used to this order of blocks

regarding the tables into bbcode articles I just found this: I created the article using a normal post, then  copied the bbcode and pasted into bbc article. Once saved the article the bbcode is not modified. The table bbcode get changed in article edit if I use the preview option.
Last Edit: April 07, 2017, 07:05:01 pm by radu81
sorry for my bad english

Re: [ADDON] SimplePortal

Reply #307

Quote from: radu81 – regarding the tables into bbcode articles I just found this: I created the article using a normal post, then  copied the bbcode and pasted into bbc article. Once saved the article the bbcode is not modified. The table bbcode get changed in article edit if I use the preview option.
Thanks for the details, I was about to say I can't make it happen :D

Edit PortalAdminArticles.controller.php find and delete the following (starting at line 319) .. the preparsecode is already taken care of at that point, so doing it again is not a good idea.
Code: (delete) [Select]
			// Fix any bbc errors they have created
if ($context['article']['type'] === 'bbc')
{
preparsecode($context['article']['body']);
}

While you are at it ... edit Portal.subs.php around line 575
Code: (find) [Select]
	if (!empty($_GET['article']) && (empty($context['current_action']) || $context['current_action'] === 'portal'))
{
$article_info = sportal_get_articles($_GET['article'], true, true);
}
Code: (replace) [Select]
	if (!empty($_GET['article']) && (empty($context['current_action']) || $context['current_action'] === 'portal'))
{
require_once(SUBSDIR . '/PortalArticle.subs.php');
$article_info = sportal_get_articles($_GET['article'], true, true);
}
So add that require_once or clicking on an article on a portal page will 500 yer server.

Quote from: emanuele – Just something I noticed while installing B2, I'm not sure if it can be considered a bug or not because I had a very old install. Anyway the column "mobile_view" was not present in the database and the installer choked.
That must have been an old install, but then again who knows, trying to update these beta's is one glorious pain in the butt.  I've put a check in place to skip that column if its not found, should work now!



Re: [ADDON] SimplePortal

Reply #308

That solved the problem with tables in article  8)
In topic view tables are displayed with borders, in article view tables are without borders.


Quote from: radu81 – I already thought about a similar trick duplicating blocks and set them to be visible only on mobile, but there is no way (or at least I did not found it) ... If a block is set to be visible on mobile automaticaly will be displayed in desktop version too. What is missing is a "hide on desktop option" am I right?
Please don't forget about this  O:-)
sorry for my bad english

Re: [ADDON] SimplePortal

Reply #309

If you want to test the new mobile layout ..... use the attached css / template


Re: [ADDON] SimplePortal

Reply #310

Works fine for me  ;D thank you!!!
Whan you say it won't work with old browsers, but how old?
sorry for my bad english

Re: [ADDON] SimplePortal

Reply #311

Since I'm only using (flex box) for the media query's the "recent" comment is only be relevant for mobile devices.  The two most relevant ones are .... android >=4.4 and ios safari >=9.2 so really it would have to be an old brick not to work.

Now if it was desktop, well all of IE is out, you need at least Edge 14 ... FX and Chrome, well any version since 2013/2014 or so ... pretty safe in that area as well.

Re: [ADDON] SimplePortal

Reply #312

Don't have such an old device to test, but I will upgrade soon SP on my forum with this version. If my members will complain I'll use the version you provided initially and I will disable right blocks on mobile. Problem solved! 

I did a test with IE11 & win 10 and everything seems fine, even resizing the window the blocks are displayed correctly. I also test with one small block on TOP position and other blocks on the right, works perfect on desktop.
sorry for my bad english

Re: [ADDON] SimplePortal

Reply #313

On my local I have the "fix" for the tables not formatting as they do when in a post ... easy fix of adding the right class to the outer div of articles, but it does effect a 2-3 files.  If there are no other issues that you see, I'll post an updated package with the fixes so far.

Re: [ADDON] SimplePortal

Reply #314

I can test that too ;)
sorry for my bad english