Hi folks,
Is there anyway to set a "drupal message" on a link I'm putting in? it is a link to a certain page, and I want, when someone clicks that link, to trigger a message that will appear in the typical "Drupal Message Area".
Drupal messages work with my theme, but I am not sure how to trigger them without a custom module. However, I am not sure how to link a custom module to a link click!
I really just want to set this message when they click the link.
Another possibility I'm thinking of, is it loads the page, with a line to trigger a javascript overlay window. However, that doesn't use the Drupal message area (which I use all over the site) and may break for some computers, so I'd rather not go that route. I only mention it because I know it is possible.
Comments
Could you add a block that
Could you add a block that people see when the click the link and arrive on the new page?
Does the Notifications module do what you want?
- Craig Vanderlinden @cvanderlinden
It looks like Notifications
It looks like Notifications is a BIG piece that does a lot--but not necessarily what I'm looking for (forgive me if I missed a feature)--it seems to send messages outside of the site, which isn't what I want.
My hope is that I can just trigger a message on the page they arrive on. The message only applies for people who come via a certain link, so I can't use a block and show it to everyone. I really just want to target those people who click that one link. (there are many ways to get to the page, and the message only applies to people who come a certain way)
I think there is probably some way to set a "status" message in Drupal, which would accomplish this, when people click a link--much like "?destination=page" can be added to any link, I am sure there is a way to set (for example) "?status=message to display"
Does that make sense?
I provide free Drupal support on Thursdays: booking calendar coming soon.
Ok, well you can make the
Ok, well you can make the block and have PHP code in it something from the URL
If the link they click on is: http://drupal.org/node/111?status=true
If normal visitors want to reach the same node the link can be: http://drupal.org/node/111
Or something like that.
- Craig Vanderlinden @cvanderlinden
Oh man, that is perfect. You
Oh man, that is perfect. You are the hero of everything. Thank you!
I provide free Drupal support on Thursdays: booking calendar coming soon.
Sorry, conceptually, it is
Sorry, conceptually, it is perfect,but I'm finding it not working! Let me run my code by you and see what I'm missing if you don't mind:
I have a link which sends people to site.com/page?status=true
I have a code in a block which is on that page, which says,
Nothing is appearing, so I'm not sure what I'm doing wrong--is there anything incorrect in that code? It looks right to me and I am seeing no errors, so I assume it is executing.
I added a
line AFTER the closing PHP tag, and sure enough, that appears when I go to the page (using the url?status=true and without), but the actual message does not appear. Thanks in advance.
I provide free Drupal support on Thursdays: booking calendar coming soon.
WOO! Got it! A kindly drupal
WOO! Got it!
A kindly drupal IRC user pointed me in the right direction.
Here is the code:
I provide free Drupal support on Thursdays: booking calendar coming soon.
Well done! Glad it all worked
Well done!
Glad it all worked out!
- Craig Vanderlinden @cvanderlinden