Customizing SMF > SMF Coding Discussion

splitting menu items

<< < (2/2)

Orangine:
Question is, how would I go about selecting what to display and what not to, it seems I'd have to do something like:

--- Code: ---if ($something==$txt['home']) continue;
--- End code ---
am I right?


edit: phantomm beat me to it

Orangine:

--- Quote from: phantomm on July 31, 2012, 04:10:39 PM ---I think that this tip that Arantor gave me a while ago may help you:


--- Quote from: Arantor on May 30, 2012, 04:40:53 PM ---You could modify your theme's template_menu() to just not show the buttons in that theme... in the loop, check for the button's id and if it's login or register, just don't show it.

This is what some of DzinerStudio's premium themes do.


All we're really talking about is finding this line in template_menu:

--- Code: --- foreach ($context['menu_buttons'] as $act => $button)
--- End code ---

And adding after it:

--- Code: ---if ($act == 'login' || $act == 'register')
  continue;
--- End code ---

--- End quote ---

:)

--- End quote ---
I think this code doesn't take under consideration other language versions

phantomm:
Why? It's looking for specified action, which is defined inside SMF and language doesn't matter.

Orangine:
ah yes, now I get it, I thought it refers to the language strings :P

Navigation

[0] Message Index

[*] Previous page

Go to full version