adding username to each section

8 posts by 2 authors in: Forums > CMS Builder
Last Post: November 3, 2016   (RSS)

By loccom - November 2, 2016

Hi

Wonder if you guys can help

I have 5 sections in the admin area, each section has to be completed by the user in the back end. However, I would like the username from the "User Accounts" section to be shared across all 5 sections listing form, so when they submit each section their username is listed with each form. I tried to do this with related records, not much luck as lack of knoweldge, also tried it with the list options feature, is sort of worked but they had to choose from a list. 

Quick Example

Section 1
Username (pre-filled using data from User Accounts)
Felid 1
Feild2
Field3

Section 2
Username (pre-filled using data from User Accounts)
Felid 1
Feild2
Field3

Hope this works

By ross - November 2, 2016

Hi there.

Thanks for posting.

I'd like to start here with going over why you'd like to have the username appear in each record like that.

The system already tracks what user creates each record in the "createdByUserNum" field and will display the username at the top of the page like this:

Created Nov 2nd, 2016 - 09:29:32 PM (by "username") 

If you are doing this so you can display the username on the front end of your site, you can use this:

<?php echo $record['createdBy.username']; ?>

You can actually access any field in the user account table through this means:

<?php echo $record['createdBy.fullname']; ?>
<?php echo $record['createdBy.email']; ?>
etc

Does that make sense?

Let me know any questions.

Thanks.

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

By loccom - November 2, 2016

Hi Ross

To make things simple to explain i used "Username" from the "User Accounts" but we actually have a "Team name"

This is not for the front end of the site, i know how to do that, but we are using the back end as a register to a rally.

A Team logs in and registers themselves.They are able to come in and edit there team info at any time.

In the screen shot you will see each section in the menu.

when the admin overviews each listing fin each section the amin can see which team it relates to. (see screenshot)

We want to see "Team Name" to appear in the forms of each section, but i did not want the team to have to repeat their team name in each section when completing.

hope this makes sense, i am terrible at explaining things lol

By loccom - November 3, 2016

That is perfect.. and it looked so easy too.

The user will not have access the team name as it's vital it stays untouched.

thanks so much

By ross - November 3, 2016

Great! Glad that worked :).

Keep us up to date with how you are making out.

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

By loccom - November 3, 2016

First one fixed it a treat

Just out of curiosity as it gave me an idea, is is possible to do the same from one of those sections to another? (not from user accounts)

so out of the 4 sections i can take a field from section 2 and add to section 4

<?php echo $CURRENT_USER['team_name']; ?>

I presume i change the CURRENT_USER part of the code?

is there a guide on this as well?

By ross - November 3, 2016

Hi loccom

There isn't an easy way to get a value from a field in section 1 to auto-populate a field in section 2 when you create a new record.

We can build a custom plugin through consulting, though. If you'd like to discuss the options, you can email as via consulting@interactivetools.com.

Let me know any other questions.

Thanks.

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/