This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » eZ Publish 5 Platform » Custom Backend Practices
expandshrink

Custom Backend Practices

Custom Backend Practices

Thursday 16 January 2014 12:39:42 pm - 3 replies

Hi,

I've been writing a custom backend for eZ Publish 5 using the Public API and I opted for creating custom controllers, such as the code at the bottom.

I've noticed that the eZ Publish generated URLs can still be used to browse the folder, which uses the demo theme (/Content/BlogArticles)

Should I have themed those pages instead of creating the custom controller? Is there a "right way" and is it possible to remove the folder demo theme pages?

Sorry if I've not explained this correctly

/**
  * @Route("/blog")
  * @Template
  */
public function indexAction() {
    $query = new Query();
    $query->criterion = new Criterion\LogicalAnd(array(
        new Criterion\ParentLocationId(67),
        new Criterion\ContentTypeIdentifier(array('blog_article'))));
 
        $blogArticles = $this->getRepository()->getSearchService()->findContent($query);
        return array('blog_articles' => $blogArticles);
}
blog_article:
    template: Bundle:BlogArticle:node_list.html.twig
    match:
        Identifier\ContentType: blog_article

Modified on Thursday 16 January 2014 12:41:06 pm by David McKay

Thursday 16 January 2014 1:53:26 pm

Hi David

I'm not sure of what you want to do here...

Thursday 16 January 2014 1:56:12 pm

I am building a custom backend and I want a page that displays all the blog posts in a folder. I've done it by adding a Controller and using Criterion to find content inside the folder of the type blog_article.\

Is this correct or should I be theming the pages created by Ez Publish?

Thursday 16 January 2014 3:40:04 pm

If your backend does not run on a separate siteaccess, I would suggest you use your own urls instead of url alias which would then point to frontend, aka my_backend/my/route/something/<content_id>[/..]

Modified on Thursday 16 January 2014 3:41:14 pm by André R

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from