Closed (fixed)
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Engine
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Apr 2009 at 05:31 UTC
Updated:
3 Jan 2014 at 00:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fagoYou could check the current path, however there is no special condition for this yet. You can use a textual comparion and compare it to a token (I'm not sure if there is such a token in 6.x?) or to the result of the php function arg: http://api.drupal.org/api/function/arg/6
Maybe we should do such a condition though.
Comment #2
amitaibufor this task I'm using a PHP condition + use menu_get_item(). Maybe we can add it as a variable:
Comment #3
newbuntu commentedI added a php execution condition:
$url = drupal_get_path_alias($_GET['q']);
return strstr($url, 'user/login');
Comment #4
newbuntu commentedComment #5
mrfelton commentedAdding this as a condition that is configurable through the UI without the need for php coding would be a nice addition
Comment #6
cerup commentedHow do you go about adding this as a condition, php or other? I'm not sure that it's explained above.
I'd like to have a check if the current page against a path.
Comment #7
mitchell commentedSetting this back to active as per fago's comment:
See #2 or #3 for current workarounds.
Comment #8
Bilmar commented+1 subscribing
Comment #9
UNarmed commentedHow do i add the PHP condition mentioned at #2 and #3 to my rule?
Comment #10
YK85 commentedHi,
I was wondering if there has been any further development on this?
Thanks!
Comment #11
mitchell commentedSee: Path Rules
@fago: Would you like to merge this module into 6.x-1.x-dev. It appears to be stable, so I doubt it will hold you up on 6.x-1.2.
Comment #12
YK85 commentedawesome, i tested http://drupal.org/project/pathrules and it would be great to see this in rules core module
Comment #13
fagoyep, imho that make sense. Feel free to roll a patch. However for 1.2 you need to hurry.. ;)
Comment #14
klausiComment #15
YK85 commentedwould anyone be able to kindly roll a patch to integrate the features of pathrules module into rules?
thank you!
Comment #16
mitchell commentedBig bump. This one issue is good cause for a new 6.x release for at least 618 rules users.
Comment #17
fagoLet's add this feature for 7.x first (this is where new features are added). By adding a new property in entity metadata ala system:current-path this should be rather easy. Then we need to ensure we have a good textual comparison that is capable of doing all operators off "starts with, ends with, contains, is equal to".
Comment #18
neochief commentedHere's the one with regular expressions, I used for my project.
Comment #19
stella commentedsubscribe, willing to test any d6 patch
Comment #20
fagoWe really should do just an improved textual comparison condition, i.e. improve the data comparison condition.
Comment #21
perusio commentedYes. But the fact remains that there's no condition for the current path, even if you extend the textual comparison condition o include the above mentioned operators. So I guess that the patch integrating pathrules is still useful. Is it not?
Comment #22
fagoIn the latest entity API, there is site:current-page:path or so, which you can use. So you probably don't need pathrules.
Comment #23
fagoad #20:
For 7.x, best I think this should be a separate condition that can focus on a textual comparisons and thus provide features like the regex match.
Comment #24
fagoI've implemented that as a "Text comparison" condition and committed it.