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

xen helper to have FURL link to a node

Discussion in 'XenForo Development Discussions' started by Weppa333, Mar 28, 2013.

  1. Weppa333

    Weppa333 Active Member


    I would like to know the proper way to create the FURL link to a node (a forum) with only the node_id.

    A kind of <xen:helper nodeConvert>$nodeid</xen>

    I looked at the templates but cannot find anything like this... can somebody help ?
  2. Chris D

    Chris D XenForo Developer Staff Member

    You would actually need the node id and forum name in an array to be able to use xen:link syntax. Then you would use:

    {xen:link forums, $forum}

    Without that you could just do

    {xen:link forums}/{$nodeid}

    But it will basically just be the forums link with the id on the end...
    Weppa333 and Jake Bunce like this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Weppa333 likes this.
  4. Weppa333

    Weppa333 Active Member

    I'm Modding a sidebar template from WidgetFramework and I only have access to nodeID and need to create links to the forums, this is gonna help.

    Problem remains that it does not create a FURL, it just creates forums/$forumid

    But XF rewrites this to the FURL so in the meantime, it's better than nothing...

    Is there no way to create a FURL link with inly the nodeid ?
  5. Chris D

    Chris D XenForo Developer Staff Member

    I was confused because the term "FURL" isn't used very often (or at all) in the context of URLs... Unless it's File Uniform Resource Locator but they all start with file:// so I presume it's not that you want...

    Do you mean "full" URL?

    In that case you want probably Jake's suggestion, with a small change:

    {xen:link 'full:forums', {xen:array 'node_id={$forumId}'}}
  6. Weppa333

    Weppa333 Active Member

    Sorry I'm an IPB refugee, and by "FURL" I mean" friendly url" so the forum url with the forum name in it

    instead of

    I'm inside a loop in a template, and the underlying query does not bring me the forum name, only the nodeid... I thought there might be a way to transform this node/forum ID into a "full friendly url" with some sort of magical trick

    thanks again
  7. Chris D

    Chris D XenForo Developer Staff Member

    Ah ok. That makes sense.

    No basically as per my post, the only way for it to show the friendly name is if you tell it what the friendly name is. The link builder requires the node ID and the node name. Usually this information is available because you'd pass the entire $forum variable (which contains the name and ID).

    If that information isn't available, you can actually type it in yourself manually but it's no longer "dynamic" in the sense that if the node name ever changes, the link you build below will always stay the same. So something like this should work, but it has drawbacks:

    {xen:link 'full:forums', {xen:array 'node_id=2', 'node_title=How are you'}}
    That produces:

  8. Weppa333

    Weppa333 Active Member


    Well in fact I believe the solution to my problem is to modify the WidgetTemplate renderer to bring me more info ( the full $forum variable for each $thread, instead of just the $thread.node_id I have access to at the moment. I don't seem to have a $thread.forumname. )

    I'll try and see how how that goes, ;)
  9. Chris D

    Chris D XenForo Developer Staff Member

    Sometimes the thread record contains the parent forum data. So try {$thread.forum}

Share This Page