Page MenuHomePhabricator

Multiple instance templates - large gaps between instances
Closed, InvalidPublic

Description

Author: mitchell_neill

Description:
Hi.

I'm using multiple-instance templates. Great functionality. But I've
noticed there are large gaps between the template instances on the resulting page.

Looking at the HTML with Firebug, SF seems to be inserting:
<p>
<br>
</p>
Between each instance.

On screen this translates to a large gap which looks ugly and users have commented on it. The margin can be controlled through the CSS, so a hard coded <p><br></p> is unnecessary.

If the hard coded break could be removed that would be great.

Thanks
Neill.


Version: unspecified
Severity: major

Details

Reference
bz24340

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:05 PM
bzimport set Reference to bz24340.

Hi,

As noted on the mailing list, this is probably an issue in the template itself - as you probably know, Semantic Forms produces wiki-text, not HTML.

mitchell_neill wrote:

Hi Yaron.

Thanks for your reply.

No, it is definitely not in the template. I'm looking at it in Firebug and the
<p><br></p> seems to be definitely coming from elsewhere. Perhaps the PHP that generates the wiki-text is inserting a <br>?

Cheers
Neill.

If you look at the wiki-text in the page source, you can see exactly what SF generates. Are there blank lines there between the template calls?

mitchell_neill wrote:

Hi Yaron.

If I edit rather than edit with form then there are no <br>'s in the page.

Here's an example:
{{Meeting Minutes Template

Title=DB Schema meeting
Attendees=Peter Cowan, Neill Mitchell, Simon Ford,
Meeting Date=March 1, 2010
Open={{PAGENAME}}

}}
{{Minute Item

Minute Item=Started looking at the database schema but it was decided it was too out of date. Agreed to relook at it on Weds.

}}
{{Minute Item

Minute Item=Fixed session for Weds at PC's to review deal as well as DB schema and enhancements

}}
{{Action Item

Action=Simon to try and update schema diagram as much as possible for Weds meeting
Who=Simon Ford,
Due Date=March 3, 2010
Action Status=Open

}}
{{Action Item

Action=Make sure I clean the kitchen
Who=Peter Cowan,
Due Date=March 3, 2010
Action Status=Open

}}

Yet there are large gaps between the Minute Items and Action Items and <p><br></p> in the html. So any idea where are they coming from?

Thanks
Neill.

This is definitely not a Semantic Forms issue, then; setting to "invalid".

mitchell_neill wrote:

Hmm.

Looks like it's because the template has a category directive in it.
[[Category:Actions]]
Not sure there is a way round that.

mitchell_neill wrote:

Not [[Category:Actions]]

Sorry to be a pain here, but grep -i finds quite a few <p><br /></p>'s in the code.

I appreciate you are busy, so could you quickly please point me to the code that handles multi-instance templates and I will chase this one down. My PHP skills debug are pretty good now ;) I think it is something around table rendering as the resulting html for a page with two multi-instance templates on looks like this:

<table> <tbody> <tr> table contents </tr> </tbody> </table>

<p>

<br>

</p>

<table> <tbody> <tr> table contents </tr> </tbody> </table>

<p>

<br>

</p>

This only happens with multi-instance templates. Nowhere else. The <p><b></p> has to be coming from somewhere!

Many thanks
Neill.

mitchell_neill wrote:

Okay, I've re-created one of these pages manually in a MW page rather than from SF and there are no <p></b></p>'s between the tables. So I don't think it's MW's parser inserting them.

Hope this isn't ticking you off. If it is then drop me an email.

Cheers
Neill.

This is clearly not a Semantic Forms issue - setting back to "invalid". Please stop abusing Bugzilla; it's not a general discussion forum.