How can I target the sign-in form with ThemeKey without using a URL? I'm using the LoginToboggan module to show a login form on all access denied pages.

If a user is signed in and visits example.com/dashboard they see the dashboard, otherwise they see a signin form. This is what is preventing me from using drupal:path

Could I switch themes based on a Form ID for example?

Comments

mkalkbrenner’s picture

Did you already try ThemeKey Debug to find a suitable property?
You can configure it to be active even for anonymous users.
Maybe LoginToboggan adds something to the (anonymous) session or a cookie or something else. Please have a look at report back.

BTW the nicest way will be to integrate LoginToboggan with ThemeKey. That should be easy using ThemeKey's API.
If LoginToboggan decides to display the login form it's just a single line of code to trigger something like LoginToboggan::login_form. May you ask in their queue if they're interested?

citricguy’s picture

Thank you for your response mkalkbrenner, and thank you for maintaining such an awesome module!

I had no idea how awesome debug mode is! That and the API seems like it will do everything I need using maybe hook_form_alter().

Once I get this working I'll get in touch with the LoginToBoggan maintainers for sure, that is a great idea. I'll also post here how I did it in case anyone else has a similar question in the future.

Thank you again for your time!

mkalkbrenner’s picture

Any news?

mkalkbrenner’s picture

Status: Active » Closed (cannot reproduce)

No update -> close

citricguy’s picture

I completely forgot that I had posted this question, I apologize for allowing it to fall to the wayside.

I've learned a few things that I would like to share with anyone else getting started with ThemeKey.

1) Listen to mkalkbrenner. :)
2) Use ThemeKey Debug. This is an absolutely awesome tool and overlooking it is not a good idea.

As for LoginToboggan, using the ThemeKey Debug module I was able to find that the drupal:get_q parameter is simply 'toboggan/denied'. Use that qualifier and you're good to go!

Thank you for your help on this Markus.

mkalkbrenner’s picture

Status: Closed (cannot reproduce) » Fixed

Listen to mkalkbrenner. :)

IMHO the best advice someone posted here so far ;-)

But seriously, the ThemeKey "Suite" has that much features and isn't documented as well as it it should be.
We the advanced help function build in, but for someone who is just starting with it, it's not the best solution.

I tried to encourage users to just add a small piece to get that documentation started.
I think about a "cookbook", where users explain how the solved their individual issue using the ThemeKey tools.
All advices here in the issue queue will be lost sooner or later.
If you want to give something back, it's better to add a small page to ThemeKey Recipes and tell others which steps you took to figure out how to integrate with LoginToboggan.
Probably just a few sentences like in your last post.
I would really appreciate that!

BTW getting such positive feedback increases the motivation to continue the Drupal 8 port which is postponed by my work on Search API at the moment.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.