code: def get_page_object_by_id(context, object_type, oid):
      
      if type(oid) != int:
          raise template.TemplateSyntaxError('page_object_by_id tag requires a integer argument')
  
      selected_object = None
  
      try:
          try:
              for obj in context['page']['content'][object_type]:
                  sid = '{0:>s}:{1:>s}:{2:>s}:{3:>d}'.format(
                      obj.language, context['page']['page'].name, obj.type, oid
                  )
                  if obj.sid == sid:
                      selected_object = obj
                      break
          except TypeError:
              pass
      except KeyError:
          try:
              try:
                  for obj in context['page']['ext_content'][object_type]:
                      sid = '{0:>s}:{1:>s}:{2:>s}:{3:>d}'.format(
                          obj.language, context['page']['page'].name, obj.type, oid
                      )
                      if obj.sid == sid:
                          selected_object = obj
                          break
              except TypeError:
                  pass
          except KeyError:
              raise template.TemplateSyntaxError('wrong content type: {0:>s}'.format(object_type))
      return selected_object
docs: **Arguments**
  
      ``object_type``
          object type
  
      ``oid``
          id for object selection
  
      :return selected object