Custom module form on any page?

alt=
@gcuezy
10 years ago
23 posts
I noticed the how-to on adding a login form to any template. I'm curious, can this be applied to any module, given that the fields match up?

For the project I'm beginning, I'm not a fan of having a separated 'admin' page for each add/update of my items (basically trying to make a single-page app here).

These top three lines seem to say that I could theoretically point it to whatever module I want and to that modules save/update url and have it work out okay:

{jrCore_form_create_session module="jrUser" option="login" assign="token"}
updated by @gcuezy: 05/04/14 05:47:25AM
alt=
@gcuezy
10 years ago
23 posts
Seems I can't add html to my post but I was referring also to the form tag with it's action attribute pointed at: {$jamroom_url}/user/login_save
michael
@michael
10 years ago
7,746 posts
The forms have their own layout. That layout is all done via templates, so there's no reason that I can think of that would prevent them from being presented in a different way.

The question can only really be answered by doing it though, then seeing what issues you run into along the way.
brian
@brian
10 years ago
10,148 posts
gcuezy:
Seems I can't add html to my post

Make sure and put any HTML in code tags - i.e. [ code ] html here [ /code ] (no spaces before/after square brackets) so it looks like:

<b>This is some bold HTML!</b>

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 04/01/14 07:40:35AM
alt=
@gcuezy
10 years ago
23 posts
@michael

Forgive me if I'm being dense here. Are you referring to some global form templates as a part of the core?

I looked through some of a modules and the only one I could see that was related to forms was a button (on the actions module) that did an AJAX call to a module URL (where I assume a view was setup to return data).

The modules never seem to have form templates, at least not the ones sold as a bundle before launch.

Is there some take-precedence practice where I can put modName_create_form.tpl, or are you referring to doing something custom?
brian
@brian
10 years ago
10,148 posts
All the forms are created using core templates - located in modules/jrCore/templates - you'll see the main one is "form_field_elements.tpl" - you can override this with your own custom version by creating a file called:

jrCore_form_field_elements.tpl

in your active skin directory.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@gcuezy
10 years ago
23 posts
Thanks! Can this be done on a per-module basis?
brian
@brian
10 years ago
10,148 posts
gcuezy:
Thanks! Can this be done on a per-module basis?

Yes - any module that provides a template can have it's templates "overridden" by the skin.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags