Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

[WIP] moving to Symfony2.1 and using the CMF for content rendering #6

Merged
merged 22 commits into from over 1 year ago

3 participants

Lukas Kahwe Smith David Buchmann Adrien Nicolet
Lukas Kahwe Smith
Owner

@adou600 @mjanser @leahaense great work

I have created the PR so that we can coordinate the finalization of the changes.
One thing I just noticed is that the stuff in app/tests should be updated to the new fixtures.
Also the README.md should be adjusted.

I havent tested it all, but from what I saw it looks like you guys did an awesome job.

David Buchmann
Owner

seems i can't comment on the file mode change, but why make .htaccess executable? that one makes no sense.

src/Cmf/MainBundle/Menu/CustomRenderer.php
((4 lines not shown))
  4
+ * This file is part of the Cmf\MainBundle
  5
+ *
  6
+ * (c) Lukas Kahwe Smith <smith@pooteeweet.org>
  7
+ *
  8
+ * This source file is subject to the MIT license that is bundled
  9
+ * with this source code in the file LICENSE.
  10
+ */
  11
+
  12
+namespace Cmf\MainBundle\Menu;
  13
+
  14
+use \Knp\Menu\Renderer\TwigRenderer;
  15
+use \Knp\Menu\ItemInterface;
  16
+use Knp\Menu\MenuFactory;
  17
+use \Knp\Menu\MenuItem;
  18
+
  19
+class CustomRenderer extends TwigRenderer
2
David Buchmann Owner
dbu added a note

should we not rather create a custom menu provider than a renderer? this has nothing to do with rendering...

Adrien Nicolet Collaborator

Works for me. However, I've never played with a menu provider before. Do you have any example somewhere, which works with the latest version of Symfony and the CMF?

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

there is also other files that go to 755 instead of 644 that should be changed back.

and one more question: why remove the compiled slidesets from web/slides/* ? afaik we do not provide them anywhere else and they are useful introduction.

Adrien Nicolet
Collaborator

I added the compiled slides in the web folder, the tests, readme and homepage have been updated. About the file permissions (755 instead of 644), can I do something about it? I'm not sure to get the problem...

I'm now waiting for instructions about the menu renderer...

Adrien Nicolet
Collaborator

I think the work is done. Tell me if you see anything that could be improved.
I'm just not sure how the site will behave on production, as I used it only with app_dev.php

.gitignore
... ...
@@ -1,6 +1,14 @@
1  
-/app/logs/*
2  
-/app/cache/*
3  
-/app/config/parameters.ini
4  
-/vendor/
5  
-/web/bundles/
6  
-/app/bootstrap.php.cache
  1
+composer.phar
  2
+web/bundles/
  3
+web/js/
4
Lukas Kahwe Smith Owner

why do you ignore web/js and web/css?

Adrien Nicolet Collaborator

because I thought it should be installed with app/console assets:install. but when thinking about it it would mean that someone cloning the repository should type that command before using the site. I will remove it.

Lukas Kahwe Smith Owner
David Buchmann Owner
dbu added a note

just for completeness: if we would use assetic, you would also want to ignore web/assets/ because assetic:dump renders js and css into that folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
web/reload-fixtures.php
... ...
@@ -0,0 +1,16 @@
1
Lukas Kahwe Smith Owner

please remove this file .. it was only meant for the sandbox to reset the fixtures in case someone broke things via the admintool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
David Buchmann dbu commented on the diff
src/Cmf/MainBundle/Menu/MenuProvider.php
((5 lines not shown))
  5
+use Knp\Menu\FactoryInterface;
  6
+use \Knp\Menu\MenuItem;
  7
+use Symfony\Component\DependencyInjection\ContainerAware;
  8
+use Symfony\Component\HttpFoundation\Request;
  9
+
  10
+class MenuProvider extends \Symfony\Cmf\Bundle\MenuBundle\Provider\PHPCRMenuProvider
  11
+{
  12
+    public function get($name, array $options = array())
  13
+    {
  14
+       if ('simple' == $name)
  15
+       {
  16
+           //get the internal pages of the website
  17
+           $menu = parent::get($name, $options);
  18
+
  19
+           //Home menu item
  20
+           $item = new MenuItem('Home', $this->factory);
2
David Buchmann Owner
dbu added a note

imho we can merge this, but:

@lsmith77 what do you think about this one? we could also have handled this like an "external" link but that sounds stupid and would be hardcoding information. eventually we should probably do something on the cmf MenuBundle to allow rendering the root of the menu as home link.

should we create a ticket on MenuBundle so we don't forget?

Lukas Kahwe Smith Owner

sure

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

looks good to me, thanks everybody who worked on this!

can we deploy like this on cmf.symfony.com or do we need to talk with somebody?

now the next step would be to add CreateBundle and do some editing :-) but then we need access protection...

Lukas Kahwe Smith
Owner

i can deploy it ..

David Buchmann dbu referenced this pull request in symfony-cmf/MenuBundle
Closed

Home link #15

Lukas Kahwe Smith
Owner

merged

Lukas Kahwe Smith lsmith77 merged commit f853036 into from
Lukas Kahwe Smith lsmith77 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.