Do not show Unpublished Objects in frontend. Show the Objects only if i am logged in in Pimcore or click in objects on the Preview Button.
Last active
August 29, 2015 14:01
-
-
Save Gerhard-Kanzler/4063e04f752bcfcbdd6c to your computer and use it in GitHub Desktop.
Pimcore Objects not Published show some error...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $object = Object_Abstract::getById(intval($this->getParam('id'))); | |
| if( !$object || ( !$object->getO_Published() && !$this->editmode && !$this->getParam('pimcore_object_preview') && !$_COOKIE['pimcore_admin_sid'] ) ) { | |
| throw new Zend_Controller_Router_Exception("the requested object doesn't exist anymore"); | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Place this Warning in the frontend. Only a simple help for the user to see this is not yet published (Bootstrap Style) | |
| if( $_COOKIE['pimcore_admin_sid'] && !$this->detailObject->getO_Published() ){ ?> | |
| <div class="col-xs-12"> | |
| <div> | |
| <div class="alert alert-danger"> | |
| OBJECT NOT PUBLISHED | |
| </div> | |
| </div> | |
| </div> | |
| <?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment