Forum

Thread tagged as: Question, Problem, Error

Extra blank space being added around repeaters

Hi, I'm having an issue with repeaters automatically breaking onto new lines. Because I'm having to use display-inline in my CSS, this is causing list items to stack under each other rather than inline.

My template looks like this:

<perch:repeater id="features" label="Features" max="6">
    <perch:before>
        <div class="features-list">
            <div class="col1 no-padding">
                <ul></perch:before><li><perch:content id="features-text" /></li><perch:after></ul>
            </div>
            <div class="clear"></div>
        </div>
        </perch:after>
</perch:repeater>

As you can see, there is no space between any of the tags, but the HTML being out-put is this:

<div class="features-list">
            <div class="col1 no-padding">
                <ul><li>Feature One</li>

    <li>Feature Two</li>

    <li>Feature Three</li>

    <li>Feature Four</li></ul>
            </div>
            <div class="clear"></div>
        </div>

The problem seems specific to repeaters.

Haydn Ward

Haydn Ward 4 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What type of field is features-text? It's missing a type attribute.

Also, try:

<perch:repeater id="features" label="Features" max="6"><perch:before>
        <div class="features-list">
            <div class="col1 no-padding">
                <ul></perch:before><li><perch:content id="features-text" /></li><perch:after></ul>
            </div>
            <div class="clear"></div>
        </div>
        </perch:after></perch:repeater>

Thanks Drew,

That's fixed it.

Adding the type="" before trying your new html didn't any difference though. The content is being pulled in using content_custom and type is set in the main region. Is it best practice to set type in all instances?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

It's required to set type in all instances.

https://docs.grabaperch.com/docs/templates/tag-structure/