Sitemap in Django - Titles don't show in google search - django

I have followed the steps in the documentation and it seems to be working as expected.
I have got an automated sitemap generated: https://duelify.com/sitemap.xml
Yet somehow there is no way to specify the title.
If I search in google for my site: site:duelify.com and scroll down I see the main site's title for every link:
Duelify | Duel Your Friends & Foes
https://duelify.com/topics/discuss/2/vegetarian-diet/
That doesn't look right.
If I try this with Stackoverflow:
site:stackoverflow.com django
Each entry has a proper title.
How could I achieve that? It is not clear from the given site map references.

The title displayed in Google search results has nothing to do with the sitemap.
Use meta (http://www.w3schools.com/tags/tag_meta.asp) and title tags:
<head>
<meta name="description" content="Your page description">
<title>Your page title</title>
</head>
And don't forget to set proper HTML heading tags.

Related

Adding custom meta tags for every different page in Joomla

I use Joomla 2.5. I want to set a meta tag property named "com.silverpop.pagename" for each page (article) in my website. For example, my homepage will have:
<meta name="com.silverpop.pagename" content="Home Page" />
My blog will have:
<meta name="com.silverpop.pagename" content="Blog" />
How do I do that?
I was suffering with the same problem when I had to add Facebook Open graph META Tags on my Joomla project.
<meta property="og:type" content="article"/>;
I had included this code on my Joomla template and it worked for me, please have a look:
# add Facebook tags
$doc = JFactory::getDocument();
$doc->addCustomTag("<meta property='og:type' content='article'/>");
Also you can refer this Link.
Hope it will help others.
You need to modify the header. This can be done editing
JOOMLA_ROOT\libraries\joomla\document\html\renderer\head.php
Here you can change the behaviour of header

Passing url to django to be used as variable?

So when I'm trying to pass url to django views it cuts it. For example, I have a webpage which shows statistics of downloads for users sorted by download amount. Then I want to get details about some user, for example for "Yousuke Kataoka". I press the link and go to user page. Url should be and is mysite.com/user/Yousuke Kataoka, but in the webpage I see "Details for Yousuke", it kinda cuts the url. So of course I can't get any details, because the username is cut.
Here is part of urls.py:
(r'^user/(?P<username>[*_a-zA-Z0-9./-=]+)', 'dq2.web.usermon.views.user')
And here is user.html template:
<html>
<head>
<title>Detailed information for {{usr}}</title>
<script src="/dq2/media/js/sorttable.js"></script>
</head>
<body>
<p>Detailed information for {{usr}}</p>
<table width="30%">
<tr><td>File Downloads (1HR)</td><td align="right">{{file_events_1h}}</td></tr>
<tr><td>File Downloads (24HR)</td><td align="right">{{file_events}}</td></tr>
<tr><td>File Downloads (7D)</td><td align="right">{{file_events_7d}}</td></tr>
<tr><td>File Downloads (30D)</td><td align="right">{{file_events_30d}}</td></tr>
<tr><td>Operations (1HR)</td><td align="right">{{op_events_1h}}</td></tr>
<tr><td>Operations (24HR)</td><td align="right">{{op_events}}</td></tr>
<tr><td>Operations (7D)</td><td align="right">{{op_events_7d}}</td></tr>
<tr><td>Operations (30D)</td><td align="right">{{op_events_30d}}</td></tr>
</table>
And so on..
What should I do?
Try adding a space in your regex. And are you sure you meant to have /-= in there?

facebook like-button for blog's header & facebook share-buttons for each post

I've got the blog (http://loveclubhouse.blogspot.com/).
(1)
I added one like-button on top of my blog. This is global like-button for the whole blog. It's available from every page of my blog, so that users may express their attitude to the blog in general (doesn't matter which post of the blog they read at the moment).
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Floveclubhouse.blogspot.com%2F&action=like&...></iframe>
I use facebook's Open Graph. So, when the user clicks on this like-button the story is created on his facebook's wall with the title, description, and preview-image that was previously defined in the Open Graph's Meta tags of my blog.
<meta content='DJ Club Mixes 2012' property='og:title'/>
<meta content='blog' property='og:type'/>
<meta content='http://loveclubhouse.blogspot.com/' property='og:url'/>
<meta content='Blog's cover image URL' property='og:image'/>
<meta content='Blog's description' property='og:description'/>
(2)
In addition to the global like-button I have also added standard "addthis" share-buttons for every post of my blog (let's say the user wants to share on his wall a certain post from my blog).
<div class='addthis_toolbox addthis_default_style' expr:addthis:title='data:post.title' expr:addthis:url='data:post.url'>
<a class='addthis_button_facebook'/>
...
</div>
<script type='text/javascript'>
var addthis_config = {ui_click:true, data_track_clickback:true};
</script>
<script src='http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4d68d12853670207' type='text/javascript'/>
However, when the user clicks on share-button for post, the facebook generates the story on his wall with the same preview-image and title that was set up for the whole blog.
The question is:
How to combine (1) and (2), so that the user may like my blog in general and the user may share specific posts on his wall with the title and preview-image for this particular post?
It's all about the OG tags on your page. When a user visits a different page in your blog, you need to be sure that the og:title and og:description (and og:image if you want) are updated to reflect the current article of your blog.

Image Problems when Adding a Facebook "Like" Button to an external page

I am trying to add the Facebook “Like” or “Recommend” button to the bottom of some of the content pages on our website, so that when someone clicks it, it is immediately posted on their FB wall - spreading the word about the page etc.
I found this code to do it:
<div id="fb-root"> </div>
<script src="http://connect.facebook.net/en_US/all.js#appId=174289559298553&xfbml=1"></script>
<p><fb:like send="true" show_faces="true" action="recommend" font="arial" href="http://amathus.staging.screenpages.net/moillardproducerpage" width="450"></fb:like></p>
But when I put it on the page and test it by "liking/ recommending" it, when it feeds through to my facebook the image picked up to represent the page with the link is not good at all.
I then tried putting meta tags in the coding so that it picked up the right image, like this:
<meta property="og:title" content="Domaine Moillard" />
<meta property="og:type" content="drink" />
<meta property="og:url" content="http://amathus.staging.screenpages.net/moillardproducerpage" />
<meta property="og:image" content="http://www.amathusdrinks.com/skin/frontend/default/default/Agro-de-Bazanc.jpg" />
<meta property="og:site_name" content="Amathus Drinks" />
<meta property="fb:admins" content="61406146" />
But again the only images it picked up on were the small payment logo at the bottom (sagepay logo - not ideal!).
Anyone know how I can get it to show a relevant image next to the link when someone likes the page?
Thanks,
Clare
I tried running http://amathus.staging.screenpages.net/moillardproducerpage thru the linter tool (https://developers.facebook.com/tools/debug) and nothing came up. Is this the correct URL?
From the image url you gave above, I see it's from http://www.amathusdrinks.com/, so I ran http://www.amathusdrinks.com/moillardproducerpage thru the linter tool as well. Got some results, but it has some issues to be fixed:
Inferred Property: The og:url property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property: The og:title property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property: The og:image property should be explicitly provided, even if a value can be inferred from other tags.
I'd say, fix the og: tags on that page, and you'll be back in business :)

Does the Javascript SDK version of the Facebook Like button w/ comments work on IE?

There are lots of questions about how to get a Facebook Like button working, but I would like to know: does anyone know of an example of the Facebook Like button, coded in XFBML and Javascript, where clicking on it makes the comments box show up, in Internet Explorer? Specifically, I'm trying to figure out if this behavior is broken on IE. I know that particular behavior works under Firefox and Safari.
I see examples of the iframe version of the Like button that pops the comments box in IE when you click "Like". But that's the iframe version, not the xfbml / javascript version. Also, (weirdly enough) the iframe version of the Like button doesn't display the comments box if you don't have show_faces turned on.
The Levi's site is sort of the gold standard in Like usage. Check out http://us.levi.com/family/index.jsp?categoryId=4305605&cp=3146842.3146844.3146854 -- the Like button with comments works in Firefox and Safari, but not IE.
There are lots of different moving pieces here to track down -- for example, namespaces, app_ids, xhtml doctype, etc, etc. But before I get that far, I'm just wondering if the javascript / FBML version of the Like button with comments ever works under IE? And if does, is there an example somewhere? I have never seen one.
Thanks!
Yes, I have this working in IE on http://www.WasupPalmSprings.com. If you click on any of the stories from the home page, there is a like button at the bottom that shows the comments box in IE.
I have had issues with the comment box not showing in IE on other sites. Here is the checklist I use:
Make sure you have the right xmlns attrs in the HTML tag on your page.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http:// www.facebook.com/2008/fbml" xmlns:og="http:// opengraphprotocol.org/schema/">
Make sure you have <div id="fb-root"></div> somewhere on your page.
Make sure you have set up an app for your webpage because you need an app id. If you don't have an app, create one here: http:// www.facebook.com/developers/
Use javascript to load the Facebook connect javascript file. Do not just drop a <script src="..."> tag on the page. If you use jquery or similar, ideally this would go in the onReady handler. Otherwise, put it in <script> tag at bottom of the page.
Be sure to substitute your actual app id from the Facebook app you create where it says 'INSERT YOUR APP ID HERE'
window.fbAsyncInit = function() {
FB.init({appId: 'INSERT YOUR APP ID HERE', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
Add meta tags with open graph information for your page.
<meta property="og:title" content="YOUR PAGE TITLE HERE"/>
<meta property="og:site_name" content="YOUR WEBSITE NAME HERE"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="URL OF PAGE HERE"/>
<meta property="og:image" content="URL OF IMAGE YOU WANT TO SHARE"/>
<meta property="og:description" content="YOUR PAGE DESCRIPTION HERE"/>
<meta property="fb:app_id" content="YOUR FB APP ID HERE"/>
Finally add the like button wherever you want it to appear on the page. Be sure to substitute your own page URL.
<fb:like href="INSERT YOUR PAGE URL HERE" layout="button_count" show_faces="false" width="570" font="arial"></fb:like>