Custom content based on induvidual Front End User
Custom content based on induvidual Front End User
Hi, I'm wondering if it is possible at all to determine what each individual user sees when they are logged in.
Im using the front end user and custom content modules
I currently have pages which determine what the users see by group; but am wanting to customise it further so that individual users can have a custom screen only to them.
at the minute i am using:
{if $ccuser->loggedin()}
{* content only for users that belongs to a specific group *}
{if $ccuser->memberof('GroupName')}
<div class="companyscreen"> {content block="GroupName" label="Group 1 content"}</div>
{/if}
{if $ccuser->memberof('OtherGroup')}
<div class="companyscreen"> {content block="Other" label="Content for Other Group"} </div>
{/if}
{/if}
is it possible to use a tag such as 'user_name' instead of memberof ?
Thanks in advance for any help.
Im using the front end user and custom content modules
I currently have pages which determine what the users see by group; but am wanting to customise it further so that individual users can have a custom screen only to them.
at the minute i am using:
{if $ccuser->loggedin()}
{* content only for users that belongs to a specific group *}
{if $ccuser->memberof('GroupName')}
<div class="companyscreen"> {content block="GroupName" label="Group 1 content"}</div>
{/if}
{if $ccuser->memberof('OtherGroup')}
<div class="companyscreen"> {content block="Other" label="Content for Other Group"} </div>
{/if}
{/if}
is it possible to use a tag such as 'user_name' instead of memberof ?
Thanks in advance for any help.
Re: Custom content based on induvidual Front End User
Asked and answered just a few days ago, please to search...
Re: Custom content based on induvidual Front End User
Do you mind please posting the link, as I searched for hours and hours and could not find what I was looking for. it would be much appreciated; thanks.
Re: Custom content based on induvidual Front End User
Hi gstwebdev,
Did you managed to solve this issue? I'm facing the same problem and can't find the post with the solution.
Thanks for any help on this.
Did you managed to solve this issue? I'm facing the same problem and can't find the post with the solution.
Thanks for any help on this.
Re: Custom content based on induvidual Front End User
{if $ccuser->username('the_users_username')}
{* content only for that specific user *}
{/if}
{* content only for that specific user *}
{/if}
Re: Custom content based on induvidual Front End User
Thanks for your reply. The issue here is that it only works on a specific user. I have 30 different users and I want each user to go to a personalized page.jmcgin51 wrote:{if $ccuser->username('the_users_username')}
{* content only for that specific user *}
{/if}
How could that be achieved?
Thanks again for your help.
-
- Power Poster
- Posts: 1049
- Joined: Wed Mar 19, 2008 4:54 pm
Re: Custom content based on induvidual Front End User
after a succesfull login, I would redirect them to a selectionpage with the following code:
{if $ccuser->loggedin()}
{if $ccuser->username('user1')}
{redirect_page page='user1'}
{/if}
{if $ccuser->username('user2')}
{redirect_page page='user2'}
{/if}
{/if}
{if $ccuser->loggedin()}
{if $ccuser->username('user1')}
{redirect_page page='user1'}
{/if}
{if $ccuser->username('user2')}
{redirect_page page='user2'}
{/if}
{/if}
Re: Custom content based on induvidual Front End User
That's what I was thinking staartmees, but then I thought that every time a new user is added, the template must be edited.
Isn't there any tag to get the logged user's username automatically and then pass that as a variable on the redirect?
For example:Thanks for your help on this.
Isn't there any tag to get the logged user's username automatically and then pass that as a variable on the redirect?
For example:
Code: Select all
{if $ccuser->loggedin()}
{if $ccuser->username('userid')}
{redirect_page page='userid'}
{/if}
{/if}
Re: Custom content based on induvidual Front End User
Even easier:mr.bacan wrote: For example:Code: Select all
{if $ccuser->loggedin()} {if $ccuser->username('userid')} {redirect_page page='userid'} {/if} {/if}
Code: Select all
{if $ccuser->loggedin()}
{redirect_page page=$ccuser->username()}
{* where the page alias == the logged-in user's username *}
{/if}
This kind of functionality would best be combined with a UDT that automatically creates a new page (with alias == username) when a user is created. Otherwise it will still potentially be a lot of work for the administrator to create all of the pages.
Re: Custom content based on induvidual Front End User
Thanks for your answer, I wasn't able to test it last week. Now that I finally do, it doesn't work, it seems that "{redirect_page page=$ccuser->username()}" has an error, because it breaks my template. If I remove "$ccuser->username()" and put anything else, it works.jmcgin51 wrote:Code: Select all
{if $ccuser->loggedin()} {redirect_page page=$ccuser->username()} {* where the page alias == the logged-in user's username *} {/if}
Am I doing something wrong?
Thanks again.
Re: Custom content based on induvidual Front End User
sorry - try just {$username} instead.
so
{if $ccuser->loggedin()}
{redirect_page page=$username}
{* where the page alias == the logged-in user's username *}
{/if}
so
{if $ccuser->loggedin()}
{redirect_page page=$username}
{* where the page alias == the logged-in user's username *}
{/if}
Re: Custom content based on induvidual Front End User
Thanks a lot jmcgin51, this worked like a charm. Sorry for my delayed answer on this, but I was on a business trip and didn't had the time to test it.jmcgin51 wrote:{if $ccuser->loggedin()}
{redirect_page page=$username}
{* where the page alias == the logged-in user's username *}
{/if}
I'll keep making a few tests, but at a first glance it looks like you solved my problem.
Thanks a lot for your time guys.