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

XF 1.2 Conditional depending from URL

Discussion in 'Styling and Customization Questions' started by pjfry, Sep 4, 2013.

  1. pjfry

    pjfry Active Member

    Hi there,

    I am planning for my community a "blog-system" with XenZine Articles. For this "blog" section I'd like to change the Forum Name to:

    "Forum Name - Blogs"

    So I thought the best way would be a conditional which look s at the URL. If the URL is

    Code:
    /xz-articles/
    than use "Forum Name - Blogs" as Forum Name (Titel)

    else use "Forum Name " as Forum Name (Titel)

    Is there any conditional which can be used for this?

    Thanks Benny
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Look for the template that contains the title you want to change and find the:

    <xen:title> or <xen:h1> tags.

    Change those to whatever you like.

    No conditionals necessary.
     
  3. pjfry

    pjfry Active Member

    Maybe I didn't describe my problem right. I want to get this:

    <xen:h1> tag should be by default "My Forum"

    when going to this URL

    http://mydomain.com/xz-articles/*

    the <xen:h1> tag should be switched to

    "My Forum Blogs"

    Benny
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Right.

    So edit the template that loads the articles page with the desired <xen:title> and <xen:h1> values.
     
    pjfry likes this.
  5. pjfry

    pjfry Active Member

    Ahhh now I understand :)

    I'll give it a try!

    Thanks
     
  6. pjfry

    pjfry Active Member

    Perfect works fine ... but now I have another question:

    Is there also a possibility to change the logo? I have a text Logo and wan't it also to show "Forum Name - Blog"?

    Thanks Benny
     
  7. Chris D

    Chris D XenForo Developer Staff Member

    It will depend on your style...

    Somewhere on one of your templates you will have the logo text defined.

    You could then use a conditional, such as:

    Code:
    <xen:if is="{$contentTemplate} == 'BLOG_TEMPLATE_NAME'">
        Forum Name - Blog
    <xen:else />
        Current Text Logo
    </xen:if>
    Just change BLOG_TEMPLATE_NAME with whatever the name of the template is that you edited before :)
     
    Steve F and pjfry like this.
  8. pjfry

    pjfry Active Member

    Great! Thanks for your help, everything works just fine now :)
     
    Chris D likes this.

Share This Page