Rewrite HREF attributes on page before rendering

Delford Chaffin asked on September 16, 2014 23:49

If I need to modify certain links right before they go to the browser (but not permanently in the document), what would be the preferred way to do that?

I thought adding an event handler to CMSPage.OnBeforePageRender, but that didn't seem to work outside the Site Manager pages.

Any suggestions?

Thanks!

Recent Answers


Brenden Kehren answered on September 17, 2014 02:24

Here is a good reference to an output filter, although for an earlier version, I'm guessing you can come up with the minor API differences.

0 votesVote for this answer Mark as a Correct answer

Delford Chaffin answered on September 17, 2014 03:07

I thought about an output filter, but wasn't clear on when they were applied. Are they applied to the content when it is saved as part of the document or when the document is rendered to the screen. If the latter, then that will work fine.

Thanks

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 18, 2014 02:28

Rendered, hence "output" filter. ;)

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.