I got this from the customer:
Metadata are actually contained in the docuemnt in legible form. Metadata include
Title(it is in the cover page and on page 1)
Language(language in which the document is written)
EDITION OF THE PUBLICATION(it is on page i, History section)
Keywords(they are on page i. Do not add any keywords if there is no list on page i)
I covered the first 2 requirements but there's no way I could find out where to put that Edition of the Publication within content.opf document. What is the metadata tag where I should put that Edition of the Publication?
Here is how the Edition(listed or not listed) looks like:
I also have pdf files with the Edition not listed:
Thanks in advance :)
Metadata differs somewhat between EPUB 2.0 and 3.0, so I'm not entirely sure if you'll be able to do this with that example. That said, here's how it can be done with EPUB 3.0 files:
<dc:title id="t1">Main Title</dc:title>
<meta refines="#t1" property="title-type">main</meta>
<meta refines="#t1" property="display-seq">1</meta>
<dc:title id="t2">Subtitle</dc:title>
<meta refines="#t2" property="title-type">subtitle</meta>
<meta refines="#t2" property="display-seq">2</meta>
<dc:title id="t3">Second Edition</dc:title>
<meta refines="#t3" property="title-type">edition</meta>
<meta refines="#t3" property="display-seq">3</meta>
<dc:title id="t4">Main Title: Subtitle. Second Edition.</dc:title>
<meta refines="#t4" property="title-type">expanded</meta>
<meta refines="#t4" property="display-seq">4</meta>
Related
I have a specific page in my application where I want a user to be able to share certain selections they have made on a previous page, selection which I am receiving from my database.
So, for example - I have a user - Barry. I can access his name using ${user}.
He have been asked a question:
What is the first thing that comes to your mind when I ask about ${animals}
The answers they have chosen have been submitted to the DB, and I now want the answers to appear as the sharing description for Facebook. Obviously, the answer for each user will be unique - so I cannot hard code any information in here.
The code I have is the following:
<meta property="og:description" content="${user} thinks:%0A%0A<c:forEach var='animal' items='${animals}' >${animal} - ${animal.thoughts}%0A</c:forEach> />
When I view the source code for the page, I see this:
<meta property="og:description" content="Barry thinks:%0A%0AElephant - Gray%0ABird - Chirpy%0AMonkey - Funny%0ADog - Loyal />
However, when attempting to share the content on Facebook, the description is just empty, as though no description exists.
Unfortunately, this page is only available when the user is logged in, so using the Facebook scraper https://developers.facebook.com/tools/debug/ simply shows me the og data of the logged out landing page.
Am I missing something here?
EDIT
Based on #Cbroe's comments below, I have now adapted the code to be shared on a public page (IE one that you do not need to be logged in to see).
I have also set the description and image location as parameters in the URL - so that anybody who shares this page will see a description and an image relevant to them.
When running the full URL through Facebook scraper, I see the exact results I am after:
However, when actually sharing the link from the application, the dynamic info from the URL is being ignored.
<meta property="og:description" content="${param.description}" />
<meta property="og:image" content="${param.image}" />
My og:url contains the full URL, including the dynamic parameters. If anyone else has any ideas, I would love to hear them.
EDIT 2
Link that helped CBroe debug has been removed due to company policy. Example link provided in my answer.
With massive thanks for #CBroe for baring with me through this process and helping me out in the comments, I have now got a solution to this problem.
Firstly, I created a client facing page that did not require the user to be logged in in order to view. This would act as the page that the dynamic content would be shared from.
The code that I have now looks something like this:
Meta tags
<meta property="og:title" content="My Title" />
<meta property="og:url" content="${pageUrl}" /> // generates FULL URL including all parameters
<meta property="og:description" content="${param.description}" />
<meta property="og:image" content="${param.image}" />
Sharing generator (using jQuery)
var currentLink = encodeURIComponent(window.location.href); // NB to use encodeURIComponent instead of just encodeURI
var tWindow;
$('.facebookShare').on('touchstart click', function(){
tWindow = window.open('about:blank', 'sharer', 'toolbar=0,status=0,width=548,height=325');
tWindow.location.href = 'https://www.facebook.com/dialog/share?app_id=${facebookAppId}&display=popup&href=' + currentLink;
});
The link that was then used to share the page looked something like this:
https://[myURL]?description=My%20favourite%20animals:%20Elephant%20-%20gray%20%7C%20Dog%20-%20Cute%20%7C%20Cat%20-%20Cant%20be%20trusted%20%7C%20Leopard%20-%20Never%20changes%20its%20spots&image=[url_to_my_image]
Using this code, when sharing the page, the correct (and dynamic) image and description were generated each time.
Once again, big ups to #CBroe for helping me get to the bottom of this - and I hope that this can help somebody else in the future.
I'm using MODX Revolution 2.5.7 version for my site.
But unable to update the Meta tags. I searched a YouTube video & follow their given steps But still no success.
I have attached below 2 snaps..
1st for updating the Meta tags & second is published page after saving the metas.
Picture of Dashboard while updating the Meta tags:
Picture after updating the Meta Tags:
It seems as you have confused template tags in your html. It should be
<meta name="description" content="[[*description]]"/>
And you are likely to have:
<meta name="description" content="[[*longtitle]]"/>
that's why you see long title where description should go.
it looks to me like your cache needs to be cleared. (both browser & modx) - if you are using a CDN (i.e. cloudflare) or other caching service - clear that too.
your tags should look like:
<meta name="description" content="[[*description]]"/>
<meta name="keywords" content="[[*introtext]]"/>
...for the setup you are using.
You could also setup a template variable for the keywords (or any other meta information) and out put it like this:
<meta name="keywords" content="[[*keywords]]"/>
(assuming you named the variable "keywords")
There are also quite a few SEO/Meta extras available for modx ~ just search the extras directory.
og:see_also Array An array of URLs of related resources
How to use this, I mean how should the array look like?
og:see_also - Used to supply an additional link that shows related content to the object.
The Markup will look like this,
<meta property="og:see_also" content="http://www.website.com"/>
If a tag can have multiple values, just put multiple versions of the same tag on your page. The first tag (from top to bottom) is given preference during conflicts.
<meta property="og:see_also" content="http://example.com/page1" />
<meta property="og:see_also" content="http://example.com/page2" />
Checkout this Open Graph Portal
When the user click "Recommend" button on my page, I'd like to post on his wall title and part of the article from my page. How can I change the information which is send to the user wall/timeline? I've found a tip that I should add open graph meta tags, but when I set og:title and og:description in META:
<meta content="Title" property="og:title">
<meta content="Description" property="og:description">
nothing change.
Any other ideas? Or maybe I do sth wrong?
[Edited]
My code:
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# website: http://ogp.me/ns/website#">
<meta content="Test1" property="og:title">
<meta content="website" property="og:type">
<meta content="*Link to my web page*" property="og:url">
<meta content="*Link to my image*" property="og:image">
<meta content="Description" property="og:description">
<title>Page Title</title>
[...]
</head>
In the Object Debugger I get such messages:
Warnings That Should 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:locale property should be explicitly
provided, even if a value can be inferred from other tags.
Open Graph Object Properties
og:url: Link to my web page
og:type: website
og:title: Page Title
og:updated_time: 1319793567
Raw Open Graph Document Information
Canonical URL: Link to my web page
So it seems that the debugger gets only info from my page (e.g. <title>), not from Open Graph tags.
What I do wrong?
Probably I've found the reason of my problem - I render my page using JavaScript and then I set my META. Is there any way to set META (dynamically) visible for FB?
Did you run your page through the debug tool at http://developers.facebook.com/tools/debug ?
The debug tool clears Facebook's cache of your page as well as checking the syntax of your meta tags.
There are more tags required than the two you listed there
No, you can't dynamically create meta-tags. You need your server to render those meta-tags correctly when facebook decides to probe it (usually soon after a share/like/recommend operation).
EDIT : To make it clear -
There is no way to control the rendering of meta tags from the client.
If you want different URLs of your app to have different og:title, og:image etc.. you have to make sure your SERVER serves the html with the right meta tags for each URL.
Either put all the info you want in the URL in the first place, for example http://example.com/?title=shalom+world&image=shalom.png and then when you serve the page, parse the URL and render the meta-tags correctly OR..
Have some ID in the URL according to which you will go fetch a corresponding db record and render the head tag of the html you serve with info from that record as meta tags, for example: http://example.com/DB-RECORD-ID-X123
I have used a free template and used it as a master page in the visual web developer.
Each time I close the master page file and reopen it it will ask me for the encoding of the web page. The title is "Choose an encoding", and body is "Visual web developer was unable to determine the encoding of this file. Please choose an encoding from the list box below".
How can I fix this? How can I save the file with UTF-8 encoding from the beginning.
Try putting a tag like this inside the <head> element:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
That's how you identify the encoding to browsers. Not sure about the editor you're using.