Southern Listeners

Loading
Thanks to Greenlava for this cool gadget. Get yours here

Sunday, March 25, 2012

Open Links in the Same Tab in Blogger Dynamic Views



In Dynamic Views, some of the links open in a new tab by default. The home link and custom links added to your Pages gadget are examples of such links. Since there wasn't a way to edit Dynamic View's HTML, it was difficult to force this link to open in the same tab. Thankfully, Fahad from My Blogger Tips found a brilliant hack to edit Dynamic View's HTML. We can now make modifications we've always been dreaming of. BTW, shoutouts to the Anonymous comment that suggested Fahad's hack, and Kiran Shenoy who found a workaround by using HTML redirects. Now, to the main event of this evening..

Step 1:

To edit your Dynamic View's template, go to Dashboard >> Template. Note the address in your browser's address bar. It should look something like this:
http://www.blogger.com/blogger.g?blogID=3462318257116246218#template
Change the 'blogger.g' part to 'html'. It should now look something like this:
http://www.blogger.com/html?blogID=3462318257116246218#template
Hit 'Enter' on your keyboard and you should now be able to edit your Dynamic View's HTML. Again, thanks to Fahad from My Blogger Tips for this great hack.

Step 2:

Backup your template by clicking on 'Download Full Template'.

Next, to make links open in the same tab by default, find and delete the following line.
<base target='_blank'/>
Save your template when you're done. Your links should now load on the same tab by default. You'll still find some stray links opening in new tabs, since they're hardcoded that way. If you find any, leave a comment and we'll take care of them individually.

Extra:

In some cases, you might get the following warning:


If this happens to you, find and delete the following line, and you should be able to save your template.
<b:widget id='Navbar1' locked='true' title='Navbar' type='Navbar'/>

51 comments:

  1. Wow! This is awesome! Possibilities are now endless! :D

    ReplyDelete
    Replies
    1. True that! We're also gonna be hearing lots of broken template cases...

      Delete
    2. That's true, but this is totally worth it! :D

      Delete
  2. Replies
    1. Thanks for the tip but... it seems that everything is tied on the external js files and the predefined variables.

      So every time a Blogger employee updates the source files my blog will be affected like it has every time there was a Dynamic Views update.

      This is definitely not the type of template I would like to work with anymore. There is no real control unless one is willing to make custom js files...

      Delete
    2. That is very true.. Most of the functions are defined in external script files that we don't have access to.

      Delete
    3. Hi Yoga, I guess the thumbnails size in flipcard mode is also defined in an external script, thus giving us no possibility to change it, right?

      Delete
    4. You're spot on. You can try to adjust the size of the thumbnail by forcing the images to appear bigger using CSS, but it's only gonna make things look worse coz your images will be stretchy and your flipcards wont arrange properly.

      Delete
    5. Thanks Yoga (for explaining in details what a mess it would be ;)

      Let's be patient I guess :)

      Delete
  3. FINALLY...

    Now I can use this once I can access my dashboard again... It loads and then white covers it >.<

    Is it possible to move that load more button now? :p

    ReplyDelete
    Replies
    1. Hi Hannah. See Ta Kanaria's comment above. It seems like lots of things, comments included, are defined in external script files. We can get rid of them and write our own script, but that'll be suicidal. I promise I'll give it a try when I have some free time though.

      Delete
  4. Awesome! always needed this!

    One question, is there anyways to make a specific Link List still open in a new tab while keeping all others open in the same tab?

    ReplyDelete
    Replies
    1. I've never tried it, but we could do that. You just have to located the links in your HTML, and add target="_blank" to it. Don't forget to backup your template before attempting anything..

      Delete
    2. Actually I meant the Link List in the new gadgets. I have 3 different Link List on my (side) gadget bar and want 1 group of links to open in the same tab and the other 2 group of links open in a new tab

      Delete
    3. KidJustin,

      I've given it a try, and it's almost useless to edit the template's gadget HTMLs. Because no matter what changes you introduce to the network, Dynamic Views is just gonna 'fetch' the important information, ignore all your HTML tweaks, and use its own pre-defined HTML format before it shows the gadget in the blog. Hope it makes sense.

      Delete
  5. hey sorry its out of context again...couldnt find a post with this issue,
    is there any way to have ads from other advertisers like chitika or infolinks in dynamic views?
    they are compatible with adsense but i cant find a way to add them!

    ReplyDelete
    Replies
    1. I'm not an AdSense expert, but I'd think you can choose ads from certain publishers in AdSense. You're gonna have to talk to the AdSense people on the exact details. Here's a link to AdSense Support Forum.

      Delete
  6. i get the error message...
    what do you mean by "find and delete the following line"
    which line?

    ReplyDelete
    Replies
    1. This line:

      <b:widget id='Navbar1' locked='true' title='Navbar' type='Navbar'/>

      Delete
  7. When the old Blogger interface is permanently discarded, this method will not work.
    At that time, you'll need to use Google Chrome or any browser that lets you modify the code.

    1. Go to Dashboard >> Template

    2. Right-click anywhere to get the drop-down menu and select 'Inspect Element'(in Chrome)

    3. Search for this line:
    <button class="blogg-button" tabindex="0" disabled="">Edit HTML</button>

    An easy way to find this would be to right-click the customize button and select inspect element since you cannot right-click the Edit HTML button.

    4. Double click the word 'disabled' & delete it or right-click >> edit as HTML & Remove 'disabled'

    5. Click back on the blogger window.

    6. You can now click the "Edit HTML" button, which will bring up the edit HTML option in the new Blogger interface.

    NOTE: The Navbar1 error can still occur and it won't show you the name of the error, only a code instead.
    You will need to remove the line:
    <b:widget id='Navbar1' locked='true' title='Navbar' type='Navbar'/>

    ReplyDelete
  8. Hi,
    In fact I would like to keep the links open in a new tab. But whereas the line < base target ='_blank'/> is in the html code, the links in the link list gadget don’t open in a new tab but in the same tab.
    As you answered me in the blogger help forum with link to this post (thanks for that), I ‘ve checked that this line is still in the source code of my template and there it is, but it seems that it has no more effect and is no more taken into account in the dynamic view template.
    I’ve checked on other blogs I know also using dynamic views that used to display the home page and links from link list gadget in other tabs but they seems to meet the same ‘trouble’ as their links now open in the same tab. However the target=’_blank’ is in the html code when display the source code of the page.
    I've tried to add target=’_blank’ directly to the link in the html, but it has no effect (it works only for external link within post but not for gadget).
    I've checked that when add this line on a classic template this works fine.
    Could it comes from an external script file in dynamic views that we don't have access to which overrides this order ?

    ReplyDelete
    Replies
    1. They (the Blogger team) must have done it again. Lots of the features in Dynamic Views are tied to external scripts hosted by Google. They could easily change a thing or two and it'll take effect on all blogs. It's hard to say which script is tied to the tab-loading feature. In any case, let me see if I can hard-code links to open in new tabs. Do you have any links in particular that you'd like to open in new tabs? It'll be more practical if you're aiming for a number of links instead of going for all the links in your blog.

      Delete
    2. I saw your answer on the blogger forum. Thanks for your help.
      Now I’m aware that Blogger team may influence the way Dynamic views are working and that I can’t have complete control on the template.
      Let's be patient and see how it will evolve in the coming weeks.

      Delete
  9. Hello,I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts.

    seo forum

    ReplyDelete
  10. Hello,

    I am sorry this question is out of context, but I could not find the best place to post it. I am creating a 'welcome page' for my blog which is hosted on a completely different site to blogger. This page will contain simply contain a logo and 4 links that in theory correspond to the 4 labels I use in my posts on blogger. My question is, is there a way for me to link from an external site directly to a set of labels on my blog (while hiding the rest of the posts) i.e. if one of my links was called 'pictures', it would link directly to my blogger showing only the posts with the label 'pictures'.

    Many thanks for taking the time to read my question. The blog is for a graduate design show, and though i love the look of some of the dynamic views, without your site I would be lost in how to make things work. This is a really fantastic resource.

    ReplyDelete
    Replies
    1. Hi Melanie,

      Yes it is possible to get the direct link to your label page. Generally, it follows the following format:
      http://blogname.blogspot.com/search/label/LaBeLnAmE

      Here's an example of a label page link in my site:
      http://www.southernspeakers.net/search/label/Dynamic%20View

      The easiest way to obtain this link is by clicking on the label's link on your post, or on your label's gadget.

      Delete
  11. Hi Yoga,

    Kind of related: I've found that links from one post to another don't seem to be working in flipcard view (problem outlined here):
    https://productforums.google.com/forum/#!category-topic/blogger/how-do-i/xKs7_2KyTcA

    Can you have a quick look if you get a chance? Thanks!

    ReplyDelete
    Replies
    1. Sure thing.. Replied you in the forum.. :)

      Delete
  12. Hi-

    So I've been trying to access the html for my blog (I want to make a couple of links in the header drawer open in new pages), but every time I try to use the hack I get a "Not Found, Error 404" page. I'm not sure what I'm doing wrong. Here's the link I've been trying to use:

    http://www.blogger.com/html?blogID=2068763154327739397#template

    Thanks!

    ReplyDelete
    Replies
    1. Hi James,

      Have you tried clearing your browser's cache/cookies, or see if it works with a different browser?

      Delete
    2. I tried clearing my browsers, and it still hasn't worked. I've tried on Firefox, Chrome, and IE, and even on a different computer, and I still get the Error 404 page.

      Delete
    3. Right.. Can we bring this discussion to the forum? It'll be easier for me to help your there. Go to Blogger Help Forum and create a discussion there, and let me know its link once it's published.

      Delete
    4. Hi, sorry, I got busy with school and moving. Here's the link to the discussion: https://productforums.google.com/forum/#!msg/blogger/fJJZ0H1x7xc/DNkFN6O5M6UJ.

      Delete
    5. Likewise.. Replied in the forum..

      Delete
  13. This is awesome stuff! Here's one for you- is it possible to lock the subscribe gadget to keep the gadget title displaying. My subscribe gadget is hard for readers to find. If they don't know what the icon is, they'll miss it. Thanks again for all these hacks!

    www.outdoorsbycracky.blogspot.com

    ReplyDelete
    Replies
    1. Hi Justin,

      Sorry for the late reply. I can think of a way, but you need to bring the gadget back to its original position, from left to right (reason being, Blogger updates lots of stuffs in the server and I find it hard to keep up with all these changes, thus making the code outdated and a little buggy)..

      Once you've repositioned your gadget, add the following to your CSS:

      .gadget-container, .gadget-item .gadget-container, .gadget-selected .gadget-container {
      opacity: 1;
      right: 49px;
      visibility: visible;
      }
      #gadget-dock, .spk{
      position: fixed !important;
      right: 0px !important;
      }

      Cheers :)

      Delete
  14. b:render='false'
    i take this off and i have only two error validity, if i keep it i get 10 error validity
    am sorry not asking about your tutorial but you seem being a pro, thanks

    ReplyDelete
    Replies
    1. Honestly I'm not quite sure about this one, sorry..

      Delete
  15. I have the opposite problem. I want external links to open in a new window so that I don't lose the reader. I can do that in posts but not in the header bar, they open in the same tab by default. How can I change this?

    ReplyDelete
    Replies
    1. I'm afraid this is no longer possible. Blogger changes the way links are being opened from their template code, which is not accessible from within the template code users are seeing.

      Delete
  16. Hi, Yoga.

    So this is no more possible? The different views of my blog open in different tabs and at the end I've a lot of open tabs (snapshot, flipcard, etc...) for a same blog. Isn't there a way to solve this?

    http://edicionesludoka.blogspot.com.es/view/snapshot

    Thank you,

    Jose.

    ReplyDelete
    Replies
    1. I'm afraid we have very little control on this :(

      Delete
  17. hi Yoga, look at my blog, I can not leave the visible pages

    ReplyDelete
    Replies
    1. Hi Lui'spes. What's your blog's URL?

      Delete

Please use the 'Ask a Question' page to shoot questions that are not related to the tutorial in the post above.