Needs work
Project:
LoginToboggan
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
23 Aug 2011 at 15:07 UTC
Updated:
4 Jul 2014 at 13:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
hunmonk commentedThe patch is incomplete. It would need to include the necessary CSS adjustments to emulate the default behavior.
Also, note that #1172652: Show unified login on Access Denied is working on breaking out the unified login form generation from the page call, which will make it easier to re-use the form wherever you like it.
Comment #2
olafkarsten commentedokay, you're right. I will have a deeper look into it. At the moment I'm somewhat short on time. I didn't find a simple solution yet, as we didn't have a logintoboggan specific css selector at page title level or above. But I think it is worth the time. The page title is a key element for accessibility and should ever be there.
Comment #3
fabrice-synchro commentedI think this issue also disable messages on the unified page login/register when using sub themes (Fusion sub theme in my case).
Thanks a lot.
Comment #4
hunmonk commentedthat's highly doubtful, as drupal_set_message() and drupal_set_title() reference completely different systems. your problem is most likely elsewhere. in any case, if it really is a problem, it should be filed as a separate issue.
Comment #5
olafkarsten commentedI didn't manage to find a solution. We can insert a toboggan body class per preprocess_html and than hide the h1#page-title tag. But than it would be hidden on the login/register page, even if we do not have a unified login page. I don't like that. So feel free to close this issue.
But I think the current state is not right. The problem is that drupal_set_title() sets the header element TITLE too. An empty TITLE element is bad for accessibility. Maybe some better skilled developer than I, find a solution for that.
Comment #6
hunmonk commented@olaf.karsten: you can always write a mini-module that runs after LT and form_alter()'s or does drupal_set_title().
Comment #7
olafkarsten commentedYes, of course - a solution for my own is no problem, but I thought i can find something more general, that deals with this issue in a better way. I like LT and the empty Title element in bothers me somewhat. But I guess, thats life. Thanks
Comment #8
j0rd commentedSame problem. This page should not have a blank title.
Should show something like 'Login or Register'
If people want to hide the title with CSS for this page, then so be it, but forcing those who want a title to hack logintoboggan is not a good solution.
Comment #9
hunmonk commentedi wasn't easily able to find how drupal_set_title() does its job, but isn't the real problem that it sets both the page title for the browser, and the visible page title in the content? that seems more like a core bug to me.
Comment #10
j0rd commentedI noticed this bug.
You don't get a title when the default order of these function calls is like this
In this order, the title gets set and displayed
Comment #11
uptil4music commentedGreat module, does wonders to improve the UX for sites. Thank you for all the hard work.
I really like the unified login/registration page, but without a proper < title> tag, I unfortunately have to pass on this little nicety.
I don't know if this is the right place or the right way to ask, so I'll just ask, and seek forgiveness in advance if I'm offending anyone. Can someone that writes code post a generic theme function (or a more appropriate solution?) that allows me to set the < title> tag in < head> to something like 'User account' for the unified pages (user/register, user/login, user)?
I'm using 7.x-1.3, but I didn't want to post a duplicate issue. Thanks much for any help toward a solution.
Comment #12
stevecowie commentedReading back through this issue, this is not as straightforward as you probably hope. I need to look a bit further into this to see if there's a long-term solution but the fact that @hunmonk didn't find one doesn't make me optimistic. However, an easy workaround for you is to do this as a preprocess_page function. You can write one of those into a module or just create it in template.php of your theme. You need to check out if the user is logged in or not and also check the page so something like this will do it:
function mytheme_preprocess_page(&$variables){
global $user;
if (!$user->uid && request_uri() == "/user/"){
drupal_set_title(t('title that will appear in the header"));
$variables['title'] = t('This title will appear above the form');
}
}
Note also the earlier suggestion at #6 that you could also do this with a mini-module that comes after LT and changes the title or does a form_alter.
Comment #13
cesareaugusto commentedI got the very same problem: no title on unified login page. Which is the status of this bug? How did you solve it?
Comment #14
craigtockman commentedUntil this gets fixed why not just create a block, set it to php, display it only on the user page, and insert this code:
<?php drupal_set_title("Login"); ?>Comment #15
md2 commentedI think the general consensus is that the module should not make the decision to hide the title on the site builders behalf. If they choose to theme it out, its up to them.
With a title in place, if a user hits /user/login or /user/register they get the correct Browser Title and the correct Page Content Title, Google should be happy with these also.
However when the user clicks either JavaScript button to flip the forms, the titles remain static to the original page that was hit.
The following patch tries to reinstate the page title and change the Browser and Page title on the users request.
Reviews and thoughts would be good
Cheers,
Mark
Comment #16
md2 commentedmarking as needs review
Comment #16.0
md2 commentedtypo fixed
Comment #17
stefan.r commented#15 seems OK
Comment #18
stevecowie commentedTested the patch provided by md2 and pushed.
Comment #20
david_garcia commentedSo...visiting login or register page triggers 3 page requests (at least if you don't have any other ajax stuff)?¿?¿? IMHO that is not a good approach.
Did some work on it to propose an alternate way of getting the page tittles.