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

XF 1.3 Can I create a template to call/insert code into PAGE_CONTAINTER?

sforum

Active member
#1
Despite setting a value for Facebook Open Graph Logo (and testing it so that I know the path is correct), which works for Facebook sharing, it doesn't seem to work as an "Apple Touch Icon" when I add the forum to my iPad home screen.

So I thought I might as well do it "properly", and create the icons and insert the code myself.

I have everything good to go, and all I need to do now is add the following to (I presume) PAGE_CONTAINER:

PHP:
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
<link rel="icon" type="image/png" href="/favicon-196x196.png" sizes="196x196">
<link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<meta name="msapplication-TileColor" content="#2d89ef">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
I was wondering, shall I just bung this code in manually in the PAGE_CONTAINER for all of my styles, or is there a better/neater way of doing it? For example, can I create a Template or something, and reference it within PAGE_CONTAINER somehow? That way, if ever I need to make any changes, I can just edit the template that is called, rather than having to edit the PAGE_CONTAINER code directly.

I should point out, I am not a coder and need things spelled out for me, so if there is a way to do this I would really appreciate an idiot's guide!

Thanks. :)
 

Steve F

Well-known member
#2
So you have multiple styles? Did you upload the logo-og to all your style directories, under style/xenforo/ ?

I don't have any issues on any of my devices adding them as a bookmark or to the home screen.

But to answer your question, you can create a template modification in the ACP so it is applied to all styles.
 

sforum

Active member
#3
So you have multiple styles? Did you upload the logo-og to all your style directories, under style/xenforo/ ?

I don't have any issues on any of my devices adding them as a bookmark or to the home screen.
Yep. I'll double check everything again just in case, but I'm pretty sure it's all kosher. Besides, I've got all the icons and stuff good to go now, so I figure it's a good learning exercise. :)

But to answer your question, you can create a template modification in the ACP so it is applied to all styles.
I don't have that option. :confused: I can create new Templates, but there is no "New..." option under Template Modifications.
 

Steve F

Well-known member
#5
Oh by the way, Facebook sharing icon can take a long time to update on their end.

Look in the PAGE_CONTAINER template for "apple-touch-icon" and you will see the link is there to the correct logo-og.
 

sforum

Active member
#6
You must have debug mode enabled in your config.php.
I've never even heard of this mystical "debug mode". Sounds like the sort of thing that a luddite like me could easily do irreparable damage with :eek: lol

Fortunately, I found in another thread that one can create a new template by manually navigating to admin.php?template-modifications/add. I've just created my first Template Mod and, amazingly, it seems to have worked!

Thanks, @Steve F (y)