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

Raw HTML Controller?

Discussion in 'XenForo Development Discussions' started by Robust, Nov 29, 2015.

  1. Robust

    Robust Well-Known Member

    So, is there a way to have a raw HTML controller to display a homepage instead of a formatted response with the page_container and all?


    ^ those pages are within XF.com's XF installation I think. That's what I attempt to do. I want my homepage to be within the XF framework and port it over, but I don't want it within the header and all.

    How can I achieve this?
    @Mike @Chris D How did you guys do it here at XF.com?
  2. Chris D

    Chris D XenForo Developer Staff Member

    Jake B. and Robust like this.
  3. Robust

    Robust Well-Known Member

  4. Robust

    Robust Well-Known Member

    On another note, I understand views generally, but in XenForo I don't fully understand the purpose of a view. Seems to me like the XenForo template aspect of it takes care of what a view would traditionally do. Can someone explain to me where views are used in XF and what they do? I looked at XF's stock templates and they weren't of much help explaining this.

    I had to touch them today to provide json responses.
  5. Chris D

    Chris D XenForo Developer Staff Member

    It's sort of an application on its own, which is, for the most part, built using framework code borrowed from or derived from XenForo itself. So it's not an add-on for XenForo, there's not really a normal XenForo installation behind it.

    That said, it actually does use the alternative page container thing in a number of its controllers, e.g. the page container used for the home page is not the same as the container used for the manual page, for example.

    "View" is really a highly generalised term that really encompasses a range of things, including the rendering of templates, etc. Though if you're talking about View classes specifically they are probably best seen as a final layer between the controller and what is output to the user allowing you to manipulate it as required. It allows us to prepare data to be output as JSON for AJAX requests, it allows us to prepare the data for output as RSS or XML, it allows us to manipulate the response headers so that an attachment file is downloaded vs displaying it as an image within the browser etc.
    Robust likes this.
  6. Jaxel

    Jaxel Well-Known Member

    I use a custom view wrapper here:


    That front page is actually XenForo.
    Robust likes this.
  7. Steve F

    Steve F Well-Known Member

    Would love to see a tutorial on this or even if it could be made an add-on (y)
  8. Chris D

    Chris D XenForo Developer Staff Member

    Robust and Steve F like this.
  9. Steve F

    Steve F Well-Known Member

    Hadn't really looked at that but will check it out now, thanks.
  10. Robust

    Robust Well-Known Member

    It would seem like this doesn't support xen:require css=?, as expected. How can I include an external template?
  11. Robust

    Robust Well-Known Member

    Fixed. Apparently:
    means more than just a comment ;)

Share This Page