1

I am using the default "blog site" template in SharePoint, my question is "how to open in new window a particular blog post?"

What happens is, although I am pointing to the particular URL,

e.g: http://mysite/newsandevents/Lists/Posts/Post.aspx?ID=1 http://mysite/newsandevents/Lists/Posts/Post.aspx?ID=2

This will still open the full blog roll hence we cannot link from the homepage a particular news because the purpose is defeated.

If this was ever answer before, I would really appreciate if you can direct me to the resolution.

1 Answer 1

1

Add a Script Editor Web Part and use the jQuery script below to re-write blog title links to be opened in new window.

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> 

<script>
$(document).ready(function(){
    $('.ms-accentText').click(function () {
    $(this).attr('target', '_blank');
    });
});
</script>

enter image description here

Here is proof of concept: https://jsfiddle.net/em2kk55o/

11
  • hi Falak, thanks for your reply, question though, should I create a .js script and reference it to the content editor?
    – lucas
    Commented Jun 19, 2015 at 1:58
  • If you want to keep it in version control then better create a .js file. sympmarc.com/2011/05/03/… Commented Jun 19, 2015 at 2:21
  • I don't know what is wrong with SharePoint or the issue is with me but this is not working for me. :( Is there any other way?
    – lucas
    Commented Jun 19, 2015 at 2:33
  • Can you add a script editor or content editor web part on the landing page? Commented Jun 19, 2015 at 3:35
  • Yes, I can do that. Tried adding the script as per your advise using "script editor" but it just wont work as per expectation.
    – lucas
    Commented Jun 20, 2015 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.