0

How we can get the code of edited pages through the admin panel?

1
  • I want to find the code if even I made change in admin panel. E.g If i tried to make changes in content of home page in html editor through admin panel. Then how we can track that exact code written in html editor in files of magento. Nov 18, 2019 at 12:40

1 Answer 1

0

I assume that you want to track which admin user made changes in the CMS page (and at which date and time).

For this, you can create a module and observe the event cms_page_prepare_save or model_save_before (or maybe model_save_after) to get the information whether the data has changed or not.

In the observer class, you can use:

$object = $observer->getEvent()->getObject();

to get the object of event, and then use:

$object->getOrigData();

to get the data before saving.

and

$object->getData();

which is going to be saved.

I hope the above information is sufficient to start.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.