What is the difference between link and rich type in oEmbed? - oembed

I would like to add embed info to my site using oEmbed tag. I am confused between link type and rich type on which context I should use both.
Here is the oEmbed documentation link which doesn't make me clear.
Any advice in this regard is much appreciated ! Thanks in advance :-)

Link type can be used when you wish to provide generic meta data about the url title, author_name etc... without providing html content or url associated with the requested url
Rich type can be used when you would like to provide html content (which could be embedded within external sites) along with width and height of the iframe.

Related

Canonical URL formatting issue causes Facebook to interpret mobile URL as a different URL

I need to format this canonical URL and I cant figure out how! I've looked around the web and this site a lot and I've realized that I need a specific answer.
Problem Description:
My BLOG's desktop view has (say) URL: www.x.com/page.html
The same page in mobile view URL would be: www.x.com/page.html?m=1
Its all good and dandy to this point, but the problem comes when I use facebook comments with this. It parses url based on this: www.x.com/page.html
So, it is identifying ?m=1 in the end of the first URL as an entirely different URL.
i.e
It is treating those two URL as different
Both of them are URL for the same page and I want them to be treated the same
Could anyone provide me a way to check if the loading page is ?m=1 and if it is ?m=1 then remove the ?m=1 when sending it to facebook?
I WOULD GREATLY APPRECIATE IT IF THE SOLUTION IS INLINE if it is not inline, oh well, I just need a solution right now.
Current code snippet used is this:
<fb:comments colorscheme='light' expr:href='data:post.url' expr:title='data:post.title' expr:xid='data:post.id' height='110' width='560'/>
Let me break the question into small parts(incase someone is not a native speaker and wants to help/learn about this problem)
I want to detect if the loading page has ?m=1 in its URL or not. The canonical URL for this is data:post.url applied as
expr:href='data:post.url'
If a ?m=1 is detected from data:post.URL , I want to remove it and send the remaining URL into expr:href= so that both my URLs
are identified the same when my website displays facebook comments.
Click the image link below to look at this image please. This is the same URL but the
comments are being sent to me as if they're from different URLs. I
want them to appear under the same thread.
This is it--> http://i.stack.imgur.com/M7fK2.png
I haven't found this particular answer anywhere and I am hopeful that
some creative solutions will pop out in this site!
In your code
<fb:comments colorscheme='light' expr:href='data:post.url' expr:title='data:post.title' expr:xid='data:post.id' height='110' width='560'/>
Use data:post.canonicalUrl instead of data:post.url
This is the Blogger's layout tag for getting the Canonical URL of a blog post (This will always default to the blogspot.com domain, so there won't be ccTLD issues as well)

Obtain the JournalArticle URL

I need to send by email the link of the contents in a custom Portlet in Liferay.
How can I obtain the URL for every content my portlet shows?
It possible to make it in the view or have to be an Action to create the URL?
Thanks in advance
"The link of content" does not really map to Liferay concepts: You have content and that content can be displayed on any number of pages. You can either try to find one page where the content is displayed, or (for Web Content) use the "Content Display Page" which chooses a particular page as the context for this article.
If you are using a custom ADT, you might want to add it to your question, so that we know what you're talking about. If it's too long, feel free to simplify it.

Is is possible to share elements or parts of a page on social media sites?

I'm hoping this is a pretty simple question to answer. I have a page with 6 recipes on it. I'm being asked to include share buttons for each recipe and they want the shares on FB or Twitter to be formatted to use a specific image and text for each recipe. This is something we would normally handle via Open Graph metatags and the like, but that only works at the page-level.
You must use a separate URL/page for each Like/Share. But you can redirect to the main page, or just use a GET parameter. For example, each Like/Share Button can use the following URL: http://www.yourdomain.com/yourrecipepage.php?recipeid=x
The "x" being dynamic, of course. Now you can check the recipeid parameter and use different OG tags. the rest of the page will be the same. I hope you understand what i mean :)

the interface to make the content of the web page viewable in all types of browsers?

I am going to take Microsoft 70-486 (MVC) exam. So i am preparing for it. Came across one most important question asking in 70-486 exam but the answer is different across web, Please help to choose the correct answer.
Question
You are designing an HTML5 website. You need to design the interface to make the content of the web page viewable in all types of browsers, including voice recognition software, screen readers, and reading pens. What should you do?
Annotate HTML5 content elements with Accessible Rich Internet
Application (ARIA) attributes.
Convert HTML5 forms to XForms.
Ensure that HTML5 content elements
have valid and descriptive names.
Use HTML5 semantic markup elements
to enhance the pages.
Use Resource Description Framework (RDF) to
describe content elements throughout the entire page.
In some website it is mentioned as AD is correct answer check this enter link description here and others mentioned ABCD is correct answer check this enter link description here. I am confused between this 2 ans.
I would say that the correct answers are :
Annotate HTML5 content elements with Accessible Rich Internet Application (ARIA) attributes : It is the primary role of the aria attributes !
Use HTML5 semantic markup elements to enhance the pages : To help the screen readers to know that an element is a nav, an article...
Ensure that HTML5 content elements have valid and descriptive names : i.e. to help the screen readers to know that an input is the "FirstName", and not just a "Text input", a better approach is to use a label for the inputs, but after reading this article, it seems that only few screen readers manage the label element.
I'm gonna correct Djoul6's answer a bit.
Ensure that HTML5 content elements have valid and descriptive names.
This is not a correct answer. the name attribute can be whatever, screen readers do not read the name attribute out loud. From the source Djoul6 refered to there was this description. http://www.w3.org/TR/UNDERSTANDING-WCAG20/ensure-compat-rsv.html#namedef
name
text by which software can identify a component within Web
content to the user
Note 1: The name may be hidden and only exposed by
assistive technology, whereas a label is presented to all users. In
many (but not all) cases, the label and the name are the same.
Note 2: This is unrelated to the name attribute in HTML.
The correct answer should be
Annotate HTML5 content elements with Accessible Rich Internet Application (ARIA) attributes.
Use HTML5 semantic markup elements to enhance the pages.
So, correct answers:
Annotate HTML5 content elements with Accessible Rich Internet
Application (ARIA) attributes.
Use Resource Description Framework (RDF) to describe content elements
throughout the entire page.
Please note that the correct answer should be a complete solution for Accessible web application. HTML5 semantic markup cannot be complete solution, this only enhance the pages, also XForms cannot, and even not valid and descriptive names..
I think no question about ARIA attributes, but you can read about RDF - https://www.w3.org/TR/wai-aria/roles
For futher investigation please reffer W3C WAI-ARIA.
My understanding of HTML5 is that its semantic markup is meant to make it readable across browsers and readers. That would point to the 4th answer.

Is there a way I can include the current webpage url?

I have a webpage that I want people to fill information out on and then a response emailed to me with that information. Is there a way that I can include the url in the email from that page using html?
I have no clue how to start this. I saw a similar question here: Get current webpage URL
but I don't understand how to turn the src: url to the one of the page I am currently on. It seems like I should be able to reference it, but I am unsure how.
Thanks
This is not possible with straight html. You can use Javascript to change the src attribute:
document.getElementById("myElement").setAttribute("src", window.location.href);
In this example, it's assumed that you are attempting to change the src attribute of an element with the id "myElement".
See this question. To get the webpage URL with JavaScript, you can use document.URL. You can then use it for what you want.

Resources