There have been repeated calls by users to make "my recent posts" a top-level navigation item on Drupal.org (http://drupal.org/node/107934). However, since the path to this menu item is dynamic (tracker/#####), it's impossible to create a menu item pointing to it without expending extra effort (a PHP node, or a custom module).

So this patch simply adds a new suggested menu item, tracker/user.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

FileSize
1.01 KB

Actually, that won't work, as it'll show up as a sub-menu of tracker.

So here's one that makes the path 'my_tracker' and also makes it a MENU_NORMAL_ITEM so it's enabled by default.

webchick’s picture

FileSize
1.02 KB

Interesting. :) This is also less than ideal, because the tabs disappear since you are no longer on a tracker/* path.

So now I'm going with dww's outlined solution in the above post. One downside: the "My recent posts" menu item doesn't appear active when on tracker/123 because it's a different path.

jacauc’s picture

Yay!! :D
Thanks webchick! Will give it a try asap.

dww’s picture

FileSize
1.27 KB

instead of adding tracker/user, why not just make that the path for the "My recent posts" tab, but still support arbitrary uids in there? would this work? i don't know how to get both subtabs to appear directly in the navigation menu in D6, and menu.module doesn't really exist yet for D6, either.

webchick’s picture

FileSize
3.84 KB

Ah, I was trying not to break existing bookmarks. Which is an absolutely stupid thing for me to do. /me slaps self.

I tested this patch on Drupal 5, and it does indeed allow you to create a menu item. Hooray!

I'm going to re-roll dww's patch and rename $who to $target, which is a little more generic.

webchick’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
1.28 KB

Tested on 6 and works great. The only difference is the variable rename, so I'm marking RTBC.

webchick’s picture

FileSize
1.33 KB

And here's a patch for Drupal 5, so we could do this on drupal.org.

dww’s picture

FYI: with killes's blessings, i just applied the D5 backport on d.o and finally fixed http://drupal.org/node/107934).

#6 is indeed RTBC for D6.

dww’s picture

note: our patch breaks no links. everyone's old bookmark to tracker/[uid] will still work, since $target can be an arbitrary uid. it just won't call that the "My recent posts" tab, it'll think it's "All recent posts" for some other user. big deal.

Dries’s picture

This is a bit of a universal problem. The "my account" menu suffers from similar problems -- it's hard to move it around.

So, this looks like a universal problem to me that needs a universal solution.

It's almost as if the mapping from %user_current to the $user's uid happens at the wrong time. It shouldn't happen when the menu is generated and send to the client, it should happen when the page is requested, and the callback is resolved and called.

Of course, it's easy tos ay and write this -- but it might actually be hard to implement. Either way, I'm just thinking up loud, hoping to spark ideas for a more generic solution. It would be super-useful, I think.

dww’s picture

interesting point. the trick we play in this patch to handle $target appropriately could be built into the menu system. it's true that both tracker and My account could benefit.

however, here's a counter-example: the current "My projects" link. the existing menu item is:

http://drupal.org/project/user

however, it also supports:

http://drupal.org/project/user/46549
http://drupal.org/project/user/dww

if we made the default "my projects" item really be this:

http://drupal.org/project/user/user

we'd conflict with a user named 'user'. :(

granted, the existing project menu item isn't necessarily the most sane approach, but it seems like we can't just apply the same technique to all menu items that want to know the uid of the current user. i think we'd need 2 different menu path tokens, one for the uid of the current user as a literal in the URL, and another for this cool 'user' keyword in the URL that maps to the current user's uid before being passed in as a menu callback argument...

however, i feel like there are so many important menu-related patches still in the queue and that menu API is still in flux, i wouldn't want to complicate or delay those with this particular feature request. that said, i'll try to get chx and/or pwolain's input on this in the near future, and see what they think.

personally, i'd rather see this patch go in now, and if we change menu API to add the cool new token, we can always port this functionality to use that when/if it exists, but that's just me feeling the heat of the freeze fast approaching. ;)

chx’s picture

Status: Reviewed & tested by the community » Needs work

I do not understand what #6 solves when that's a MENU_LOCAL_TASK still. And, as my account shows, it's quite trivial to create dynamic menu items. Actually. If you just remove MENU_LOCAL_TASK from the menu definiton in six, you'll get a normal menu item.

dww’s picture

Status: Needs work » Needs review

@chx: maybe we're just confused since menu.module doesn't exist in D6. but, in D5, you can't define your own menu items that point to dynamic paths. so, you can't say: 'My recent posts' = /tracker/%user_current. you can only say stuff like 'My recent posts' = /tracker/user. what #6 solves is that the regular tab stuff still works fine on /tracker, but you can also define your own navigation menu item that points to /tracker/user, and under the covers, that works like %user_current. see this in action on d.o right now in the navigation menu.

the non-existance of menu.module is what needs work, IMHO, not this patch.

that said, i like Dries's idea of some way to say:

put "user" in the URL for the menu item, but treat that like %user_current before it actually gets to the menu callback...

that's what i was hoping to get your input on... ;)

chx’s picture

non existence of menu.module? Stay tuned!

dww’s picture

i eagerly await! ;) however, it doesn't really change anything about the need for this patch, or the discussion about this magic path URL token that gets automatically remapped on the fly.

Jax’s picture

Any chance of a 5.2 release with this in it?

dww’s picture

@Jax: please note the category of this issue: "feature". therefore, it's not going to be officially released for D5, which is a stable version that's only accepting bug fixes. in a matter of days, this might not even make it into D6, unless we can get some more thoughtful reviews and support for this, so it will be committed.

webchick’s picture

Well, to be fair, this doesn't break any APIs so can get in as a usability improvement post-code-freeze.

jacauc’s picture

the "My recent posts" item was in the menu for quite some time, but it seems to have disappeared again??

catch’s picture

Status: Needs review » Needs work

This'd be great on drupal.org

Also unrelated I think tracker/1 has disappeared as a tab in D6??

But it doesn't apply.

StevenPatz’s picture

Version: 6.x-dev » 7.x-dev
Status: Needs work » Needs review
FileSize
1.25 KB

here's an updated patch.

catch’s picture

Status: Needs review » Needs work

Still a good idea. No longer applies (again).

xcorex’s picture

agree

Liberation’s picture

Well, what appears to work for me in D6.4 is to create a new menu entry with path "tracker/%" and title "My content" in the Navigation menu. The % is substituted with the user id in the menu system prior to invoking the tracker panel, and gives a one-click result.

It took me a while to figure this out, so I hope this is useful to someone. Feel free to advise an alternative if this approach isn't legitimate.

yoroy’s picture

Fundamental usability issue. Something to look at in Szeged.

Liberation’s picture

There's one minor snag with my solution in #24. It turns out that tracker code & SQL will only locate and display published content (node->status == 1). However, my preferred interpretation of a "My content" link would include unpublished content as the whole point is to make things easier for the user developing their posts at varying stages of completion. Whereas of course for "All recent content" then only published content should be included.

This issue is well explored from another angle in another thread: http://drupal.org/node/10611?mode=2&sort=2

callison’s picture

What happened to this? I still think this would be a great idea to implement on drupal.org.

yoroy’s picture

Version: 7.x-dev » 8.x-dev

Still a nice and sensible feature. IF tracker stays around of course :)

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Issue summary: View changes
Status: Needs work » Postponed

This extension is deprecated and scheduled for removal in Drupal 11.

This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

It will be moved to the contributed extension once the Drupal 11 branch is open.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.