Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support Meta tags
1 2 3 4
Makaya
Posted on 13 Jun 2010, 19:33:34

Access: Member
Total Posts: 16
Joined: 2010-06-13

Hi There,

First, I would like to thank the creator of this script. It saved me hours of hours of headache.
I've just implemented the script to my website: http://www.pawpal.ca/pawpaltimes.php

There is one thing that I dont know how to do. When I copy/paste the link of an article into a facebook page, I would like to have the title and picture to appear. It works using meta tags and I've done this for the rest of the website (a generic presentation with the logo). My problem is, for each article, I would like it to be specific (title of the article and picture contained in the article) and (hopefully) done automatically.

Could anyone help me on that?

Thanks,

Makaya
#2451
Chris
Posted on 13 Jun 2010, 19:38:51

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

When you copy and paste a link into facebook, I'm assuming it fetches the title of the page by grabbing the

Code:
<title>Pawpal - Because they matter !</title>


Then display that?

What you're trying to do is display the title of the news article in that section of the page as well?
#2452
Makaya
Posted on 13 Jun 2010, 19:43:44

Access: Member
Total Posts: 16
Joined: 2010-06-13

That's correct.

the <head> of my page looks like this:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Pawpal - Because they matter !</title>
<link rel="image_src" href="../images/Pawpal-logo-facebook.jpg" />
<meta name="title" content="Pawpal - Because they matter !" />
<meta name="description" content="Pawpal.ca- the only professional house-call dog grooming service provider in Downtown Vancouver, operating 7 days a week. To book your home-grooming appointment, e-mail us at contact@pawpal.ca." />

What I'm trying to do is to replace the "title", "description" and "image_src" with what is on my article. I don't know how/where to get that from the article.
#2453
Chris
Posted on 13 Jun 2010, 19:53:16

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

The title and description is doable but unfortunately there is no way of extracting an image from the news article.

To do the title/description you need to make a new template. Create a new template and name it "title", edit the News section and delete everything inside that box and replace it with this code

Code:
<meta name="title" content="Pawpal - {title}" />
<meta name="description" content="Pawpal - {shortstory}" />


Then on your index page where you want the title to display add this code

Code:

<head>
....
<?php
if(!$_GET['id']){
    
// not viewing a full article so display your normal title
    
echo '<meta name="title" content="Pawpal - Because they matter !" />';
    echo 
'<meta name="description" content="Pawpal.ca- the only professional house-call dog grooming service provider in Downtown Vancouver, operating 7 days a week. To book your home-grooming appointment, e-mail us at contact@pawpal.ca." />';
}else{
    
// Viewing a full article so display the title of that article + description meta tags
    
$template = 'title';
    include 
'news/index.php';
}
?>


This should only display the title + description of an article when viewing a full article.
#2454
Last edited by Chris at 2010-06-13 19:53:43 Reason:
Makaya
Posted on 13 Jun 2010, 20:14:23

Access: Member
Total Posts: 16
Joined: 2010-06-13

Hi Chris,

Thanks a lot for your help. The solution you gave me works well to provide the information I want on facebook. However, the layout of the article page is messed up now.
http://www.pawpal.ca/pawpaltimes.php?id=2

Any idea how to fix it?

Makaya
#2455
Chris
Posted on 13 Jun 2010, 20:14:44

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Oops I forgot to mention, edit the Comments Structure section of the title template as well, delete everything the {news} tag.
#2456
Makaya
Posted on 13 Jun 2010, 20:18:27

Access: Member
Total Posts: 16
Joined: 2010-06-13

Just to confirm, I delete the entire "Comments Structure":
{news}
{comments}
{commentspagintation}
{commentsform}

Is that correct?
#2458
Chris
Posted on 13 Jun 2010, 20:18:53

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Correct, the only tag you need is the {news} tag.
#2459
Chris
Posted on 13 Jun 2010, 20:21:37

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Options > System > Other > Show 'Powered by' below your news: No

May want to change that also to stop that "Powered by" line appearing.
#2460
Makaya
Posted on 13 Jun 2010, 20:22:25

Access: Member
Total Posts: 16
Joined: 2010-06-13

One last thing:

There is still "Powered by N-13 News" at the top of the page. I don't mean I don't want to publicize your fantastic work, but I'd rather keep that mention at the bottom of the page where it already is :)
#2461
1 2 3 4
Network-13.com © 2013