Advertisement:

Author Topic: modify linktree  (Read 1869 times)

Offline gebekzor

  • Newbie
  • *
  • Posts: 7
modify linktree
« on: November 11, 2011, 09:24:23 AM »
It is possible to modify linktree of this:


on that?


change ". $ context ['forum_name']. in the image and remove the board link

MrPhil

  • Guest
Re: modify linktree
« Reply #1 on: November 12, 2011, 09:41:52 AM »
It should be possible. Look for and modify all the theme_linktree() functions in your Themes. I think there's a $link_num or something similarly named counting the links from left (0) to right. It looks like you want to replace the text entry (name) for $link_num == 0, within the <a> tag, with an image instead of the text. Something like
Code: [Select]
if ($link_num == 0) {
   echo '<a blah blah><img src='blah blah home icon' /></a>';  // image for home link
} else {
   echo '<a blah blah.......';  // regular code for all other links
}
You may have to tweak the CSS to fit your icon in that line.

Then it looks like you simply want to skip the entire $link_num == 1 link. For that, at the top of the loop, just something like
Code: [Select]
if ($link_num == 1) continue;should work.

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: modify linktree
« Reply #2 on: November 12, 2011, 10:33:34 AM »
Either something like MrPhil suggested, or you can modify the base linktree (which should be in Load.php)

Offline gebekzor

  • Newbie
  • *
  • Posts: 7
Re: modify linktree
« Reply #3 on: November 12, 2011, 05:13:29 PM »
It should be possible. Look for and modify all the theme_linktree() functions in your Themes. I think there's a $link_num or something similarly named counting the links from left (0) to right. It looks like you want to replace the text entry (name) for $link_num == 0, within the <a> tag, with an image instead of the text. Something like
Code: [Select]
if ($link_num == 0) {
   echo '<a blah blah><img src='blah blah home icon' /></a>';  // image for home link
} else {
   echo '<a blah blah.......';  // regular code for all other links
}
You may have to tweak the CSS to fit your icon in that line.

Then it looks like you simply want to skip the entire $link_num == 1 link. For that, at the top of the loop, just something like
Code: [Select]
if ($link_num == 1) continue;should work.

Thanks, works.

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: modify linktree
« Reply #4 on: November 12, 2011, 05:16:43 PM »
Marking topic solved, glad you were able to get it done :)