eZ Community » Forums » eZ Publish 5 Platform » eZ Publish 5 Tutorial
expandshrink

eZ Publish 5 Tutorial

eZ Publish 5 Tutorial

Saturday 02 March 2013 12:51:13 am - 8 replies

Hi all, 

I've been working on a series of blog posts covering the basics of building a site on the Symfony components of eZ Publish 5 (non-legacy). 

You can find the first 6 installments here: 

http://partialcontent.com/code/working-with-ez-publish-5-introduction

I'm trying to cover development, and not setup, so the tutorial works from a pre-built repo on github, with the steps being stored as branches so you can code along or just check out branches and review the code.

So far I've covered: 

  • High-level symfony/MVC overview
  • Building a main template
  • Assetic
  • Content-specific templates
  • Writing your own controller to handle sub-requests

Here are the items that should roll out in the next week or so:

  • Working with a PreContentView handler
  • Custom tags
  • Related objects

If anyone has time to try it out, I'd greatly appreciate feedback, either here or in the blog comments. I rolled out an early version to some of the US partners yesterday, and corrected some errors in the build based on that feedback, so if you tried something earlier, and it didn't make sense, have another look. 

Some things I'd like to know are: 

  • Is it easy enough to retrieve the tutorial and start working? 
  • Do the steps I'm outlining represent best practice for eZ5, or is there a better way?
  • What parts are confusing or in need of more explanation?
  • Did anything not work in the examples or tutorial steps?
  • What future steps could I add that would be interesting to you?

If you're an eZ 5 newbie, I hope this is helpful! If you're an eZ 5 veteran (if there is such a thing), thanks in advance for the input!

Modified on Saturday 02 March 2013 12:52:43 am by Joe Kepley

Sunday 03 March 2013 3:15:22 am

WOW That's exactly what I was looking for! Fantastic tutorial, I suggest you post it here in the tutorial section 'cause your forum post will be "lost" pretty soon, consider checking this link:

http://share.ez.no/learn/write-a-tutorial-win-an-award

Sunday 03 March 2013 1:22:42 pm

Thanks!

Now I am less afraid of ez5 migration! happy.gif Emoticon

Sunday 03 March 2013 1:29:19 pm

Quote from Thiago Campos Viana :

I suggest you post it here in the tutorial section 'cause your forum post will be "lost" pretty soon

I'll consider adding it to the tutorial section once I have a few more sections complete. 

I started this as an independent blog because the blog is developed on eZ 5, and the tutorial content is derived from the creation of the blog.

This provided me with a real-world use case to build the tutorial around. I wanted to make sure I was talking about what the software can actually do, not just what the doc says it can do, and building something real was a good way to do that.

Sunday 03 March 2013 10:06:28 pm

This is really great stuff Joe! Still reading it, but it could be the base for a future official tutorial on confluence (imo tutorials here on share are good, but have a tendency to not be maintained and a bit like forum post gets forgotten over time).

 

I'll add more comments if I find them, but so far:

  • Symfony post, MVC section: "Bundles, which are directories that organize code around specific aspects of the application. This is sometimes referred to as HMVC", Bundles is more the extension system, while "sub requests" are the hmvc concept in symfony(in Symfony 2.2 referred to as sub-framework).

Modified on Sunday 03 March 2013 10:14:40 pm by André R

Sunday 17 March 2013 5:31:32 pm

http://partialcontent.com/Code/Working-with-eZ-Publish-5-Setup

git checkout-b tutorial-1 tutorial-1

Gives an error. We can simple do: git checkout tutorial-1

Also got one error trying to install, but I just used my simplified apache config file and used a .htaccess file, just as I described in my installation tutorial.

Also:

http://partialcontent.com/Code/Working-with-eZ-Publish-5-Templates

The name of the bundle in the command isn't the same as in the images.

Another thing, after I created the pagelayout template and changed settings, I run the command:

php ezpublish/console assets:install --symlink web

Cleared the cache and I was still getting the old layout. But after changing to tutorial-2 branch, it worked. But if I try to change parameters.yml settings back to:

ezpublish_legacy.view.default_layout: eZDemoBundle::pagelayout.html.twig

And after I clear the cache it will not load the old templates, so I don't know what is this problem...

Modified on Sunday 17 March 2013 7:15:18 pm by Thiago Campos Viana

Sunday 17 March 2013 6:56:07 pm

Thiago, thanks for the feedback! I'll look at the problems and try to address them. Can you tell me a little about your environment (operating system, distro, PHP and apache versions)? 

Regarding the git command, there should be a space in there 'git checkout -b tutorial-1 origin/tutorial-1', I'll correct the doc. That both creates the branch based on the remote branch and checks it out. Just doing a straight checkout will likely only work if you've pulled the branch once before. 

It seemed easiest to do everything in one command but the downside is that you'll get errors from git if you run through it a second time. Let me know if there's a simpler approach. 

Sunday 17 March 2013 7:24:22 pm

Quote from Joe Kepley :

Thiago, thanks for the feedback! I'll look at the problems and try to address them. Can you tell me a little about your environment (operating system, distro, PHP and apache versions)? 

Regarding the git command, there should be a space in there 'git checkout -b tutorial-1 origin/tutorial-1', I'll correct the doc. That both creates the branch based on the remote branch and checks it out. Just doing a straight checkout will likely only work if you've pulled the branch once before. 

It seemed easiest to do everything in one command but the downside is that you'll get errors from git if you run through it a second time. Let me know if there's a simpler approach. 

Let's try to see if I am doing the right steps. Site is ok, I am using the simple layout, but in order to get the ezdemo layout back I am trying this:

1. Change the settings in parameters.yml:

from: ezpublish_legacy.view.default_layout: BlendTutorialBlogBundle::pagelayout.html.twig

to:  ezpublish_legacy.view.default_layout: eZDemoBundle::pagelayout.html.twig

2. Clear the cache:

php ezpublish/console cache:clear

Tried also with --env=prod

3. Reload the page.

And I am getting the same simple layout, not the ezdemo layout back again. So, looks like ez is ignoring my changes to parameters.yml.

EDITED: There were one mistake on my apache settings. but I changed, when I access the site with index_dev.php it works, but not without.

EDITED 2: After I changed .htaccess and cleared the browser cache it worked! Thanks again.

Modified on Sunday 17 March 2013 8:10:03 pm by Thiago Campos Viana

Saturday 06 April 2013 8:00:18 pm

Great work Joe !

One little question 

- How to restrict access to the routes managed by the controller ?

The old way was to add functionlist in the module.php of our dear extensions, and then using role/edit.

 

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from