ElkArte Community

Project Support => Support => Topic started by: Ruth on October 15, 2014, 01:19:27 pm

Title: Preview in SimplePortal Blocks
Post by: Ruth on October 15, 2014, 01:19:27 pm
Hello!

I am not sure, if this is a bug...

By creating a new block in portal (or when I edit an existing block), the block will not stay at the place, where it should be - if I use the preview. Then the block "jumps back" to the first position in its section, it is always at the top there. I have to select the position of the block again, without using the preview...or move the block afterwards on the blocklist to the place where it should be.

It is not really important... ;) but first this had confused me.
Title: Re: Preview in SimplePortal Blocks
Post by: emanuele on October 17, 2014, 02:32:05 pm
Better keep the bug reports board only for ElkArte bugs. ;)

I think I got it:
go to admin > SP > blocks > add block
pick on, and "select block type"
change the "column" to one you have already some blocks
click "preview"
change the order to something different
hit again "preview"
=> the order it reset to "before" and the first block.
Title: Re: Preview in SimplePortal Blocks
Post by: Ruth on October 17, 2014, 02:43:48 pm
Yes...

Sorry for using the wrong board, emanuele...
Title: Re: Preview in SimplePortal Blocks
Post by: emanuele on October 17, 2014, 03:58:29 pm
No problem, the move feature is there to move topics around! :P
Title: Re: Preview in SimplePortal Blocks
Post by: Spuds on October 18, 2014, 09:14:39 pm
Sorry I have not had a chance to look at this issue just yet ... but I will, once I get done playing with test cases :'(

Title: Re: Preview in SimplePortal Blocks
Post by: [SiNaN] on October 19, 2014, 01:14:39 pm
Blocks module is the oldest one but I never got around to recoding it. That's the first thing in the to-do list for the next version though, once I finish adding the new features.

PortalAdminBlocks.controller.php

Code: (Find) [Select]
				'row' => !empty($_POST['block_row']) ? $_POST['block_row'] : 0,
Code: (Replace) [Select]
				'placement' => !empty($_POST['placement']) && in_array($_POST['placement'], array('before', 'after')) ? $_POST['placement'] : '',
'row' => !empty($_POST['block_row']) ? $_POST['block_row'] : 0,

PortalAdminBlocks.template.php

Code: (Find) [Select]
								<option value="before">', $txt['sp-placementBefore'], '...</option>
<option value="after">', $txt['sp-placementAfter'], '...</option>
Code: (Replace) [Select]
								<option value="before"', (!empty($context['SPortal']['block']['placement']) && $context['SPortal']['block']['placement'] == 'before' ? ' selected="selected"' : ''), '>', $txt['sp-placementBefore'], '...</option>
<option value="after"', (!empty($context['SPortal']['block']['placement']) && $context['SPortal']['block']['placement'] == 'after' ? ' selected="selected"' : ''), '>', $txt['sp-placementAfter'], '...</option>

Code: (Find) [Select]
								<option value="', $block['row'], '">', $block['label'], '</option>';
Code: (Replace) [Select]
								<option value="', $block['row'], '"', (!empty($context['SPortal']['block']['row']) && $context['SPortal']['block']['row'] == $block['row'] ? ' selected="selected"' : ''), '>', $block['label'], '</option>';