News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

modify linktree

Started by gebekzor, November 11, 2011, 09:24:23 AM

Previous topic - Next topic

gebekzor

It is possible to modify linktree of this:


on that?


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

MrPhil

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
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
if ($link_num == 1) continue;
should work.

Matthew K.

Either something like MrPhil suggested, or you can modify the base linktree (which should be in Load.php)

gebekzor

Quote from: MrPhil 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
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
if ($link_num == 1) continue;
should work.

Thanks, works.

Matthew K.

Marking topic solved, glad you were able to get it done :)

Advertisement: