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

HTML rendering in forum description overlay

Discussion in 'Troubleshooting and Problems' started by Arkshine, Jun 27, 2012.

  1. Arkshine

    Arkshine Active Member

    Hi,

    I've put some HTML in forum descriptions, but since the render in the overlay is horrible, I would like to know if there is a way to tell the overlay to simply ignore the HTLM or a block of lines ?
    In others words, I would like to have the HTML rendered in the description, only when you are inside the related forum, where there is the threads list.

    EDIT : After searching more, I've tried to play with conditionals, but seems to be ignored in the forum description, am I right ?

    Thanks.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    What is the HTML you're putting in there? I've put a bit of HTML in on my test board and it looks fine. So there must be something specific that isn't working.
     
  3. Arkshine

    Arkshine Active Member

    It's basically the same thing when you create a redirection, like for example :

    [​IMG]

    With such code inside the forum description :
    HTML:
    <ol class="nodeList sectionMain" id="forums">
        <li class="node link">
            <div class="nodeInfo linkNodeInfo">
                <span class="nodeIcon"></span>
                <div class="nodeText">
                    <h3 class="nodeTitle"><a href="formulaires/support-serveur.2/respond"">Demande de support</a></h3>
                    <blockquote class="nodeDescription muted baseHtml">Veuillez cliquer ici pour faire une demande de support.</blockquote>
                </div>
            </div>
        </li>
    </ol>
    Don't mind the french language.
    What I want to do, is to create a link which point to a form (I've the Simple Forms add-on) to request support.

    At the start, I was using a redirection, because it simply looks good.
    But that's not practical with my current forums configuration, to each time create a redirection. There is also a problem I don't want to show such nodes in lists (search, and others places), but if I use the option to hide them, it's not going to be displayed in the related forums.

    So, to have something more simple, I was trying to see if I could simply use the redirection html code to show the same design, inside a forum description. It works fine, but did forgot the code would be rendered in the overlay too, and it looks like :

    [​IMG]
    Not going to show all, but it goes beyond my bottom of my screen.

    That's why I've asked if there is a way to strip html code from the description, or something, like conditionals to ignore the render on specific place, so to show the HTML code only on the thread list (like the first screenshots). I've tried to use conditionals, but it seems to be ignored. After some research, it seems I have to play with node_forum_level_2 and harcoding things here ? :/
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> node_forum_level_2

    Add the red code:

    Code:
    			<xen:if is="{$forum.description} AND @nodeListDescriptions">
    				<blockquote class="nodeDescription {xen:if @nodeListDescriptionTooltips, nodeDescriptionTooltip} baseHtml" id="nodeDescription-{$forum.node_id}">{xen:helper striphtml, {xen:raw $forum.description}}</blockquote>
    			</xen:if>
    
     
  5. Arkshine

    Arkshine Active Member

    It works, yes. Thanks ! I've seen such xen: while searching but I did not think it could be used here and like that.
     
  6. Arkshine

    Arkshine Active Member

    Just seen something amusing. I've said it works because when I've looked to the overlay, I did not see the HTML part at all (I mean completely removed, included text inside). Looking at others descriptions, I've noticed the HTML part is stripped but the text inside remains. After trying to understand, I've noticed there is a typo in the first description I've checked which somehow removes the HTML part completely.

    For example :
    HTML:
    Some description
     
    <ol class="nodeList sectionMain">
        <li class="node link">
            <div class="nodeInfo linkNodeInfo">
                <span class="nodeIcon"></span>
                <div class="nodeText">
                    <h3 class="nodeTitle"><a href="formulaires/support-serveur.2/respond"">Demande de support</a></h3>
                    <blockquote class="nodeDescription muted baseHtml">Veuillez cliquer ici pour faire une demande de support.</blockquote>
                </div>
            </div>
        </li>
    </ol>
    It will show only "Some description". Notice the "" next to the link. Just that make the whole HTML block disappearing.
    It's actually the behavior I was expecting and I guess it's fine to use it like that. :p Though, just by curiosity, I wonder why it happens.
     

Share This Page