Hit Report Asset
- Create a new asset type with type code hit_report and install it into your matrix system
- it should inherit from page
- it doesn't need any attributes other than the ones it inherits from page at this stage
- a good idea is to copy and modify an existing asset type, for example page_standard
- after you've created all the files for the asset type you need to run step 3 to install it to your system
- Code the asset type so that assets of this type print a heading saying "Hit Report" on the frontend
- Create an instance of the hit report asset in your matrix system, under a site, and view it on the frontend.
Hit Asset
- Create a new asset type with type code hit and install it into your matrix system
- it should inherit from asset
- it should have one text attribute called user_agent. By default, this attribute should say "Unknown"
- Using the asset map in the backend, create a few hit assets linked under your hit_report asset.
- You'll need to tell the hit_report asset type that it's allowed to have hits linked under it
Recording Hits
- Modfify the hit_report asset type so that on the frontend it lists the hit assets linked under it. In this list each HIT asset should display its ID and the 'user_agent' attribute.
- Modify the hit_report asset type so that each time you view its frontend, it creates a new hit_report asset under itself and fills in the user_agent attribute appropriately. User agent is the string that identifies the web browser used to access the page. See $_SERVER php global var reference.
- Add to the hit_report asset type's backend interface the ability to specify the colour in which you want the frontend content to be printed. You'll need to add an attribute of type 'colour'.
- Add a delete button next to each line in the hit_report's frontend display, that will send that hit asset to the trash. When the 'delete' button is pressed, you should not record a new hit and display a notification of successful deletion.
Show your work to the instructor before proceeding to the next exercise.