By axel pressbutton on
Hi all,
Can anyone tell me how I'd go about adding tabs to the go along with the normal 'View', 'Edit', 'Files' etc. tabs once you click on the My account link?
Basically I'm trying to move the 'Create content' option to a tab and out of the 'Navigation' nav. Ideally this will then show a list of the content types a user role can add, linking off to the /node/add page from there.
While on the subject...is it also possible to add an option here to show a user a list of their own posted content?
Many thanks in advance for any help.
Comments
_
Not sure about the create content tab, but for user posted content you can use the core tracker module (which lists anything the user has posted on, like the tracker here on d.o) or you can use the views module to create a tab of nodes where the user is the author (using an argument of "user: name" or "user: uid").
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Nice one, thanks
Nice one, thanks WorldFallz
I think I may try views option you suggested and then the tracker module as a backup. I wanted to try and keep certain content types to their own tab if possible as they are a key feature of a users profile/role. I guess that would then lead to replication if I did that and then included tracker for forum posts etc (unless that can be filtered). I'll see how it looks.
_
You can have tabs by content type with views no problem, but yes tracker will dup some of the content.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Brilliant! I never thought
Brilliant! I never thought Views would do something like adding a tab beside all of the other Account ones...is there anything I need to take note of to get this to work or does it work just off the back of using "user: name" or "user: uid" as one of the filters? (sorry, I'm not that used to Views in D6 yet...having ditched this build part way through on D5 to try and future proof the site for a while by making the switch)
_
When creating a page view there will be a menu setting available in page settings-- select tab. Then you need to set the path to '/user' and add an argument (not a filter) of 'user: uid' or 'user: name'. Not sure if name works, but i know uid does. You would use filters to restrict the tab to your different content types.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
_
Ah, got you.
Again, many thanks WorldFallz, I'll try that in the morning.
Wonder if anyone has any ideas on the Create content side of things.
Creating new user account tab using views
Hi WorldFallz,
I know it's been a while since you posted on this, but I hope you get this and can help me out with something....
I used views like you said to use to create a view that shows an additional tab in the user's account edit settings, and it worked like a charm. I even added a few fields to show some additional info as well as a few links to the particular content that I created the view for. Like I said...it worked like a charm. Thanks!
The tab that I created (using views) is for a particular role. In this case, it's for a "business owner/rep." role and the tab was for a business/company page. The problem is that the tab shows up in the edit section for other roles, too. Is there a way to use some logic on the page.tpl to only have that tab show for the "business owner/rep." role and not the other roles? If I could get this to work, it would really make my day! :)
I apologize in advance if I should have created another question instead of posting the question, here.
Nevermind!
I figured it out, myself. If I had been paying attention when I created the view, I would have noticed under the validation section when I added the argument (Uid) that I could validate by the user role. This solved everything. Now, the tab only appears in the user's account edit section for only the role that I want it to. (The more I work with views, the more I'm amazed at what it can do.)
Oh well, thanks (WorldFallz) again for the lesson. It solved my problem! :)
Just in case anyone wants to know how to add a content list
I managed to find this handy exported Views 2 code snippet which does what WorldFallz mentions;
http://drupal.org/node/351342
Just go to Views >> Import and paste the code in (if you've never had to do this before), save the view and ta-da...sorted.
Many thanks for posting the original code by the way :)
OK, so it's no quite there...
the code i found ALMOST does what I want, I've made afew changes to filter by Node:Type and User:Current....does anyone know how to get this tab to only show for the user who happens to own the account it is showing for?
I can't seem to find anything in Basic Settings > Access that would cover this. Using the User:Current Yes filter will hide the content within the tab but does not hide the tab itself :(
Any thoughts or suggestions very welcome. Thanks
In case anybody is still searching the answer
http://drupal.org/node/351342#comment-2063140
what about aligning the content tabs in a menu
I am trying to get my user's account tabs to be aligned in a menu for the sidebar. currently they are just aligned horizontally across their profile page.
I'm trying to create something similar to etsy my account pages. that's exactly what I need.
I attached an image so you can see. by clicking on "my account" it takes you to this page...(see att).
but right now, when someone clicks on my account" it takes them to their user profile page (apk) and just lists all of their tabs above the profile horizontally.
I want it to take them to their page which lists the menu on sidebar. If user clicks on a menu item, it loads in the content area...
any ideas?
just realized,,, can't attach an image