solved Pull in form fields into created tpl files

MAD
MAD
@madc
10 years ago
600 posts
I have created an aparna module for a radio station and added an index.tpl file for that module.
The index.tpl file is linked from a menu item I created which works fine.

I have been asked to pull in their profile info into that index.tpl file.
How would I do that?

My module is prLoudFastShitty
and one field i need to pull in is profile_bio from an added field in the profile module through the form designer.

If someone can show me how to get that in I can work out the rest of the fields.

I have been trying for 2 days and alls I get is no profile_id set etc.

Cheers for any help

Attached is my debug for the page I am trying to get it into
Sorry still don't understand if the variable isn't available how to pull it in...can't find any docs.
me=dumb
zip
debug.txt.zip  •  11KB




--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 03/14/14 12:02:35AM
MAD
MAD
@madc
10 years ago
600 posts
also i just tried to delete that attachment from the forum window here on jr ( the bin ) just kept refreshing
I was trying to delete it then add a newer one.
I had to edit the post and re-upload another attachment to get rid of it
Just letting you know


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 02/08/14 09:11:19AM
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
If you have to get the profile info directly into the template use jrCore_list or jrCore_db_get_item:
{$your_profile_id = 7}
{$_profiledata = jrCore_db_get_item("jrProfile",$your_profile_id)}
{$_profiledata.profile_bio}

If you need only the bio, you can use jrCore_db_get_item_key($module, $id, $key)to get only that:
{$your_profile_id = 7}
{$bio = jrCore_db_get_item_key("jrProfile",$your_profile_id,"profile_bio")}
{$bio}



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
michael
@michael
10 years ago
7,717 posts
Here is a writeup on how to get stuff from the DB and avoid having to add a template file.

It uses {capture} to avoid having a file in the file system while using {jrCore_list}.

Probably wont be too surprising if you've taken a look through the .tpl files in the modules and stuff because its used quite often.

But now there is a write-up here in the docs too:

"HowTo: Use {capture} to avoid using another file for {jrCore_list} calls."
https://www.jamroom.net/the-jamroom-network/documentation/howto/1637/howto-use-capture-to-avoid-using-another-file-for-jrcore-list-calls
MAD
MAD
@madc
10 years ago
600 posts
Thanks @SteveX that worked great and I worked out the rest of them from your code.
Also @michael - You sir are a legend. Thanks for the hand in IRC ;)


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
Cool thread! :)


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

Tags