Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

[WIP] Initial version of creating a basic CMS #303

Merged
merged 12 commits into from
Nov 3, 2013
Merged

Conversation

dantleech
Copy link
Member

This is a complete tutorial on creating a simple (or basic) CMS from the PHPCR-ODM Standard Edition distribution using the RoutingAuto bundle.

See https://github.com/dantleech/tutorial-basic-cms

This was originally conceived as a blog post, maybe it should stay that way... not sure if we want to add tutorials for RoutingAuto when it is still not tested in the field, but then again maybe this is a good way to get it into the field :)

  • Add XML, YAML and PHP examples as required.
  • Break out an article on "Getting started with PHPCR-ODM" - remove the dantleech sf doctrine-phpcr-odm-edition
  • Misc code fixes.
  • Add root route instructions.


The SimpleCmsBundle combines the route, menu and content into a single document and uses a custom
router. This approach will combine only the menu and content into a single document and the routes
will be managed automatically and the native CMF ``DynamicRouter`` will be used.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this is a legitimate simplification for the purposes of this article. SimpleCmsBundle uses a custom route provider and it also uses the standard DynamicRouter code .. but it does use a separate service.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am unsure if the reference to simplecms helps everybody here. maybe it would make sense to just describe the problem (route for content) and the solution (autocreate them). and then have a .. note:: saying "If you know the SimpleCmsBundle, you might notice that it takes a different approach...".

@dantleech
Copy link
Member Author

It would also be neat to add a "/" or homepage route. Is the best practice for this to add a redirect to routing.yml ? //cc @wouterj

@wouterj
Copy link
Member

wouterj commented Oct 21, 2013

The base routing node is the one that's used for routing

@dbu
Copy link
Member

dbu commented Oct 21, 2013

@dantleech are you using multilang? then you should use LuneticsLocaleBundle. if you don't then it depends. if your home page has content, have the route at /cms/routes point to your content. if you want to write a specific controller and have no content, using a symfony route would be the thing.

@dantleech
Copy link
Member Author

@dbu no multilang. I will add the route as you suggest.

  • I have split the article into 3 parts
  • Added a couple of images
  • Added **level**: Intermediate -- I remember seeing some articles somewhere which featured things like level, estimated time, etc. Good idea?

Still WIP.

@wouterj
Copy link
Member

wouterj commented Oct 21, 2013

Please use the symfony heading character standards.

Creating a basic CMS using the RoutingAutoBundle
************************************************

**Level**: Intermediate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imho such "level" indications help little. people will look at the cookbook entries for the things they want to do, regardless of level. what i do think is extremly useful is the rest of this intro telling what we do and which bundles we are going to use. that is helping me decide if i care about the tutorial.

if anything schematic, i would propose to formalize this, having a sort of heading table saying with sections Goals, Bundles Used, Prerequisites. the prerequisites would tell which book chapters you are supposed to already know in order to do this, so that we do not have to repeat how odm annotations work all the time and such things.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I indeed don't think this will be really valuable. If some knowledge is required, there should be a reference to a section explaining it in the text where it's required. Or something like a .. seealso:: directive.

@dbu
Copy link
Member

dbu commented Oct 22, 2013

coming good, this article. i like it!

can you break lines after 80 characters please?

travis tells that the link to routing-auto-bundle is not working.

@@ -0,0 +1,1066 @@
************************************************
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing index directive

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

share much of the same logic, so lets create a ``trait`` to reduce code duplication::

// src/Acme/BasicCmsBundle/Document/ContentTrait.php

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line

@wouterj
Copy link
Member

wouterj commented Nov 2, 2013

could you please remove all new lines after the file comment, except for the cases where the next line is a comment?

@dantleech
Copy link
Member Author

This PR is starting to become somewhat difficult to maintain. I hope that I have now fixed all the issues.

@wouterj
Copy link
Member

wouterj commented Nov 2, 2013

yes sorry, I switched a bit too much from commit commenting and PR commenting. If I find anything, I'll commit myself :)

There exists a bundle called :doc:`../bundles/simple_cms/index` which
provides a similar solution to the one proposed in this tutorial. It
combines the route, menu and content into a single document and uses a
custom router. This approach differs in that it will combine only the menu
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach => The approach taken in this tutorial will combine only the...

@wouterj
Copy link
Member

wouterj commented Nov 3, 2013

You forgot to include the file in the toctree of cookbook/index.rst and you also need to update cookbook/map.rst.inc and index.rst

@dbu
Copy link
Member

dbu commented Nov 3, 2013

yep, this is getting really long. can you add it to the index and maybe do the 2 content inputs i have (code comments above this comment)? then lets merge and we can still improve it further later on.

@dantleech
Copy link
Member Author

ok! I have done another read-through and addressed (I think) the outstanding comments. I'm good for this to be merged.

wouterj added a commit that referenced this pull request Nov 3, 2013
[WIP] Initial version of creating a basic CMS
@wouterj wouterj merged commit c811ae8 into master Nov 3, 2013
@wouterj wouterj deleted the creating_basic_cms branch November 3, 2013 20:54
@wouterj
Copy link
Member

wouterj commented Nov 3, 2013

  • Travis is happy
  • no todo's
  • dbu is happy
  • wouter still misses some XML config
  • merge!

Thank you! This must be our biggest PR till now! (I hope there is a badge for that...)

@dantleech
Copy link
Member Author

Yay. I am going to continue drinking red wine in celebration :) Thanks for all the CRs.

@dantleech
Copy link
Member Author

@wouterj
Copy link
Member

wouterj commented Nov 4, 2013

they are now working, uploading only happens at 2 AM european time, while the docs get updated 15 min. after merging

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants