Thanks in Advance . Here am trying twitter share functionality ..How to do that in codeigniter
<div> <p>Post description</p><i class="fa fa-twitter"></i></div>
While i am click this icon it has to share particular post to twitter . How to do that .
Pass Only this url to share any type of post or page
<div> <p>Post description</p> <i class="fa fa-twitter"></i></div>
Related
How to get URL without context path?
I am using spring boot 1.5.18.RELEASE and Thymeleaf
I tried this two possibilities.
<a th:href="#{${website}}" target="_blank"> Click here </a>
<a th:href="${website}" target="_blank"> Click here </a>
For example if the ${website} has the value www.example.com I get this result:
http://localhost:8081/MyApp/www.example.com
but I would like to get only this www.example.com without context Path.
I resolved it so:
<th:block th:with="link=${website}">
<a th:href="#{//{link}(link=${link})}" target="_blank">> Click here</a>
</th:block>
If you are linking to an external site, you should have http:// or https:// as part of the link -- https://www.example.com rather than just www.example.com. once you've added that, either of the two solutions in your initial post will work.
<a th:href="#{${website}}" target="_blank">Click here</a>
<a th:href="${website}" target="_blank">Click here</a>
// as you've indicated will work as well, but it's a bit silly. That just means that if your site is https:// it the link will be https:// (and vice versa for http://).
If you don't want to add https:// to your link, I would recommend something like this:
<a th:href="|https://${website}|" target="_blank">> Click here</a>
You can use dynamically, it works to me
<img th:src="${#httpServletRequest.scheme}+'://'+${#httpServletRequest.serverName}+':'+${#httpServletRequest.serverPort}+#{/user/display/${user.id}}" />
I am trying to link an external link to the code.
Currently I have the following:
<div class="col-md-4">
<div class="thumbnail">
<a href="www.google.com" target="_blank">
<img src="/assets/laptop.jpg" alt="Fjords" style="width:100%">
<div class="caption">
<p>How to set up emails</p>
</div>
</a>
</div>
</div>
I am getting an error telling me "No route matches [GET] "/www.google.com". However, I only want to click onto the picture and for the page to go to google.
You need to specify the protocol too (https:)
<a href="https://www.google.com" target="_blank">
Relative URL (URL with no protocol specified) are used to reference links on the same site. You need to use the Absolute URL (with protocol and other information like protocol, domain name) to refer to an external site.
Relative URL are used to reference links on the same site. You need to use the Absolute URL to refer to an external site.
You can reference external links without protocol by:
<a href="//www.google.com" target="_blank">
Or use:
<a href="https://www.google.com" target="_blank">
I am currently building a small website using ruby on rails and foundation as the css framework. I implemented a top bar for navigation with 2 items being nested drop downs.
Here is the code of the top-bar that is inside my layout/application.html.erb:
<body>
<div class="top-bar">
<div class="top-bar-left">
<ul class="dropdown menu" data-dropdown-menu>
<li class="menu-text">Logo</li>
<li>Home</li>
<li>Statistics</li>
<li>News</li>
<li>Items
<ul class="menu">
<li>Infected items</li>
<li>Detective items</li>
</ul>
</li>
<li>Guides
<ul class="menu">
<li>Lore</li>
<li>Beginner tutorial</li>
<li>Mod rules</li>
<li>Strategy guide</li>
<li>How to be a good detective?</li>
</ul>
</li>
</ul>
</div>
</div>
As shown in the following picture:
The code behaves as intended until I open the statistics page right next to home, as shown in this one:
If I enter the stats page manually, I get no problems until I switch back to home. This happens anytime I click a link of the top bar that is not the same page that I currently am at.
I currently have no custom javascript or jQuery listeners implemented at all and I'm using a fresh foundation installation using foundation-rails.
Why is this happening and how can I solve it? Is it related to rails?
Thank you
This was due to a conflict between foundation and turbolinks.
For anyone running into this kind of apparently random issues, I solved this by following the approach suggested here:
http://foundation.zurb.com/forum/posts/2348-foundation-5-topbar-menu-not-responding-on-rails4
I would like to add a button to my website to give the opportunity to my visitors to share content to twitter and I use the following code :
<a href=
"https://twitter.com/intent/tweet?button_hashtag=TwitterStories&text=Check%20out%20this%20app%20"
class="twitter-hashtag-button" data-url="http://test.com">Tweet #TwitterStories</a>
<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>
The problem is that the url's address is visible. I would like to add a link and display only a phrase (e.g "check this link") which will link to my website.
Is that possible?
Thanks in advance.
I'm not much experienced in Rails. I'm trying to implement Twitter sharing in my project.
<li class="twitter">
<a onclick="window.open('https://twitter.com/share?text=<%= tweet_text %>&url=','sharer','toolbar=0,status=0,width=548,height=325');" class="popup" href="javascript: void(0)"></a>
</li>
and this will open up a tweet page in a new window in case of browsers. But in case of iPad or iPhone this thing loads in the same tab and the user will be stuck at that page if he or she thinks not to tweet when it loads.
So what I want is that I need a tweet page that comes with a back button or cancel button or something similar to that which can solve this.
I know this post has been here for one year but I am answering it anyway. I believe you are looking for this
<a onclick="window.open('http://twitter.com/share?text=<%= #post.title %> by #yourname- &url=<%= url_for([#post,{only_path: false}])%>','_blank','width=800,height=500,top=200,left=300');void(0);" >
<i class="fa fa-twitter"></i>