I'm trying to create a user macro that will search a page's contents and replace certain keywords with whatever is passed into the body of the user macro. Figured I would need to be able to parse the page's contents, but I'm not sure how this is done. Any help would be appreciated!
You may be able to try $content which gains you access to ContentEntityObject, so something like this may work.
$content.getContainerContent()
The other method that might be easier is to just wrap all the content you want search with your macro, that basically all of the content is accessible via $body. Then you are free do all your substitutions and render as you see fit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.