{if $attachment instanceof \openvk\Web\Models\Entities\Photo}
{if !$attachment->isDeleted()}
{var $link = "/photo" . ($attachment->isAnonymous() ? ("s/" . base_convert((string) $attachment->getId(), 10, 32)) : $attachment->getPrettyId())}
{else}
{/if}
{elseif $attachment instanceof \openvk\Web\Models\Entities\Video}
{elseif $attachment instanceof \openvk\Web\Models\Entities\Post}
{php $GLOBALS["_nesAttGloCou"] = (isset($GLOBALS["_nesAttGloCou"]) ? $GLOBALS["_nesAttGloCou"] : 0) + 1}
{if $GLOBALS["_nesAttGloCou"] > 2}
{_open_post}
{else}
{include "post.xml", post => $attachment, compact => true}
{/if}
{else}
{_version_incompatibility}
{/if}
{php $GLOBALS["_nesAttGloCou"] = NULL}