Skip to content

Instantly share code, notes, and snippets.

@djoo
Created May 30, 2014 13:57
Show Gist options
  • Save djoo/30fee36463753c25c822 to your computer and use it in GitHub Desktop.
Save djoo/30fee36463753c25c822 to your computer and use it in GitHub Desktop.
Override content view embed link in eZ Publish 5
<?php
/**
* File containing the FooterController class.
*
* @copyright Copyright (C) 1999-2014 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
*/
namespace Djoo\DesignBundle\Controller;
use eZ\Bundle\EzPublishCoreBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use eZ\Publish\API\Repository\Values\Content\Query;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalAnd;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\ContentTypeIdentifier;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\ParentLocationId;
use eZ\Publish\Core\Pagination\Pagerfanta\ContentSearchAdapter;
use Pagerfanta\Pagerfanta;
class ContentViewEmbedController extends Controller
{
public function linkAction()
{
exit("link");
}
}
system:
ezdemo_site_clean_group:
content_view:
embed:
link:
template: "DjooDesignBundle:content/link:embed.html.twig"
controller: "DjooDesignBundle:ContentViewEmbed:link"
match:
Identifier\ContentType: [link]
@a-ast
Copy link

a-ast commented Mar 17, 2015

Hi Johann, it's a very nice trick, but I can't understand why it is not working for me. The controller is never called. Is this thing implemented only since eZ Publish 5.4?

@davidsayre
Copy link

Has this been solved yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment