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

Search result template caller?

Discussion in 'XenForo Development Discussions' started by CyberAP, Sep 7, 2016.

  1. CyberAP

    CyberAP Well-Known Member

    Is it possible to get a template caller name when using search_result templates?

    For example we have member_recent_content that calls search_result_*content type*. Can we use some variable in search_result_... to determine who called it? So for example in member_view we have one display of posts but in search results it's different.
  2. Mike

    Mike XenForo Developer Staff Member

    You can look at $viewName, $controllerName and/or $controllerAction in the template and react based on that.
    CyberAP likes this.
  3. CyberAP

    CyberAP Well-Known Member

    Thanks, $controllerAction is what I was looking for.

Share This Page