How to add the info-clicky structured snippet to html website? (For Google Search Results) - html

I recently noticed a new addition to Google Snippets for Structured Data search results on Google. Although I've added quite some snippets to this website, but I don't know how to enable this snippet. I'm thinking it'll either be via website or organization schema.org for the snippet to appear in the search results.
Example from Google's Developers Page:
Here's some excerpt code from the pages I need this info clicky to appear in search results, but I don't know how or what to modify or append to the pages. Also would application/ld+json script be functional for this purpose? Or is it advisable to add HTML code only?
<!-- LOGO -->
<div class="w-logo" itemscope itemtype="http://schema.org/Organization">
<div class="w-logo-h">
<a class="w-logo-link" itemprop="url" href="index.html">
<img class="w-logo-img" src="img/logo.png" alt="Company Name">
<span class="w-logo-title">
<span class="w-logo-title-h" itemprop="name">Company Name</span>
</span>
</a>
</div>
</div>

Related

Stop CKEditor 4 from adding additional HTML tags

I have a problem with CKEditor 4 adding additional HTML tags. I've been using v3 for a few years without any problems, and I've built my own plug-ins, so I'm not a complete novice but this has me stumped. For instance the following block of HTML:
<section class="component2">
<div class="">
<div class="component2__row">
<a class="component2__item component2__item--primary" href="#">
<img class="component2__item__image" src="http://MyServer/webmedia/Images/Components/component2/image-1.jpg" alt="IMG"/>
<h4 class="component2__item__title">Light Vehicle</h4>
</a>
</div>
</div>
</section>
Gets saved as:
<section class="component2">
<div>
<div class="component2__row">
<a class="component2__item component2__item--primary" href="#">
<img alt="IMG" class="component2__item__image" src="http://MyServer/webmedia/Images/Components/component2/image-1.jpg" />
</a>
<h4 class="component2__item__title">
<a class="component2__item component2__item--primary" href="#">Light Vehicle</a>
</h4>
<a class="component2__item component2__item--primary" href="#"> </a>
</div>
</div>
</section>
Any ideas? (Note for example the additional anchor tags!) Is there something in the HTML
it doesn't like? Is there a setting in config.js that I can use?
Thanks
If someone else stumbles across this I worked round it. As it was already my default (from v3) I'd already tried:
config.allowedContent = true;
I went through the documentation in detail, and even tried editing the dtd to allow headers to be in divs and anchors:
CKEDITOR.dtd['div']['h'] = 1;
CKEDITOR.dtd['a']['h'] = 1;
All to no avail. Eventually I gave up and replaced the <h4> tag in my sample with a <span> and styled it accordingly. That worked and CKEDITOR now leaves my source HTML untouched. Irritating that there isn't a feature whereby you can tell the Editor "Look, I know my HTML is valid, leave it alone and I'll deal with any consequences."

ng-bind-html change the html structure, why?

I get HTML code from the backend via $http of AngularJS, and log the code retrieved and is OK, but to see it in the browser, the html structure changed.
This is the code that I get:
<a href=" http://www.google.com" target="_blank">
<figure>
<img class="img-responsive" src="/sites/Satellite;jsessionid=pk_tbxorbyJ4KrsWxo1jaVBFYvQPx1VovEs2GpjWziIk6cFaL50_!650994948?blobcol=urldata&blobkey=id&blobtable=MungoBlobs&blobwhere=1462843196206&ssbinary=true" />
</figure>
<p> Some text</p>
</a>
and this is what the browser displays:
<a href=" http://www.google.com" target="_blank">
</a>
<figure>
<img class="img-responsive" src="/sites/Satellite;jsessionid=pk_tbxorbyJ4KrsWxo1jaVBFYvQPx1VovEs2GpjWziIk6cFaL50_!650994948?blobcol=urldata&blobkey=id&blobtable=MungoBlobs&blobwhere=1462843196206&ssbinary=true">
</figure>
<p> some text</p>
Then I did the following test, log the code retrieved
$log.debug(vm.myHtml);
and then sanitize the code with
$log.debug($sce.getTrustedHtml(vm.myHtml))
and I get the same previous difference.
I was having the same problem and so played around with the Plunker available on the AngularJS docs.
I then modified it by placing some <h1> tags within <a> tags (see this plunker). The good news was that it worked in this most basic case. This had me scratching my head for ages.
In the end, I was just guessing that maybe the version of ngSanitize that I was using was maybe a little old and at some point they had slightly changed the way the tags were mapped, split and then rendered. I looked through the history but couldn't find anything. In the end, i updated to 1.5.7 the same as the version in the plunker. And smiling again :)

Showing websites full HTML code

I'm trying to parse a html code for specific content, but the problem I'm running into is that certain websites require you to click a "Show more" button.
When I grab the URL there's no way to tell it I want the full code with the "Show more" button clicked. Is there a way to grab the full source code of the page, because it keeps getting cut off after a point.
Example website: https://play.google.com/store/search?q=fm%20radio&c=apps&hl=en
The source code gets cut off at the "Radio hungary" app, which is the last app that loads automatically.
This even happens when I load everything and then try to view the pages source code.
It ends in:
style="display:none"> Show More </button> <div class="bottom-loading" style="display:none"></div> <div class="footer"> <div class="footer-links-container"> <span class="copyright"> ©2016 Google</span> <a class="footer-link id-no-nav" href="https://play.google.com/intl/en_us/about/play-terms.html" target="_blank"> Site Terms of Service</a> <a class="footer-link id-no-nav" href="http://www.google.com/intl/en_us/policies/privacy/" target="_blank"> Privacy Policy</a> <a class="footer-link id-no-nav" href="http://developer.android.com/index.html" target="_blank"> Developers</a> <a class="footer-link id-no-nav" href="https://play.google.com/artists" target="_blank"> Artists</a> <a class="footer-link id-no-nav" href="https://support.google.com/googleplay/?p=about_play" target="_blank"> About Google</a> </div> </div> </div></div><div class="loading" jscontroller="EgJAl" jsaction="rcuQ6b:rcuQ6b" id="page-load-indicator"></div><div id="instrument-manager-parent"></div><script src="https://wallet.google.com/inapp/lib/buy.js"></script><script
Even if I click the show more button.
The purpose of this is to grab all the URL's of the images, and I can't do this by hand because well.. we have thousands of images.
I believe if you just take advantage of the Javascript HTML DOM methods you can accomplish what you want to achieve.
This will help: http://www.w3schools.com/js/js_htmldom_methods.asp
By using this, you can target specific elements/ids/classes and pull or modify the information you want.
Jquery will also help you a lot with this.
You can solve it using Javascript dom,steps to do are
keep your content in a div element
set its default height as a fixed value
on clicking the show more link execute a javascript function to make the div element height to auto
in this way you can show content excerpt with javascript
If you go for server side, you can create a new page for showing the content.

JCE Editor 2.3.1 Changes HTML in Joomla 3.0

I am using the code view of JCE editor to add a link around some text. Adding a link through the link functionality gives the same results. When I add the link and save and come back to the code, it has completely reformatted it. Thanks for any help!
Here are the things I have already done:
Turned off global text filtering already.
Global parameters for the editor set validate HTML to off.
In user profile validate HTML is set to off.
Turned off all the parameters on the plugin parameters for the source code editor.
Here is the code I enter and how it becomes reformatted by JCE Edit:
<!-- BEFORE -->
<a class="inline" href="#inline_content">
<div class="smallTile">
<img src="/image.jpg" />
<h4 class="upper">Title</h4>
<p>
Paragraph
</p>
</div>
</a>
<!-- AFTER -->
<a class="inline" href="#inline_content"></a>
<div class="smallTile">
<a class="inline" href="#inline_content">
<img src="/image.jpg" />
<h4 class="upper">Title</h4>
</a>
<p>
<a class="inline" href="#inline_content"></a>
Paragraph
</p>
</div>

Linking tumblr photos directly to the source

I'm trying to make my tumblr posts link directly to the source when clicked rather than going to the post page and having the source link there to click.
Here's the code I have for the photo posts.
{block:Photo}
<div class="permalink">{MonthNumber}.{DayOfMonthWithZero}.{ShortYear}</div>
<div class="photo">
<div class="photobox"><img src="{PhotoURL-250}" alt="{PhotoAlt}"/></div>
{block:Caption}
<div class="caption">{Caption}</div>
{/block:Caption}
</div>
{/block:Photo}
I've tried changing the photobox 'permalink' to source etc with no avail.
Anyone got any ideas?
In the hope that someone who needs this will find it, here's a way I found to show {LinkURL} when it's available, and some other url when it's not.
Tumblr offers {block:LinkURL} to display some code when {LinkURL} is available, but there's no {block:NoLinkURL} to use when {LinkURL} is NOT available.
Ideally, this should be possible:
<a
{block:LinkURL}href="{LinkURL}"{/block:LinkURL}
{block:NoLinkURL}href="{Permalink}"{/block:NoLinkURL}> <!-- does NOT work -->
<img src="{PhotoURL-400}"/>
</a>
But {block:NoLinkURL} doesn't exist, so I'm using {block:LinkURL} to hijack the normal link instead:
<a {block:LinkURL} href="{LinkURL}" data-ignored-{/block:LinkURL}href="{Permalink}">
<img src="{PhotoURL-400}"/>
</a>
If {LinkURL} is available both links will be in the HTML, but only one is read.
Example output
This is the output when {LinkURL} is not available:
<a href="/permalink">
<img src="/image.jpg"/>
</a>
And this when is the output when {LinkURL} is available:
<a href="/linkurl" data-ignored-href="/permalink">
<img src="/image.jpg"/>
</a>
after comments edit
It should be <a href="{LinkURL}">
You have to make sure when you're adding the image that you've specified the target as outside of tumblr too.