Advertisement
mspotilas

Blogger images to link list example

Oct 13th, 2011
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. Ok, lets see then... I installed this on my test blog so it really works, if you get it right.
  2.  
  3. First you have to add the pages, or at least one, to your blog. You can have the Blog tabs gadget inserted, when you create the first page, so you can test the page(s). But we are going to remove that later.
  4.  
  5. Write down the url(s) of your page(s).
  6.  
  7. Now you have your page(s) and page tabs gadget, go to blog design, and remove the page gadget. Add Link List gadged to the same spot where page gadget was, below title. Configure the link list: add Home with url to main page, add "Page1" with url to page1, "Page2" -> url to page2 etc.
  8.  
  9. Test that the link list works as the page gadget worked before.
  10.  
  11. Upload your images to your Picasa web albums, for example, and get the urls to those pictures ready. Picasa offers https addresses but I always change that to http, quicker loading I think.
  12.  
  13. Next we edit the template html. Design -> Edit HTML. Expand Widget Templates. Find line:
  14.  
  15. <li><a expr:href='data:link.target'><data:link.name/></a></li>
  16.  
  17. Now we need to replace that line with a block of three line code per every link in the link list. For a text link, use:
  18.  
  19. <b:if cond='data:link.name == &quot;YOUR LINK NAME&quot;'>
  20. <li><a expr:href='data:link.target'><data:link.name/></a></li>
  21. </b:if>
  22.  
  23. For a picture link, use:
  24.  
  25. <b:if cond='data:link.name == &quot;YOUR LINK NAME&quot;'>
  26. <li style='height:30px'><a expr:href='data:link.target'><img src='YOUR IMAGE URL' style='vertical-align:text-top'/></a></li>
  27.  
  28. For picture + text link, use:
  29.  
  30. <b:if cond='data:link.name == &quot;YOUR LINK NAME&quot;'>
  31. <li style='height:30px'><a expr:href='data:link.target'><img src='YOUR IMAGE URL' style='vertical-align:text-top'/> <data:link.name/></a></li>
  32. </b:if>
  33.  
  34. I'll give you an example. Lets assume I have 2 pages, so there are 3 links (Home, Page One and Page Two). The code block to replace that one line could be:
  35.  
  36. <b:if cond='data:link.name == &quot;Home&quot;'>
  37. <li style='height:30px'><a expr:href='data:link.target'><img src='http://images.findicons.com/files/icons/76/icandy_junior/24/home_1.png' style='vertical-align:text-top'/> <data:link.name/></a></li>
  38. </b:if>
  39. <b:if cond='data:link.name == &quot;Page One&quot;'>
  40. <li style='height:30px'><a expr:href='data:link.target'><data:link.name/></a></li>
  41. </b:if>
  42. <b:if cond='data:link.name == &quot;Page Two&quot;'>
  43. <li style='height:30px'><a expr:href='data:link.target'><data:link.name/></a></li>
  44. </b:if>
  45.  
  46. I used picture + text in home page link, others are just normal text. I added style='height:30px' to make them all same height. If you use same height images for all links, that won't be necessary.
  47.  
  48. If you add or remove pages, then you must update the template html accordingly.
  49.  
  50. Hope you get it working!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement