Drupal rules hardcode selector1/1/2024 Note: There are also several ways to use the Rules module (possibly in conjunction with one of these solutions), but I did not investigate Rules-based solutions in this collection of ideas. While I did not review all of them, below are reviews of a few of the most widely-used solutions. This could encompass anything from a very simple system, like a fixed list of users or roles who are always notified, all the way to complicated systems that allow users to select which content types they want to be notified about, maybe even allowing them to subscribe and unsubscribe from specific nodes.Ĭlarifying the answers to these questions will help define the solution you need and which module(s) might be options for your situation. There are dozens of modules that have some sort of ability to send emails to users.This could also be a digest of multiple changes over time. It might include a summary of the node content, or the entire content of the node could be sent in the email. Notifications could be just messages saying that the node has been created, changed, or published.Is it both possible and feasible for the web server to be responsible for delivering the notification? Does a separate server need to deliver the mail, or perhaps a third party mail delivery service needs to be used?Īssuming that they should be notified by email, there could also be a long list of other options available.This could be immediate, sent to a queue and processed on cron, or scheduled for a specific time.A message might be initiated every time the action happens, or postponed and accumulated into a digest of activity that goes out once a day or once a week or once a month. A little simpler, but it could be when the node is created, when it is published, or when it is commented on.So many options! It could be an editor, the author, all site users, all site users of a given role, a specific list of users, anyone who commented on the node, or anyone who subscribed to the node.The first step in assessing solutions is to identify the specific need by asking the following questions: Who needs to be notified? Mail the content of a node to site users when content is created or updated.Send notifications to site users when content is commented on.Send notifications to administrators when content is created or updated.Send notifications to authors when users comment on it.Send notifications to authors when their content is published.This sounds basic, but there are a lot of questions. What exactly needs to be accomplished? Some examples could include: Conditions are condition plugins, such as page path pattern, current user role, current language or, even, the type of the node, when the page is a node canonical page.Īs my theme selection is mainly based on routes, all I have to do is to install Route Condition and Theme Negotiation by Rules modules and to use the UI to define my theme rules.Site owners and administrators often want to send emails to users telling them about content creation or changes. Each rule contains the theme, and the conditions to be met in order to show the that theme. The Theme Negotiation by Rules module allows a site builder to show pages using different themes based on rules. There's no way to add arbitrary conditions, such as a route condition, which is the one I'm more interesting in.Īs proposing a change to the existing module would have been a too disruptive and hard to address in terms of backwards compatibility issues, I've built the Theme Negotiation by Rules module, which has and open architecture, allowing third-party modules to hook in by providing condition plugins. The big impediment with this module is that it mainly checks the page path. I've looked around for a Drupal module that knows to render a certain page using a specific theme and found Switch Page Theme. During the transition, some pages will be still displayed using the the old theme. Sooner, the European Commission Drupal project I'm working on, will transition to a new theme.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |