Page 1 of 1

Editing Front End User Userlist.tpl

Posted: Fri Jul 07, 2006 8:51 pm
by blis102
I am working on editing the user list template so that the list displays more relevent information about the user, rather than the creation and expiration of members. I want it to list name, email, address, phone etc...

I know that editing the template is what i need to do but i cant seem to get the values to list:

Code: Select all

<hr width="50%" align="left"/>
<div class="pageoptions">
 <p>{$numusers} {$usersingroup}</p>
 <p>{$itemcount} {$usersfound}</p>
{if $itemcount > 0}
<table cellspacing="0" class="pagetable">
	<thead>
		<tr>
			<th>{$usernametext}</th>
			<th>{$createdtext}</th>
			<th>{$expirestext}</th>
			
			<th>{$emailtext}</th>
			
			<th class="pageicon"> </th>
			<th class="pageicon"> </th>
		</tr>
	</thead>
	<tbody>
{foreach from=$items item=entry}
		<tr class="{$entry->rowclass}">
			<td>{$entry->username}</td>
			<td>{$entry->created}</td>
			<td>{$entry->expires}</td>
			
			<td>{$entry->email}</td>
			
			<td>{$entry->editlink}</td>
			<td>{$entry->deletelink}</td>
		</tr>	 
{/foreach}
	</tbody>
</table>
{/if}
 <p>{$addlink}</p>
</div>
As you can see i added the email address field in the template. The problem is that the {$emailtext} section works but not the {$entrty->email}. It lists the heading but no content under the heading. Is there a way to get this to work? Where can I find my field variable names? I tried the {get_template_vars} function but with no result...

Thanks in advance for your help.

Re: Editing Front End User Userlist.tpl

Posted: Fri Jul 07, 2006 9:14 pm
by calguy1000
This is because properties, such as email address, are optional, and dependant upon group membership, so one user may have an email address property, whilst another doesn't depending upon which group they are a member in. 

This is why none of the user properties are displayed in the userlist form as there's no real way to decide which properties to display.  i.e:  do I display the "Full Name" property from group1, or the "First Name" and "Last Name" properties from group2. 

In short, there's no easy way to do that, as I can create a group that doesn't have an email property type associated with it, and frontendusers will work just fine.

Re: Editing Front End User Userlist.tpl

Posted: Tue Jul 11, 2006 1:01 am
by blis102
Hm. Well I have to have the groups displayed in a table so that we can import it into excell... If I cant do this, then the entire registration part is pretty much useless for my application... I have been working with the templates etc... to find a way around the problem and couldnt get it to work.

Is there a way to post the information in a table outside of cms... say create a php page that posts the information in a table that gets access from the module? Im aware of how to structure that part but how would i query the database so that these variables could be sent over to the script? What would be the syntax for a group variable? What I noticed is that when you go to edit a user, it post the information, is there a way that i could get that information onto a table?

Any help would be awesome, as I really need to find a solutioins to this problem. Thanks for you help!

Re: Editing Front End User Userlist.tpl

Posted: Tue Jul 11, 2006 1:16 am
by calguy1000
what information do you need in your table?  something you may want to look at is the php code for exporting users to csv.  It was designed for importing users to an excel spreadsheet.

Re: Editing Front End User Userlist.tpl

Posted: Tue Jul 11, 2006 7:07 pm
by blis102
I need the Users Name, Email, Phone, Address, and all the other table information in rows, just like a database table. It doesnt matter where it is as long as i can export it as a table into excell.

Could you explain the csv exporting more, im not sure what you mean... where can i find that php code?

Thanks alot for your help!

Re: Editing Front End User Userlist.tpl

Posted: Tue Jul 11, 2006 8:14 pm
by sanjay
blis102 wrote: I need the Users Name, Email, Phone, Address, and all the other table information in rows, just like a database table. It doesnt matter where it is as long as i can export it as a table into excell.

Could you explain the csv exporting more, im not sure what you mean... where can i find that php code?

Thanks alot for your help!
In the admin section -> users and groups -> front end user management -> admin - click export

This will produce a file that you can open with a spreadsheet (openoffice or another open source one of course  ;) ).

~sanjay

Re: Editing Front End User Userlist.tpl

Posted: Wed Jul 12, 2006 6:24 pm
by blis102
THANK YOU! You saved my life! Im sorry im such an idiot... That is exactly what i needed.

One other question tho, i have some fields that are drop downs and the values arent displaying in the spread sheet.
the fields are like this:

Code: Select all

<option value="bride">The Bride</option>
<option value="groom">The Groom</option>
<option value="family">Family of the Bride/Groom</option>
<option value="friend">Friend of the Bride/Groom</option>
<option value="other">Other</option>
Its displaying "<option value=" in the spreadsheet but not the value....

How should i change it so it displays the information in the spreadsheet?
Also what about radio buttons?

Thanks again!

Re: Editing Front End User Userlist.tpl

Posted: Wed Jul 12, 2006 6:39 pm
by calguy1000
I'll take a look at the csv export wrt dropdowns.  and radio buttons haven't been implemented yet, sorry.

Re: Editing Front End User Userlist.tpl

Posted: Thu Jul 13, 2006 11:00 pm
by blis102
Any luck finding a solution to the dropdown menu being transferred to the CSV file?

Any idea how i could do the same thing with the radio buttons?

I tried using the HTMl way to do it by giving the field a value:
The Bride

maybe making the tag like this:
bride

Or will it just work:
Bride
Groom
Family
Friends
Other


Thanks again for your help!