Topics

Tribe Support

Tribe Support's Topics

Nick Swinford

Nick Swinford

May 14 2017

How can I display the login for in a template file?

I want to display the login form in a template file in a custom component, but every thing I've tried so far has given me an error. Currently, I have:

Loading ...

If you don't set the format, you get an error about the user not being logged in. It currently returns a form template not found error.

Any ideas? Thanks.

At this point perhaps just duplicate the form in your component. To make the form reusable we need to define it as a ui element. You are trying to access it via the session controller and that could really complicate things.

Any reasons you are duplicating the login form? You can redirect guest users to the form and then return them back to where they were in your component once they're logged in.
I'm building an component where a user can either login or continue along as a guest. If that's not possible currently, I think I'll just provide links to the login page.
Rastin Mehr liked this
Isn't one of the big features of Anahita/Nooku Hierarchical MVC? That you can call any component from within another component?
That's not what the HMVC is about. HMVC is when a component can be extended by other components and form inheritance. Dispatching a controller within a view is possible, but not recommended, because it is quite resource intensive and prone to errors.
@Rastin, thanks for the clarification. That makes better sense.

Let me ask you this though. I create a forum component and I'd like to add a few features like polls and attachments. My plan has been to create media apps for both of those and then find a way to integrate them into my forums component. I was thinking of using the composer as an example of what I'd want to do.

Any suggestions on how to do it?
Composer is just multiple forms shown in tabs. Each form is injected by a media app which creates a specific type of node. In the forum context you would want to be able to install apps within a forum and they'd inject forms in the composer. A forum would display an aggregate list of different type of Topic nodes. Did that make sense?

Powered by Anahita