Revisions
-
andrerom revised this gist
Feb 11, 2013 . 1 changed file with 1 addition and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,21 +4,13 @@ $locationService = $this->getRepository()->getLocationService(); $searchService = $this->getRepository()->getSearchService(); $urlAliasService = $this->getRepository()->getUrlAliasService(); $root = $locationService->loadLocation( 2 ); $query = new Query(); $query->criterion = new Criterion\LogicalAND( array( new Criterion\Subtree( $root->pathString ), new Criterion\ContentTypeIdentifier( array( 'folder', 'page', 'contact' ) ), new Criterion\Visibility( Criterion\Visibility::VISIBLE ) ) ); -
dpobel revised this gist
Nov 19, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -13,10 +13,11 @@ $ids[] = $typeService->loadByIdentifier( $identifier )->id; } $root = $locationService->loadLocation( 2 ); $query = new Query(); $query->criterion = new Criterion\LogicalAND( array( new Criterion\Subtree( $root->pathString ), new Criterion\ContentTypeId( $ids ), new Criterion\Visibility( Criterion\Visibility::VISIBLE ) ) -
dpobel revised this gist
Nov 19, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ ) ); $query->sortClauses = array( new SortClause\LocationPriority( Query::SORT_DESC ) ); $results = $searchService->findContent( $query ); $items = array( ); -
dpobel revised this gist
Nov 19, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ ) ); $query->sortClauses = array( new SortClause\LocationPriority( Query::SORT_ASC ) ); $results = $searchService->findContent( $query ); $items = array( ); -
dpobel revised this gist
Nov 19, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ <?php use \eZ\Publish\API\Repository\Values\Content\Query; $locationService = $this->getRepository()->getLocationService(); $searchService = $this->getRepository()->getSearchService(); -
dpobel revised this gist
Nov 19, 2012 . 1 changed file with 8 additions and 12 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ <?php use \eZ\Publish\API\Repository\Values\Content\Query, $locationService = $this->getRepository()->getLocationService(); $searchService = $this->getRepository()->getSearchService(); $urlAliasService = $this->getRepository()->getUrlAliasService(); @@ -11,22 +13,16 @@ $ids[] = $typeService->loadByIdentifier( $identifier )->id; } $query = new Query(); $query->criterion = new Criterion\LogicalAND( array( new Criterion\ParentLocationId( 2 ), new Criterion\ContentTypeId( $ids ), new Criterion\Visibility( Criterion\Visibility::VISIBLE ) ) ); $query->sortClauses = array( new SortClause\LocationPriority() ); $results = $searchService->findContent( $query ); $items = array( ); -
dpobel revised this gist
Nov 19, 2012 . 1 changed file with 10 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,14 @@ $locationService = $this->getRepository()->getLocationService(); $searchService = $this->getRepository()->getSearchService(); $urlAliasService = $this->getRepository()->getUrlAliasService(); $typeService = $this->getRepository()->getContentTypeService(); $identifiers = array( 'folder', 'page', 'contact' ); $ids = array(); foreach ( $identifiers as $identifier ) { $ids[] = $typeService->loadByIdentifier( $identifier )->id; } $query = new \eZ\Publish\API\Repository\Values\Content\Query(); $query->criterion = new \eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalAND( @@ -10,7 +18,7 @@ 2 ), new \eZ\Publish\API\Repository\Values\Content\Query\Criterion\ContentTypeId( $ids ), new \eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility( \eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility::VISIBLE @@ -34,4 +42,4 @@ foreach ( $items as $url => $location ) { echo "url: {$url} name: {$location->contentInfo->name}\n"; } -
dpobel revised this gist
Nov 19, 2012 . 2 changed files with 0 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,6 @@ $items[$locationUrl] = $location; } foreach ( $items as $url => $location ) { echo "url: {$url} name: {$location->contentInfo->name}\n"; 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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,6 @@ 2 ); foreach ( $items as $node ) { echo "url: {$node->attribute( 'url_alias' )} name: {$node->attribute( 'name' )}\n"; -
dpobel revised this gist
Nov 19, 2012 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,6 +11,9 @@ ), new \eZ\Publish\API\Repository\Values\Content\Query\Criterion\ContentTypeId( array( 1, 20, 21 ) ), new \eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility( \eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility::VISIBLE ) ) ); -
dpobel revised this gist
Oct 31, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ <?php $locationService = $this->getRepository()->getLocationService(); $searchService = $this->getRepository()->getSearchService(); $urlAliasService = $this->getRepository()->getUrlAliasService(); $query = new \eZ\Publish\API\Repository\Values\Content\Query(); $query->criterion = new \eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalAND( -
dpobel revised this gist
Oct 31, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ <?php $locationService = $this->getRepository()->getLocationService(); $searchService = $this->getRepository()->getSearchService(); $urlAliasService = $this−>getRepository()->getUrlAliasService(); $query = new \eZ\Publish\API\Repository\Values\Content\Query(); $query->criterion = new \eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalAND( @@ -30,5 +31,5 @@ // somewhere in a template foreach ( $items as $url => $location ) { echo "url: {$url} name: {$location->contentInfo->name}\n"; } -
dpobel revised this gist
Oct 31, 2012 . 2 changed files with 16 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -23,5 +23,12 @@ $location = $locationService->loadLocation( $hit->valueObject->contentInfo->mainLocationId ); $locationUrl = $urlAliasService->reverseLookup( $location )->path; $items[$locationUrl] = $location; } // somewhere in a template foreach ( $items as $url => $location ) { echo "url: $url name: {$location->contentInfo->name}\n"; } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,15 @@ <?php $items = eZContentObject::subTreeByNodeID( array( 'ClassFilterType' => 'include', 'ClassFilterArray' => array( 'folder', 'page', 'contact' ), 'SortBy' => array( array( 'priority', false ) ) ), 2 ); // somewhere in a template foreach ( $items as $node ) { echo "url: {$node->attribute( 'url_alias' )} name: {$node->attribute( 'name' )}\n"; } -
dpobel created this gist
Oct 30, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ <?php $locationService = $this->getRepository()->getLocationService(); $searchService = $this->getRepository()->getSearchService(); $query = new \eZ\Publish\API\Repository\Values\Content\Query(); $query->criterion = new \eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalAND( array( new \eZ\Publish\API\Repository\Values\Content\Query\Criterion\ParentLocationId( 2 ), new \eZ\Publish\API\Repository\Values\Content\Query\Criterion\ContentTypeId( array( 1, 20, 21 ) ) ) ); $query->sortClauses = array( new \eZ\Publish\API\Repository\Values\Content\Query\SortClause\LocationPriority() ); $results = $searchService->findContent( $query ); $items = array( ); foreach ( $results->searchHits as $hit ) { $location = $locationService->loadLocation( $hit->valueObject->contentInfo->mainLocationId ); $items[] = $location; } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ <?php eZContentObject::subTreeByNodeID( array( 'ClassFilterType' => 'include', 'ClassFilterArray' => array( 'folder', 'page', 'contact' ), 'SortBy' => array( array( 'priority', false ) ) ), 2 );