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

How can I put all nodes listed in <head>?

Discussion in 'XenForo Development Discussions' started by Marcus, Oct 7, 2011.

  1. Marcus

    Marcus Well-Known Member

    I want to put all forums (nodes) listed in <head> for my doubleclick integration.

    Example: A user is browsing this thread. This would result in:
    <head> (...) <tag="Forums"><tag="Development Help"><tag="XenForo Development Discussions"> (...) </head>

    I also need to normalize all the node titles so that I strip all non-a-Z0-9 characters. Café will be normalized into Caf.


    What I found: nodeBreadCrumbs is an array of these forums.
  2. James

    James Well-Known Member

    Yeah your best bet is to split the node breadcrumbs array into separate tags using a foreach statement.
  3. Marcus

    Marcus Well-Known Member

    Yes that works pretty nice. Is there a way to use string functions within the templates to only fetch the left 30 characters of a string?
  4. James

    James Well-Known Member

    There is a word trim function but I can't remember it off the top of my head and I'm mobile, so ill check tomorrow and report back. In the mean time, check the news_feed_global template, I'm sure its used in there to trim the thread previews.
    Marcus likes this.
  5. James

    James Well-Known Member

    Yeah, there are a couple of word trim functions actually... though none of them seem to trim full words.

    {xen:helper wordtrim, $words, trimlength}
    {xen:helper snippet, $words, trimlength}
    {xen:string wordtrim, $words, trimlength}
    Marcus likes this.

Share This Page