I am creating a custom form handler for a very specialized form, and I want to reference some customcontent information (i.e. loginname, etc.) inside the user defined tag that will be displaying the form (i.e. prefilling user information like first name, last name, username, etc.). How do I do this?
Thanks.
referencing customcontent in user defined tag?
-
sabernar
referencing customcontent in user defined tag?
Last edited by sabernar on Sat Jul 01, 2006 9:52 pm, edited 1 time in total.
-
sabernar
Re: referencing customcontent in user defined tag?
Well, I went and did this:
global $gCms;
$cc = $gCms->modules['FrontEndUsers']['object'];
$fname = $cc->GetUserProperty('cfirstname');
and it works just fine. It seems like there should be an easier way, but I wasn't able to find it.
If anyone has any better methods to accomplish this, I'd love to hear them.
global $gCms;
$cc = $gCms->modules['FrontEndUsers']['object'];
$fname = $cc->GetUserProperty('cfirstname');
and it works just fine. It seems like there should be an easier way, but I wasn't able to find it.
If anyone has any better methods to accomplish this, I'd love to hear them.
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: referencing customcontent in user defined tag?
If you are using a user defined tag, then no, this is the defined way of doing things:
a) get a reference to a module instance
b) use the module's API (if it has one that is sufficient) to extract
data that you need.
If you had been doin this in you template, then customcontent and frontendusers export variable such as this to smarty for you already.
a) get a reference to a module instance
b) use the module's API (if it has one that is sufficient) to extract
data that you need.
If you had been doin this in you template, then customcontent and frontendusers export variable such as this to smarty for you already.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
-
sabernar
Re: referencing customcontent in user defined tag?
That was the first thing that I tried. Could you give me a quick example?
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: referencing customcontent in user defined tag?
Code: Select all
global $gCms;
$feusers =& $gCms->modules['FrontEndUsers']['object'];
$userid = $feusers->LoggedInId();
$fname = $feusers->GetUserProperty('cfirstname');Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
