• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 "xen:raw $child" causing line jump

king8084

Active member
#1
i'm running into problems trying to display child forum titles on my main page. i know where to edit it (node_forum_level_2), and what to add:
Code:
                <xen:if is="{$renderedChildren} AND {$level} == 2">
                            <ol class="secondaryContent">
                            <xen:foreach loop="$renderedChildren" value="$child">
                                {xen:raw $child}
                            </xen:foreach>
                            </ol>
                </xen:if>
but the issue is that when outputting the xen:raw $child piece, it will automatically add a return stroke / new line /new row to the output. more specifically, i'm trying to do:
<parent title> <child title>

but the xen:raw is forcing it to look like:
<parent title>
<child title>

simply using $child outputs the html code, and it looks like "xen:raw" is what's responsible..


let me elaborate a bit more.. in node_forum_level_2, the following is where the parent title/link is output:
Code:
<a href="{xen:link forums, $forum}" data-description="{xen:if @nodeListDescriptionTooltips, '#nodeDescription-{$forum.node_id}'}">{$forum.title}</a></h3>
which, in my forum, outputs:


in an attempt to narrow down my problem, i tried the most basic test and changed that part of the code to:
Code:
<a href="{xen:link forums, $forum}" data-description="{xen:if @nodeListDescriptionTooltips, '#nodeDescription-{$forum.node_id}'}">{$forum.title}</a>test</h3>
which returns:


...the word "test" gets appended to the forum title (which is what i want and would expect). however, when trying to output $child here, i get:
Code:
<a href="{xen:link forums, $forum}" data-description="{xen:if @nodeListDescriptionTooltips, '#nodeDescription-{$forum.node_id}'}">{$forum.title}</a><xen:foreach loop="$renderedChildren" value="$child">{xen:raw $child}</xen:foreach></h3>


it was suggested that i use float and apply it to the output via a div or span. upon trying that, i got:
Code:
<a href="{xen:link forums, $forum}" data-description="{xen:if @nodeListDescriptionTooltips, '#nodeDescription-{$forum.node_id}'}">{$forum.title}</a><xen:foreach loop="$renderedChildren" value="$child"><span class="xt-custom-children-child">{xen:raw $child}</span></xen:foreach></h3>

with:
.xt-custom-children-child {
    float: top;
}


likewise, when changing the float to "right", i get:

...but note that this isn't stemming from the title "Music" in any way -- i tested changing "Music" to the max 50 characters, and "Album Discussion" will just drop down further.


thoughts?
 

king8084

Active member
#7
Did you re-enable it?

I would need to inspect the code while it is active.
currently active.

added:
Code:
<xen:foreach loop="$renderedChildren" value="$child"><span class="xt-custom-children-child">{xen:raw $child}</span></xen:foreach>
so that it looks like the following in node_forum_level_2:
Code:
<h3 class="nodeTitle"><xen:if is="{$watchCheckBoxName}"><input type="checkbox" name="{$watchCheckBoxName}" value="{$forum.node_id}" />&nbsp;</xen:if><a href="{xen:link forums, $forum}" data-description="{xen:if @nodeListDescriptionTooltips, '#nodeDescription-{$forum.node_id}'}">{$forum.title}</a><xen:foreach loop="$renderedChildren" value="$child"><span class="xt-custom-children-child">{xen:raw $child}</span></xen:foreach></h3>
 

Brogan

XenForo moderator
Staff member
#9
Glad you got it sorted.

I had a look late last night (around the time you posted) and decided that it would require some additional work to get the li element to sit in line.