1. 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

Discussion in 'Styling and Customization Questions' started by king8084, Dec 10, 2014.

  1. king8084

    king8084 Active Member

    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:
    [​IMG]

    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:
    [​IMG]

    ...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>
    [​IMG]

    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;
    }
    
    [​IMG]

    likewise, when changing the float to "right", i get:
    [​IMG]
    ...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?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Can you post a link or is this on a dev site?
     
  3. king8084

    king8084 Active Member

    i've removed the code for the time being though -- let me know which version of the above you'd like me to temporarily add back if it will help with resolving.
     
    Last edited: Dec 11, 2014
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I was just going to inspect the code and see if I could get it to work.
     
    king8084 likes this.
  5. king8084

    king8084 Active Member

    any success? the only thing i can think of is that there's some funky formatting defined in the "raw" component. Can that be altered?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Did you re-enable it?

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

    king8084 Active Member

    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>
     
  8. king8084

    king8084 Active Member

    @Brogan disregard. this was resolved by some css changes. thanks for the help
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     
    king8084 likes this.

Share This Page