Hi,
Right now the "Popular" and "Upcoming" links appear only in a list view of scoops. When you are viewing a full node (for example posting a comment) those Popular/Upcoming links disappear. This makes user-navigation very disruptive and disorientating, and my esers keep complaining.
For example when I'm on Digg.com, those Popular/Upcoming links are always being displayed and I click them very frequently while digging latest posts.
In page.tpl.php we see that this navigation is controlled by
<?php
if ($page == 0 && module_exists('drigg')) {
print drigg_ui_type_menu();
print drigg_ui_order_menu();
}
?>
The key, it seems is the bit that says $page == 0 . It's basically saying "If the page is a list view"
What I want is for print drigg_ui_type_menu(); [this is the bit that prints Popular and Upcoming links] to display on ALL pages including the full-node pages, and print drigg_ui_order_menu(); [top24h, 7days, 30days, 365days] to display only on List views as it does already.
I've been trying to figure this out for many weeks now, so if any kind soul would help, that'd be much appreciated!!!
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | menu_always_visible.patch | 1.58 KB | munikho |
| #11 | type_menu.patch | 1.38 KB | munikho |
Comments
Comment #1
munikho commentedActually i'm wondering the same in version 6.x.
Noticed that the module decides if it should display 'published/upcoming' depending if it is in the url (and catching the exceptions before, like the homepage).
So when you view a node, there is no 'published' or 'upcoming' in the link, but only /node/33, so there is no menu.
It's not showing the category that was selected anymore either.
Anybody has any bright idea's on how to go around this?
Comment #2
drupalina commentedI had a look at the drigg_ui.module and it seems like it has some part in this form of display as well.
Please someone have a look at this issue because my statistics on Google Analytics indicate that these Popular/Upcoming links are a main navigation links of the entire site. I guess this is the case for any Digg/Reddit site. Once people view the full node, they want to get back to finding new scoops in the Upcoming section, so what do they do??? There is no Upcoming or Popular link!
I've created 2 links in the primary menu that show Popular and Upcoming. But this is NOT a solution because it does not make drigg_ui_order_menu dependent on these links. This way if you are in Popular>>Top7days the "Popular" link will NOT remain active, while the drigg_ui_type_menu version of Popular/Upcoming do, which is very disorienting. Plus, it also means displaying Popular/Upcoming links twice on the same page, which is ugly, unprofessional and disorienting.
Please someone help...
Comment #3
munikho commentedWow, i supprised myself here by actually making this work...
Maybe somebody can take a look, because it's very possible i'm doing something very 'illegal'.
I'll post my code here, since I don't know how to make a patch and anyway my drigg module is a little bit personalized.
In drigg.ui.module:
and in your page.tpl.php
I'm using version 6 here, but i think this will work for 5 as well.
Maybe something like this could be included in the module? Depending on the theme, this could be a nice feature.
Tell me if it's any good though.
Comment #4
drupalina commentedHi,
I've tested your code on my 5.x live site. It works, but not fully!
For example, I have views where users see their Favourites, or Scoops posted by friends (I've done these using Views module), or pages where they look at the community (/profile) or Private messages, or OG groups etc etc. There are many pages, where these Popular/Upcoming links are still not displaying. Strangely enough, the Popular/Upcoming links are displaying on some other pages like static Page content types. I need them to display on ALL pages, like we see on Digg.com or Reddit, because these are the principal navigation links.
But at least this is a good start. What I also like about your code is the fact that when we are viewing a full node of an upcoming scoop, the Upcoming link above remains selected, which is another good reminder that we are still in the upcoming section.
I suspect the problematic aspect is either arg(0) == 'node' or promote == "o" in
If you post a code that will display the Popular and Upcoming links on ALL pages of the site, I'll be willing to test it on my live site and report back to you.
PS: BZW, in 5x drigg_ui.module it read function drigg_ui_type_menu() not function drigg_ui_type_menu($promote) . Is there anything that I should be worried about?
Comment #5
munikho commentedWell, right now the code is simply checking if the page you're viewing is a node and will then display the menu. You could just take away
in the two if statementens and i think it would display on every page. But in this case the upcoming menu item will be selected. Which is also the case now when you view a page. So that's not really correct yet.
Btw, about the last thing. You need to change
into
Hope this helps a bit, what's your live site anyway?
Comment #6
munikho commentedOk, i think i have it.
in the theme:
in drigg_ui.module
and then comment out
I hope that with this it all works.
Comment #7
drupalina commentedI've tested your code from #6. So far so good. Everything seems to work! No php errors in the watchdog log.
Will report if I find any errors.
Thanks!!!
I'll e-mail you directly about my site ;)
Comment #8
drupalina commentedBZW, here's a related question, which I'm sure many other Driggers would love:
do you know how to make those Popular (with its sub-links) and Upcoming (with it's sub-links) links themeable? I mean so that *Popular* (and it's children "newest", top7days, top30days etc) appear in Blue background and *Upcoming* (together with it's children "newest, oldest most_poppular, least_popular) appear in Grey background. To see what I mean visit Digg.com and see how the colours of the menu change when you click Upcoming and a Popular.
Also, since Drigg is so smart as to tie Sections with Upcoming and Popular links, I wonder if the background of the Sections could also be themeable depending on whether we are vieing Popular or Upcoming.
Any ideas?
Comment #9
munikho commentedHappy that it works for you.
The other question, i guess the easiest way i can think of now, is to just do it with a little bit of jquery and css.
Detect with jquery which tab is selected and add a class to the parent div.
Comment #10
drupalina commentedI'll close this issue, since it's sorted (if any bugs crop up, please reopen it).
As for the question in the other issue, I'll open a new issue - that's the right way.
Thanks again.
Comment #11
munikho commentedWould be great if this could somehow be merged in version 5 and 6, maybe there could be an option made in the backend where you can select if the menu should always be visible. I'm not sure how to do that.
I'll add the patch here.
For this to work, the theme also has to be changed a little bit.
from this:
to
#edit
Patch is for 6dev
Comment #12
drupalina commentedHi Merc, (I hope you're reading this)
After listening to most of feedback from my end users, I'd say, it would be _essential_ and _crucial_ that something like this be adopted as a standard in future releases of Drigg (both in 5x and 6x).
Popular and Upcoming links should _REALLY_ appear on ALL pages, just like we see on Digg.com and many other such social news sites.
Comment #13
mercmobily commentedHi,
Drupal, about #8, please keep threads on topic in line.
Now... I think you are right in principle, and I am happy to apply this even tough I am focussing on bug fixes only.
However... can somebody post a *final* *working* and at least half-tested solution? I am not entirely sure *which* bit from each part I should take...
Bye,
Merc.
Comment #14
drupalina commentedHi,
I have this solution up and running on my live site since about March 20. Check it out. It works!, but not fully. There are some (very rare pages) whereby if you click one of those Popular/Upcoming links, it will bring you to "Page not found".
For example, if you are on /vocabulary/2 and you click on "Upcoming", it will bring you to "Page not found" because the URL that it is looking for is /upcoming/newest/2. Or if you are on /taxonomy/term/1343 and you click on "Popular" it will bring you to "Page not found" because the URL shows /published/newest/1343.
Or if I'm on /search/node/foofoo and then click on "Upcoming", it will try to look for /upcoming/newest/foofoo
Other than these occasions, I think this solution generally works.
I haven't applied the patch in #11 - simply because I still don't know how to apply patches. If I remember correctly, I just fiddled around with the drigg_ui.module with the code-replacements provided by Munikho above (like in #6 and #11), and it started to work.
Do you want me to attach my drigg_ui.module file?
Comment #15
munikho commentedI will provide a new patch soon.
I just need to dive back into the code (long time ago).
Comment #16
mercmobily commentedHi,
OK thank you!
Once you submit it, I will integrate it into Drigg. That way you won't have to maintain a fork...
Merc.
Comment #17
munikho commentedI resubmit the patch here.
This does need to be tested, because it's probably not perfect yet.
As mentioned above. The theme (page.tpl.php) needs to also be changed a bit. From:
to:
hope it works.
m
Comment #18
mercmobily commentedHi,
Can others here please test this patch?
Merc.
Comment #19
feconroses commentedI have tried it. The popular and upcoming links appears on every page, but i get this error:
warning: Missing argument 1 for drigg_ui_type_menu(), called in /home/gentpas1/public_html/themes/drigg_theme/page.tpl.php on line 101 and defined in /home/gentpas1/public_html/modules/drigg/drigg_ui/drigg_ui.module on line 931.
warning: Missing argument 2 for drigg_ui_type_menu(), called in /home/gentpas1/public_html/themes/drigg_theme/page.tpl.php on line 101 and defined in /home/gentpas1/public_html/modules/drigg/drigg_ui/drigg_ui.module on line 931.
Maybe its just me, i apply patches manually but i never had a problem with that.
Comment #20
feconroses commentedI forgot to mention that i also made the suggested change in page.tpl.php
Comment #21
drupalina commentedHi munikho and everyone,
I've temporarily abandoned my Drigg site (for various reasons), but now I'm thinking of bringing it back to life. Now that I'm looking through the watchdog logs, it appears that neither #6 code nor the patch in #17 provide a total solution, because there are many "Page not found" problems:
if you on any tag page /taxonomy/term/104 and then click on the "Upcoming", then the URL will bring back /upcoming/newest/102 (Page not found)
if you have the Tagadelic module and you are on /tagadelic/vocabulary/2 and then click "Upcoming", you will end up on /upcoming/newwest/2 (page not found)
The same "page not found" problems happens when you are reading your private messages and then decide to go to "Upcoming"
"Page not found" error also happens when you are on /node/add/drigg (or /submit) and then decide to click on "Upcomng"
It seems like some small argument is missing in the above solutions, which would tell it to go to /upcoming/newest (and no additional URL suffixes) no matter where the the Popular/Upcoming links are displayed.
Any ideas what could be missing in code written by munikho in the above comment #6???
Comment #22
summit commentedSubscribing, greetings, Martijn
Comment #23
drupalina commentedokey, after few hours of shooting in the dark I came up with this
Basically, I replaced
in Munikho's in #6 with
The Popular/Upcoming now link properly on all pages. But I'm not sure if this is clean code. Somehow, I'm getting the feeling that the website has slowed down as a result of it. Can someone have a look at this solution and advise whether this is a "clean" way of doing it?