SnipCart site: "$localize" showing up in Google search result snippet - localization

I have customized my SnipCart e-commerce site following the customization documentation:
<div hidden id="snipcart" data-api-key="MY_KEY">
<address-fields>
<div>
<div class="snipcart-form__row">
<div class="snipcart-form__field snipcart-form__cell--large">
<snipcart-label class="snipcart__font--tiny" for="address1">
{{ $localize('address_form.address1') }}
</snipcart-label>
However, now I see $localize showing up in Google search results instead of the English text.
Google Search Console shows that the SnipCart .js resource (.css too) is blocked because of cdn.snipcart.com/robots.txt (which is configured to not allow crawling of anything). This seems to be the problem.
What is the proper way to fix this?

Answering my own question in case someone else stumbles into this.
You can prevent certain content from showing up in the snippet with the data no-snippet directive, for example:
<span data-nosnippet>Don't show me</span>
Reference:
https://developers.google.com/search/docs/advanced/crawling/special-tags#data-nosnippet

Related

ioArgs in Dojo 1.10, dojox DialogSimple

Got myself a bit of a problem (only occurring in Tomcat 8.5, but I'll need to handle it)...
I'm trying to open up a dojox.widget.DialogSimple, using an href, that has a long url/data string. Setting the HREF on instantiation causes it to fail as a malformed URL, because it's too long. So, I want to be able to do it as an xhrPost. Is there a way to set this up using the ioArgs property? I haven't been able to find any documentation giving examples of this.
You are correct. An over-long URL string for an HTTP "GET" can cause problems: Web Services: maximum length of HTTP GET request?. In general, the solution is to do a "POST" instead.
Would this solution work for you?
Dojo - how to submit data using a Dialog form
<div dojotype="dijit.Dialog" id="subscription" title="subscription form" execute="alert('Transmitted');">
<form action="PATH_TO_PHP_PAGE" method="POST">
<!--input widgets-->
<!--submit button widgets-->
</form>
</div>

Hyperlink not clickable on Internet Explorer if use Url.Action

I used the mvc actionlink to get the url. It is working fine in chrome. But in IE it is not even clicking. i used the following code to navigate the page.
<a href="#Url.Action("GetHelpDocuments", "Document")">
<span class="navsprite helplink"></span>
<span>Help</span>
I don't find any error in my above code. But please give alternate solution for this.
I used localtion.href to get the actual location href
<a href="#Url.Action("GetHelpDocuments", "Document")" onclick='location.href = this.getAttribute("href")'>
<span class="navsprite helplink" ></span>
<span>Help</span>

Anchor tag not working

For this website ( http://carbondirect.net/ ) on the homepage, bottom right I want Sewage Odor Control to link to the page Activated Carbon and jump to the Sewage Odor Control section, but it is not working. It links to the Activated Carbon page, ignoring the anchor.
Based on some research, I tried adding this CSS, but it is still not working:
#sewage-odor-control {
position: fixed;
z-index: 10001;
display: inline-block;
}
Did I do anything obviously wrong? If you are able to take a look, thank you.
Here is the relevant code from your site:
<div class="et_pb_toggle et_pb_toggle_close">
<h5 class="et_pb_toggle_title">SEWAGE ODOR CONTROL</h5>
<div class="et_pb_toggle_content clearfix">
<span><a id="sewage-odor-control"></a></span>
Wet wells and sewage-pumping stations need to be vented to atmosphere, the vapor that is exchanged is contaminated with H2S and mercaptan. They are highly odorous, pungent and extremely objectionable. Specialist impregnated carbon are used to remove H2S to the level below the odor threshold value. The patented products (US patent#6,858,192) invented by our factory are unique catalytic activated carbon not only with high capacity on absorption, but also hazard free during the handling and disposal of spent carbon.</p>
<p>IMP-KOH, HiCOR
</div> <!-- .et_pb_toggle_content -->
</div> <!-- .et_pb_toggle -->
A couple weird things going on:
Line #5: have a closing </p>, but no opening <p>
Line #6: have an opening <p>, but no closing <\p>
Also, your anchor is not 'visible' when you first go to the site because the section is toggled closed (et_pb_toggle_close), so maybe that is causing a problem. What happens if you add the anchor the the header (which is readily visible)?
<h5 id="sewage-odor-control" class="et_pb_toggle_title">SEWAGE ODOR CONTROL</h5>
The only thing you need is adding id="sewage-odor-control" to the target element:
<div id="sewage-odor-control" class="et_pb_toggle et_pb_toggle_close">

Twitter share button not using custom url or text

I have a link like so
= link_to "https://twitter.com/share", class: "twitter-share-button", data: { url: "https://google.com", text: hack.body, via: "GhettoLifeHack_", hashtags: "ghettolifehack" } do
= image_tag "Tweet", alt: "Social Twitter tweet button"
and no matter how much I change the data-url value, the pre-tweet confirmation page always prepopulates the tweet form field with the url of the referring page, not the one I specified. It also ignores my custom data-text as well.
Why is this happening?
I also have this minified script
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
that I got from here https://about.twitter.com/resources/buttons#tweet
Removing that script doesn't seem to change anything.
edit: upon trying using :'data-url' attributes directly, the output html is the same.
I am testing hardcoded strings and dynamically generated urls at the same time. The first is the dynamic one.
<a class="twitter-share-button" href="https://twitter.com/share" data-via="GhettoLifeHack_" data-url="http://localhost:3000/hacks/1" data-text="asdf comment body" data-hashtags="ghettolifehack">
<img src="/images/Tweet" alt="Tweet" title=""></img>
</a>
The second is the hard coded strings
<a class="twitter-share-button" href="https://twitter.com/share" data-via="GhettoLifeHack_" data-url="httpL//google.com" data-text="custom text" data-hashtags="ghettolifehack">
<img src="/images/Tweet" alt="Tweet" title=""></img>
</a>
I've tested on development and in production. Both have the same behavior of pre-populating the tweet form with the referring url, rather than the specified url and text.
This works in Chrome for me but not in Firefox 32
The code provided by you is perfectly fine and should work as expected.
Many site issues can be caused by corrupt cookies or cache. Try to clear both cookies and the cache. I would suggest you to look into the following link to see why it is not working in firefox
The issue was specific to firefox browser. I'm not sure what addon or setting is causing the conflicts, but it is working perfectly find in chrome, including the popup window.

target="_blank" in a facebook profile-tab application (iframe)

i need links in a profile-tab app i'm writing open in new browser tabs. i set target="_blank" (with both hardcoded and with FBJS), but when i click on the links, the app page just reloads. i had a look at the html of the app as it's rendered by FB, and each of my links has an onclik event on it, that after creating a new image, returns false.
i tried doing linkDomObjectHandle.purgeEventListeners('click'), but as i expected, that didn't do much.
does anyone know of a way to get this to work?
edit: tested, and "right-click -> open in new tab" and middle-click both do what is expected. just the left click event gets hijacked.
edit:
some code snippets:
i have a template that is cloned, filled and the clone is appended to an element. here is the html of the template:
<div id="hover_window">
<a href="">
<img src="">
<div class="article_info">
<div class="client_info"></div>
<div class="media_info"></div>
</div>
</a>
</div>
i fill the link by doing:
var hover_window = document.getElementById('hover_window').cloneNode(true);
hover_window.setClassName('active_hover_window');
hover_window.getFirstChild().setHref(targetLink.getHref());
i tried adding both target="_blank" to the html and .setTarget("_blank") to the FBJS, to no avail.
pls advise.
This works in my facebook profile tab-app
Link targetting _blank for me
Link test
Facebook edits this link and adds "target" depending on the href-url specified. If it is an internal facebook target, it targets the current frame, if it is and external url, it targets blank. Please just try the link above and see if it works for you (and remove all that javascript and stuff you have)

Resources