1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 forced to input Custom Profile for old/new members

Discussion in 'XenForo Questions and Support' started by swatme, Nov 26, 2011.

  1. swatme

    swatme Well-Known Member

    hi

    how can i forced all my users to input the new custom profile ive just enabled?

    thanks
     
  2. Mike

    Mike XenForo Developer Staff Member

    Required fields are only forced if they go to edit their profile (where those fields are shown).
     
  3. Digital Doctor

    Digital Doctor Well-Known Member

    Would it be possible to setup a Xenforo NOTICE ... for those with missing information ?
    A percentage of your members with missing information would probably voluntarily add the information if they knew it was required.

    Make the notice nag them for a while until they do it !
    :)
    Display offensive images in the notice until they fill in the data ! :)
     
  4. swatme

    swatme Well-Known Member

    agree digittal doctor,

    to provide targeted xenforo notice to specific users,
    we need members to be forced to input the required field.
    maybe after they login, they cannot post unless they input
    something in that field...
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The notice system doesn't have criteria for that. But you can edit the templates:

    Admin CP -> Appearance -> Templates -> PAGE_CONTAINER

    Add the red code:

    Code:
    			<xen:if is="{$sidebar}">
    				<div class="mainContainer">
    					<div class="mainContent"></xen:if>
    						
    						<xen:include template="ad_above_top_breadcrumb" />
    
    						<xen:if is="!{$visitor.customFields.field_id}">
    							<p class="importantMessage">
    								YOU NEED TO FILL OUT THIS THING
    							</p>
    						</xen:if>
    
    						<xen:hook name="page_container_breadcrumb_top">
    						<div class="breadBoxTop">
    							<xen:if is="{$topctrl}"><div class="topCtrl">{xen:raw $topctrl}</div></xen:if>
    							<xen:include template="breadcrumb"><xen:set var="$microdata">1</xen:set></xen:include>
    						</div>
    						</xen:hook>
    
     
    swatme likes this.
  6. swatme

    swatme Well-Known Member

    thanks jake,

    my question is should i change the blue color field_id text ?


    my custom field title: COUNTRY
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes you need to enter the field_id of your profile field.

    Screen shot 2011-10-28 at 3.56.57 PM.png
     
    swatme likes this.
  8. swatme

    swatme Well-Known Member

    thanks working good!!!
    i set the font size to SUPER LARGE!
    so that it will be offensive to their eyes :D
     
  9. AndreaMarucci

    AndreaMarucci Well-Known Member

    Thanks Jake. I've three fields that must be filled. How can I modify your code?

    Thanks again
     
  10. AndreaMarucci

    AndreaMarucci Well-Known Member

    Can I do that?
    Code:
    <xen:if is="!{$visitor.customFields.field_id1}">
                                <p class="importantMessage">
                                    YOU NEED TO FILL OUT THIS THING
                                </p>
                            </xen:if>
    <xen:if is="!{$visitor.customFields.field_id2}">
    <p class="importantMessage">
    YOU NEED TO FILL OUT THIS THING
    </p>
    </xen:if>
    <xen:if is="!{$visitor.customFields.field_id3}">
    <p class="importantMessage">
    YOU NEED TO FILL OUT THIS THING
    </p>
    </xen:if>
     
  11. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes that works.
     
  12. AndreaMarucci

    AndreaMarucci Well-Known Member

    Jake it works but I've a problem. With the code I've inserted also the visitors see the messages and that's not correct. I would need that these notices appear only for the members of a particular usergroup. How can I modify the code?
     
  13. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Surround all of them with this condition:

    Code:
    <xen:if is="{$visitor.user_id}">
    
    </xen:if>
    
    That will make them not show for guests.
     
  14. AndreaMarucci

    AndreaMarucci Well-Known Member

    Works, thank you very much!
     
  15. swatme

    swatme Well-Known Member

    what is the FIELD ID of "location" in XF
     
  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That actually isn't a custom field. You can reference that field in the templates with this variable:

    Code:
    {$visitor.location}
    
     
  17. radu81

    radu81 Member

    With this code you will get 3 box notifications, I use this to get only one notification, maybe this could be useful to other members
    Code:
     
                           <xen:if is="{$visitor.user_id}">
                                <xen:if is="!{$visitor.customFields.regione} OR !{$visitor.customFields.provincia} OR !{$visitor.customFields.city}">
                                <p class="importantMessage">
                                    we added some custom fields to profiles, once inserted  this notification will disapear.  Click <a href="{xen:link account/personal-details}"> here </a>to update your profile
                                </p>
                            </xen:if>
                            </xen:if>
     

Share This Page