I have sharing buttons on my site. An example of one is for twitter. Here is the template code that creates the link from my product.
Code:
<a class="btn btn-info ttip_n" title="Twitter" href="//twitter.com/intent/tweet?text={$product.product}&url={$http_location}/{$canonical_url}&via={$config.Company.company_name}" target="_blank">
<i class="fa fa-twitter"></i>
</a>
The problem is that my product names have spaces in them so the actual URL comes out looking like this.
Code:
<a class="btn btn-info ttip_n" title="Twitter" href="//twitter.com/intent/tweet?text=Balsam Fir 2x3 Pillar Candles&url=http://www.uscandleco.com/product.php?productid=153728&via=U.S. Candle Company" target="_blank"> <i class="fa fa-twitter"></i> </a>
Is there a way to replace the spaces in the URL with + or %20 so that they will validate in w3c?
Thanks.