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

Text in the middle of the footer

Discussion in 'Styling and Customization Questions' started by Matthew2D, May 21, 2012.

  1. Matthew2D

    Matthew2D Active Member

    How do I put text in the middle of the footer? I've tried and can't get it right.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> ad_below_bottom_breadcrumb

    Add this code:

    <div style="text-align: center;">
    The result:

    Screen shot 2012-05-20 at 11.59.03 PM.png
    Matthew2D likes this.
  3. Matthew2D

    Matthew2D Active Member

    Well, I actually wanted it inside the footer, I'll use this in the footer template. Thanks!

    EDIT: Didn't work.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  5. Matthew2D

    Matthew2D Active Member

    Inside the footer inself, but in the center.
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Like where the debug information is in my previous screenshot? (Timing, Memory, DB Queries)
  7. Matthew2D

    Matthew2D Active Member

    No. Inside the actual footer itself!

    Attached Files:

  8. Chris D

    Chris D XenForo Developer Staff Member

    Something like this. Add the code in red to the Footer template.

    <dl class="choosers">
    <xen:if is="{$canChangeStyle}">
    <dt>{xen:phrase style}</dt>
    <dd><a href="{xen:link 'misc/style', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger Tooltip" title="{xen:phrase style_chooser}" rel="nofollow">{$visitorStyle.title}</a></dd>
    <xen:if is="{$canChangeLanguage}">
    <dt>{xen:phrase language}</dt>
    <dd><a href="{xen:link 'misc/language', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger Tooltip" title="{xen:phrase language_chooser}" rel="nofollow">{$visitorLanguage.title}</a></dd>
    <ul style=" position: absolute; padding-left: 45%; width: 10%;"> <a href="http://xenforo.com">XenForo.com</a> </ul>
    <ul class="footerLinks">
    <xen:hook name="footer_links">
    <xen:if is="{$xenOptions.contactUrl.type} === 'default'">
    <li><a href="{xen:link 'misc/contact'}" class="OverlayTrigger" data-overlayOptions="{&quot;fixed&quot;:false}">{xen:phrase contact_us}</a></li>
    <xen:elseif is="{$xenOptions.contactUrl.type} === 'custom'" />
    <li><a href="{$xenOptions.contactUrl.custom}" {xen:if {$xenOptions.contactUrl.overlay}, 'class="OverlayTrigger" data-overlayOptions="{&quot;fixed&quot;:false}"'}>{xen:phrase contact_us}</a></li>
    <xen:if is="{$homeLink}"><li><a href="{$homeLink}">{xen:phrase home}</a></li></xen:if>
    <li><a href="{$requestPaths.requestUri}#navigation">{xen:phrase go_to_top}</a></li>
    <li><a href="{xen:link forums/-/index.rss}" rel="alternate" class="globalFeed" target="_blank"
    title="{xen:phrase rss_feed_for_x, 'title={$xenOptions.boardTitle}'}">{xen:phrase rss}</a></li>

    rafass, Andrej and Jake Bunce like this.
  9. Andrej

    Andrej Well-Known Member

    Good place to put your own copyright in. :p
    Matthew2D likes this.
  10. Matthew2D

    Matthew2D Active Member

    That's what I want. :D
  11. Chris D

    Chris D XenForo Developer Staff Member

    There may have been a better way of doing it, but I know centering stuff is generally a pain and I've used this method before and it works well.

    One point to note is the percentages, in case you haven't worked it out already.

    The width of the centred text div is set to 10%. To get that even on both sides you divide by two. Which is 5%. You then take 5% off 50% which is how you get to 45%.

    If you wanted a much wider div, say 40% then the left and right margins would be 30%.

    I'm sure you worked that out, but in case anyone else sees this and thinks, "what the..." at least that explains it.

Share This Page