News:

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

Main Menu

Main user navigation menu problems...

Started by Jim R, March 23, 2008, 11:15:44 PM

Previous topic - Next topic

Jim R

In 1.1.4 I was using the default template, but I had ported over the menu tabs from SAF (various colors).  The changes I made in the index.template.php don't seem to apply in 2.0's version of that page.

(That, and of course, some of the TXT references have changed too.)

What do I need to be looking for to recreate what I have now?   GenericMenu.template.php???  If so, where in that page?

Thanks.

Croco

try to compare with the new default.template.php file you will notice that there is a call for a loop to $context['menu_buttons'] which is an array, you can add new buttons to it, or simply replace them
check the Subs.php file and search for setupMenuContext() function inside there is definition of $buttons you can add new buttons here or in index.template.php

about the txt try to open index.english.php file and search for the old txt and try to search by its strings in the new index.english.php so you would get the new key to $txt array
I am back. I will try to catch up with some stuff soon.
Regards,
Croco

My sites
Andareena.com
Andareen.net(Under Constraction :P)

New plans coming soon


Good links for you to visit:
Docs
Search

Jim R

Let me ask you this.  Should what I have done in 1.1.4 work in 2.0?  Usually before I have added the .jpg, it just shows the list.  As I changed the language file, not all of the menu items showed up.  I didn't want to make all those changes and have it not work.

I saw the loop in index.template.php.  I could barely make heads or tails of it, but I will check the Subs.php file.

I'll report back.  Thanks.

Jim R

I can't get any of the menu changes to take.  It's very frustrating because I think I see how it all works through Subs.php.

I added this to Subs.php right next to the Profile button code:

'subscriptions' => array(
'title' => $txt['subscriptions'],
'href' => $scripturl . '?action=profile;u=' . $memID . ';sa=subscriptions',
'show' => !$user_info['is_guest'],
'sub_button' => array(
),
),



I've added the appropriate 'title' to index.english.php.


Furthermore, I made the following change:

$txt['home'] = 'Home';

to

$txt['home'] = 'Forum Home';


I've double checked to make sure I've saved and uploaded the changes.  The above Subscription button doesn't show, and my 'Forum Home' still shows as 'Home'.

What am I missing???


Croco

if you are using a custom theme make sure that it doesn't have any local language files like index.english.php
I am back. I will try to catch up with some stuff soon.
Regards,
Croco

My sites
Andareena.com
Andareen.net(Under Constraction :P)

New plans coming soon


Good links for you to visit:
Docs
Search

Jim R


青山 素子

Also note that the default caching can make these changes take a bit to show. You can try disabling caching and see if it shows up. Make sure to re-enable it after you are done.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Jim R

#7
Nope, still not working.  I should say the whole time I can see an extra wider space between Profile and My Messages, where I put the new Subscription navigation item.  Just nothing else, and Home still reads as Home, not Forum Home.


Jim R

Ok...now the Subscriptions menu item shows up but only when I have the Paid Subscriptions page up in the Admin section. 

WTH?   :) :o

Croco

where did you add the $txt['subscriptions'] ?

I am back. I will try to catch up with some stuff soon.
Regards,
Croco

My sites
Andareena.com
Andareen.net(Under Constraction :P)

New plans coming soon


Good links for you to visit:
Docs
Search

Jim R

index.english.php:

$txt['admin'] = 'Admin';
$txt['moderate'] = 'Moderate';
$txt['subscriptions'] = 'Subscriptions';


Jim R

Would any of this have anything to do with setting up menu privileges?  I added the code below to set up the button, but I made no changes to section above that in menu privileges.

Again, here is how I set up the button:


'subscriptions' => array(
'title' => $txt['subscriptions'],
'href' => $scripturl . '?action=profile;u=' . $memID . ';sa=subscriptions',
'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
),

Jim R

When I look at my Profile, it shows up as Paid Subscriptions, not just Subscriptions.  Still nothing when I'm on the main part of the forum.

Man...there is something a little screwy with all these different results while just trying to add a menu item.

Jim R

#13
OK...I had to change this in the index.english.php file:

$txt['admin'] = 'Admin';
$txt['moderate'] = 'Moderate';
$txt['subscriptions'] = 'Subscriptions';


To this:

$txt['admin'] = 'Admin';
$txt['moderate'] = 'Moderate';
$txt['subscribe] = 'Subscriptions';


It was causing a conflict with a similar line in profile.english.php, creating the different results.  Problem still isn't solved though.  Instead of showing different things at different places, it's not showing up anywhere at all now.

How can this not freaking work???   :)

I even changed the text for the admin variable.  It says Admin Baby, but even that doesn't reflect the change.

Jim R

Hello?

It seems a good amount was put into making adding menu items a little more user friendly.  Smart move, but it's what is causing me the most troubles.  I hope someone can help with this or else this feature is useless.

I even moved the 'Home' button to where I'm trying to add the Subscriptions button.  It doesn't show up.

noisy1

#15
hey there,
I "WAS" having same issues, but just for adding a menu tab wasn't a subscription thingy ...
anyways ,,,, I was adding a "Contact US" tab to the menu , now there is a mod to do this BUT for 2.0 beta3 the only mod that does ONLY adds it to the menu if you ARE NOT logged in ...
which works fine .. etxecpt that obviously if you want the tag WHEN USERS ARE LOGGED IN ... bit frustrating ....
anyways I did all the adding of the $txt['Contact'] stuff and still no joy ,, added code for the menu tab as  'contact' => array(
            'title' => $txt['contact'],
            'href' => $scripturl . '?action=contact',
            'show' => $context['allow_search'],
            'sub_buttons' => array(
            ),
            'is_last' => true,

NOTICE the 'show'=>$context['allow_search']   
... previously with the mod it was 'show'=>$context['is_guest']
soooo possibly if you change that line in your code to say ... 'show' => $context['allow_memberlist'],
it would enable the menu tab to be shown to members .... as only members have acces to memberlist ?
I suppose what i am getting at is the show is basically setting the permissions for who can see it ..
anyways i am new at all this too so i just was trial and erroring ...
hope this helps
Cheers George
P.S I had to manually go into admin center and CLEAR CACHE ... to get menu to appear the first time ..
I also did the try changing home text to home_p and after cache clear that worked ...

Jim R

I didn't do anything you suggested yet, and my changes showed up.  This appears to be a cache issue, but I turned it off three or four days ago.  I'm not a big fan of caching my page, but I don't have a graphic intensive site.


Advertisement: