Wiki Plume Community : GettypeRessource

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Get type of ressource / récuperer le type d'une ressource:


By Pepper

In/Dans manager\frontinc\functions.php add / ajouter :


function pxGetLastResType()
{
    return $GLOBALS['_PX_render']['m']->lres->f('type_id');
}

function pxGetResType()
{
    return $GLOBALS['_PX_render']['m']->res->f('type_id');
}


Exemple for use in your category_homepage.php in a $last loop:

<?php
        if ('articles' == pxGetLastResType())
       {
        echo '<p><a href="';
        pxLastResPath();
        echo '">Read <cite>';
        pxLastResTitle('%s');
        echo '</cite></a>.</p>';
       }
?>


Exemple for use in your category_category.php in a $res loop:

<?php
        if ('articles' == pxGetResType())
       {
        echo '<p><a href="';
        pxResPath();
        echo '">Lire <cite>';
        pxResTitle('%s');
        echo '</cite></a>.</p>';
       }
?>
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.1
Page was generated in 0.1365 seconds