[XenFans] Let's get started .. (for 0 posters) [Template Modification]

Status
Not open for further replies.

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
[XenFans] Let's get started .. (for 0 posters) [Template Modification]

With this little template modification we want to demonstrate how to customize the end-user experience on your site. We're using it on http://xenfans.com/ for new guests and newly registered members who are about to register or have just confirmed their account, (and have 0 posts); Inviting them to introduce themselves via a new thread, to upload an avatar or to complete their profile settings. You could use it on your site for the same reasons, or perhaps to point them to the forum help page, or contact sales, etc.

To demonstrate what a minute of customizing can do, here's the xenfans.com version :

Guests:
Screen shot 2011-01-29 at 3.07.23 PM.png

Confirmed / registered members:
Screen shot 2011-01-29 at 3.07.13 PM.png
What does the xenfans.com version do?
- user is NOT logged in, or unregistered, gets a block with sign-up or login buttons, which drop down the login bar in the top. This is also a great place to explain what the board is about.
- user is registered, but didn't confirm email: default xenforo 'activate account' msg
- user is registered, but has 0 posts: gets invited to introduce him/herself msg
- user is registered, but regardless of post count, gets invited to set a gender, and/or upload avatar ~ depending if they have one or not.

It requires 1 template modification (and some css), and respects your customized design, replacing the 'your account is waiting confirmation' once confirmed with 'thank you for signing up, lets get started..' (or whatever you want to use as text). And guests will be introduced to the board.

For demo purpose, it does not use phrases. It's quite easy to add a phrase yourself if your community has more than one language. And if you just have one international language, manually change the text.

Anyway, let's get started.

We're going to address the registered user, who is not waiting account confirmation, and has exactly zero posts, with an important message. And a link to an end-goal, in this case a "new thread" creation page where they can introduce themselves.

Obviously what you need to do is change that end-goal with the link + text of your own choice.

Step one, go to the admin.php > appearance > templates > PAGE_CONTAINER > and find this code:
Code:
<!-- top breadcrumb, top ctrl -->
and above it on a new line add this code:
Code:
<xen:if is="!{$isAwaitingEmailConfirmation} AND {$visitor.user_id} AND {$visitor.message_count} == 0">
							<p class="importantMessage" style="line-height: 1.6em;">
								Thank you for signing up {$visitor.username}, and welcome to {$xenOptions.boardTitle}.
								<br /><span class="xenfans_welcome"><a href="{xen:link forums/offtopic/create-thread}" class="concealed">Let's get started by Introducing yourself ...</a></label></span>
								</p>
						</xen:if>
						<xen:if is="!{$isAwaitingEmailConfirmation} AND {$visitor.user_id}">
							<xen:if is="{$visitor.avatar_date} == 0 AND !{$visitor.gravatar} OR !{$visitor.gender}">
							<p class="importantMessage" style="line-height: 1.6em;">
								We invite you to personalize and complete your profile :) <br />
								<xen:if is="{$visitor.avatar_date} == 0 AND !{$visitor.gravatar}">
									<span class="xenfans_welcome"><a href="{xen:link account/avatar}" class="OverlayTrigger" class="concealed">Upload avatar ..</a></label></span>
								</xen:if>
								<xen:if is="!{$visitor.gender}">
									<span class="xenfans_welcome"><a href="{xen:link account/personal-details}" class="concealed">Select Gender ..</a></label>
								</xen:if>
							</p>
							</xen:if>
						</xen:if>
						<xen:if is="!{$visitor.user_id}">
							<p class="importantMessage" style="line-height: 1.6em;">
							<b>Welcome to {$xenOptions.boardTitle}!</b><br />
							You're currently viewing our site as a guest user. <span class="xenfans_welcome"><label for="LoginControl"><a href="{xen:link login}" class="concealed">Sign up</a></label></span> or <span class="xenfans_welcome"><label for="LoginControl"><a href="{xen:link login}" class="concealed">Login</a></label></span><br />
							 Having an account grants you additional privileges, such as creating-, and participating in discussions.
							</p>
						</xen:if>
and save the template.

Step two, still in the same template, find the newly added code:
Code:
<a href="{xen:link forums/offtopic/create-thread}">Let's get started by Introducing yourself ...</a>
and replace the LINK and the TEXT to your own site's introduction forum or whatever you want to do with it. Optionally you can replace everything within <p> .. </p> with whatever you want, youtube embed to show site-training video, images, custom menu, donation button or a flower.

Of course, go through all the text and links, so it matches your board. Then Save the template.

Step three: to extra.css, add:
Code:
.xenfans_welcome {
padding: 3px 6px;
border: 1px solid @primaryLight;
border-radius: 3px;
background: @primaryLighterStill url('@imagePath/xenforo/gradients/tab-unselected-25px-light.png') repeat-x top;
text-align: center;
font: 11px verdana,sans-serif;
text-decoration: none;
color: @primaryMedium;
text-shadow: 1px 1px 0px #fff;
outline: 0;
}

Save the template again, and go test! It should not show to users with a post. Nor should it show to users who are newly registered but haven't confirmed their account yet via email. It should show to users with 0 posts, and a confirmed account.

Check out the XenFans.com "XenForo Resources" section for more tips/tweaks, guides, documentation, addons and styles.
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
To demonstrate what a minute of customizing can do, here's the xenfans.com version :

Guests:
Screen shot 2011-01-29 at 3.07.23 PM.png

Confirmed / registered members:
Screen shot 2011-01-29 at 3.07.13 PM.png
What does the xenfans.com version do?
- user is NOT logged in, or unregistered, gets a block with sign-up or login buttons, which drop down the login bar in the top. This is also a great place to explain what the board is about.
- user is registered, but didn't confirm email: default xenforo 'activate account' msg
- user is registered, but has 0 posts: gets invited to introduce him/herself msg
- user is registered, but regardless of post count, gets invited to set a gender, and/or upload avatar ~ depending if they have one or not.
 

Mikey

:mikey:
Staff member
Joined
Jan 26, 2008
Messages
17,836
For a message to guests as well, follow Floris' instructions, but somewhere above the line
Code:
						<!-- top breadcrumb, top ctrl -->
add

Code:
<xen:if is="!{$visitor.user_id}">
                                                <p class="importantMessage">
                                                <b>Welcome to YOURSITENAME!</b><br />
                                                You're currently viewing our site as a guest user. <br />
                                                 This allows you to do most things, but restricts your access to some areas of our site, such as <a href="http://yoursite.com/unique-feature">a unique feature</a>, and also making threads and replying to posts.<br />
<a href="http://yoursite.com/login/login">Registration</a> is quick, easy and most importantly, free! So why not sign up today? :)
                                                </p>
                                                </xen:if>

looks like

msg-to-guest.png
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
I have also update the code again in the first post with some tweaks of my own. Avatar editing is now done in-line rather than on a separate page. And some variables are respected. Oh, and the sign-up and log-in links now slide down the top login_bar, just like the xenforo-signup button in the sidebar.

Great suggestion Mikey, the first post will now also have your (though my version of it that we use on xenfans) contribution.
 

erich37

OMG Member
Joined
Oct 31, 2010
Messages
72
hi Floris,

does this also work when "Gravatar" is disabled on the Forum ?

Great mod !
 

TilkiBey

OMG Member
Joined
Jan 18, 2011
Messages
76
i think, the select gender link will be more well like that (sorry for my English, is anyone edit this sentence with clear English :) )
HTML:
<a href="{xen:link account}personal-details#ctrl_gender_male" class="concealed">
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
Thanks for the tip, I will update the plugin I am trying to build. I am hoping to find someone that wants to help volunteer basis to build it, so we can release it on xenfans here and xenforo there as a plugin. I have some admin options I want to add, and then use .. I just am too unfamiliar with putting it all together :)
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
Another feature the plugin will have is a yes/no switch for "show meta description in the guest welcome block"

I will work on the admin options section a bit more and update hte .xml so i can share what i have at least. maybe someone can put it into a full product for us - obviously with full credits in the readme.html and the release threads.

Teamwork: EPIC!
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
Add-on: XenFans Welcome Blocks

Preview of the current rc1 admin.php > options > xenfans welcome blocks settings - page:

Screen%20shot%202011-02-08%20at%203.44.46%20PM.png


I've got that created, what I need done now (and I simply don't know how) is to figure out how I can get those variables to be used in an if conditional in my template. So I can based on settings display or not the blocks or elements in it.
 

TilkiBey

OMG Member
Joined
Jan 18, 2011
Messages
76
i wrote an add-on for this welcome area
but i ve no ss now, coz i wrote in my personal laptop and i am in a net cafe now =)
sending pc to floris now =)
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
I will review it and compare against what I have. I am sure you will have elements I can use! Thanks for your contributions.
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
Yeah, this has the code I was missing the other day, but figured out via help of Onimua. You got a few other things that are cool to include, I will make sure we cover those as well.
 

EQnoble

OMG Member
Joined
Dec 11, 2010
Messages
128
Wow... not to like spam this thread but damn sirs ...this is progress and teamwork at it's finest. Many compliments to everyone. I had gotten busy over the past few weeks with random tasks and when I come back I see this...NICE! Great work everyone. Once I figure the exact direction I will be going with my theme I will for sure be using this. 100% guarantee.
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
Tonight the admins on xenfans (well, that's me and nix) will be working on the newsletter (if mods read this, you can preview its process in the staff lounge) and send it on Thursday at some point to the 400+ members.

After that, I will have time to fresh install rc2 on the dev.area and run it in debug mode for this plugin, merging the code I've got pre-written together with the work from xen-tr and the user suggestions.

The prototype alpha will be shaped into a working beta add-on which we will install on our live sites (which are 4) and provide early on xenfans here.

Once we get some feedback via users and fixed issues that we run into, we will release it on xenforo this weekend.

I know this is simple work for some, but a simple single template conditional turning into a featured add-on with options .. not too shabby.
 

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
Oh, and as it stands now, the rc2 build will not require any file uploads, will be supporting multiple languages, has admin-settable options and a custom template, so upgrading in the future will be super simple. :)
 

addaco

OMG Member
Joined
Apr 28, 2011
Messages
4
hi, nice tweak.

I cant find the conde in the PAGECONTAINER template. Which tab is it in (theres loads like ad, breadcrum etc)

I am new to xenforo. Many thanks
 
Status
Not open for further replies.
Top