0

How can I check if a single zoo content item is restricted and accessible only for registered users after login?
And after this check, apply this class into a div over in image?

.restrito {
    background-image: url(../images/restrito.png);
    background-repeat: none;
    width: 225px;
    height: 20px;
    position: absolute;
    z-index: 5;
    top: 5px;
}
0

All Zoo content items are avaiable in table #_zoo_item. All columuns from this table are accessible through the zoo template files:

/media/zoo/applications/blog/templates/TEMPLATE/reder/item/full.php /media/zoo/applications/blog/templates/TEMPLATE/reder/item/teaser.php

with this code:

$item_id = $this->_item->id;

You can access any data, by changing the column name:

$item_YOUR_VARIABLE = $this->_item->COLUMN_NAME;

In my case, checking for the access of the items, and display the div class="restrito" only for the posts with restricted access, I use this code:

$item_access = $this->_item->access;

<?php if ($item_access == "2") : ?>
       <div class="restrito"></div>
<?php endif; ?>

Where:

Public Access = "1"

Restricted Access = "2"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.