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

Customizing Page Container code only when on a specific page type

Discussion in 'Styling and Customization Questions' started by Johnstevens21, Nov 29, 2012.

  1. Johnstevens21

    Johnstevens21 New Member

    Hi There

    (FYI - this is not JohnStevens, but someone helping him).

    Anyhow... I'm decent at PHP but totally new to Xenforo. How would I say;

    "IF the pagetype is a member profile page, add this customline of HTML"

    Pretty sure I'd need to do this in the PAGE_CONTAINER template?


    PS - if you're curious, I want to add <meta name="robots" content="noindex"> to the <head> of member profile pages to prevent them from being indexed.

    PPS - despite belief, robots.txt will not precent indexation... so definitely need to be able to do it the way mentioned above!
  2. Chris D

    Chris D XenForo Developer Staff Member

    Hey there Dan.

    Yeah here's exactly the thing you need:

    It's actually much more simple and elegant.

    In the template for the page you don't want to be indexed, e.g. in your case member_view template (the profile of each user):

    <xen:container var="$head.robots">
    	<meta name="robots" content="noindex" />
    That will place the relevant code in the head.

    If you search all templates for "noindex" you will see where else this has been employed.
    Jake Bunce likes this.
  3. Johnstevens21

    Johnstevens21 New Member

Share This Page