I've recently looked template code, that has following piece in it:
This code is located on item detail page and allows to check if page was accessed with existing item's ID.
I think there are 2 things about this code, that we can improve:
- name database table primary keys just as Id (this would allow easier code re-use without need to rename too much stuff)
- have special tag, like Exists or Loaded, that would just for that without need to use a database field name as input parameter.
Here is an example of transformed code: