Thanks
On Mar 6, 5:48 am, Loban Rahman <loban.rah...@gmail.com> wrote:
> Well, as I mentioned in my last email to the group, I was going to
> experiment to see if I could add multiple content areas to diem without
> breaking existing sites. I have to say that it was MUCH EASIER than I had
> expected, and I did NOT need to change any core diem code either!
>
> I've attached a patch file for anyone interested, or if someone would like
> to comment or provide constructive criticism. Note that it doesn't allow for
> customisable content and non-content areas (which was discussed earlier),
> just hard codes in some more content areas to allow more flexible layouts
> which have two content areas separated by a common area.
>
> Summary:
> *
> lib/model/doctrine/dmCorePlugin/DmArea.class.php*
> - Overloaded setTableDefinition() to allow more choices for the enum of area
> type. Formerly only top, bottom, left, right, content; it now includes
> content1, content2, middle, middle1, and middle2 added. The middle's are
> layout areas.
> - This could have been better done by over-riding the schema for dmArea, but
> I wasn't sure how to do that.
> *
> lib/model/doctrine/dmCorePlugin/DmLayout.class.php*
> - Added the extra layout area types to the protected variable $areaTypes
>
> *lib/model/doctrine/dmCorePlugin/DmPageView.class.php*
> - Overloaded setup() to make dmPageView have a one-to-many relation with
> dmArea, rather than a one-to-one. Hence it now has a the properties "Layout"
> and "Areas" instead of "Layout" and "Area"
> - Again this could have been better done by just over-riding the schema, but
> I wasn't sure how to do that.
> - Added some code copied from dmLayout (which already handles multiple
> areas), and also a method checkMissingAreas() that auto-adds any missing
> areas to a dmPageView upon saving it.
> - This is necessary because I wanted to be able to add this patch to project
> with already a lot of pages.
> *
> lib/model/doctrine/dmCorePlugin/DmPageViewTable.class.php*
> - Added a method that loads ALL dmPageViews and just resaves them,
> triggering the checkMissingAreas method above.
>
> *lib/model/doctrine/dmCorePlugin/DmPageTable.class.php*
> - Overloaded the checkBasicPages() method to also call the
> checkMissingAreas() method above.
> - Whenever "symfony dm:setup" task is run, one of the things it does is call
> checkBasicPages() to ensure that the 3 basic pages (login, error404, and
> home) exist. Now, it will also automatically upgrade the database to include
> all the newer areas on existing pages.
>
> *apps/front/modules/dmFront/templates/pageSuccess.php*
> - Add lines to render all the extra areas.
> - You will need to add them to all other xxxSuccess.php layout files as well
>
> *apps/front/lib/myFrontPageBaseHelper.php*
> - Overloaded renderArea() and getAreaTypeTagName() to overcome some
> assumptions that a pageView has only one content area.
> - Also set it as the value for "page_helper.class" in
> apps/front/config/dm/services.yml
>
> The best thing is that the current database layout did not need to be
> changed at all. So nothing existing has broken - just extra entries for
> dmAreas added and used. I also changed the CSS so that in edit mode,
> Layout-Zones are colored differently than Page-Zones, so that one can
> quickly identify which is which.
>
> I'm wondering if it would be worthwhile packaging this up as a
> dmAdvancedLayoutPlugin, where you have a config file to define what areas
> (name and whether its layout or page specific) you want, and the plugin sets
> things up automatically for you.
>
> Regards,
>
> *Loban Amaan Rahman
> Project Manager & Technical Lead
> HottMedia Limited*
> loban.rah...@hottmedia.com
> +8801611646613
> +8801711646613
>
> When the going gets scary, the scared get scarce.
>
> dmMultipleContentAreas.patch
> 11KViewDownload
I applied your path and I am getting this error
Unknown record property / related component "Layout" on "DmPage"
Do you have an idea as to why this might be.
I am running Symfony 1.4/Diem 5 RC5
Thank you,
Fotis
On Mar 6, 6:48 am, Loban Rahman <loban.rah...@gmail.com> wrote:
> Well, as I mentioned in my last email to the group, I was going to
> experiment to see if I could add multiple content areas to diem without
> breaking existing sites. I have to say that it was MUCH EASIER than I had
> expected, and I did NOT need to change any core diem code either!
>
> I've attached a patch file for anyone interested, or if someone would like
> to comment or provide constructive criticism. Note that it doesn't allow for
> customisable content and non-content areas (which was discussed earlier),
> just hard codes in some more content areas to allow more flexible layouts
> which have two content areas separated by a common area.
>
> Summary:
> *
> lib/model/doctrine/dmCorePlugin/DmArea.class.php*
> - Overloaded setTableDefinition() to allow more choices for the enum of area
> type. Formerly only top, bottom, left, right, content; it now includes
> content1, content2, middle, middle1, and middle2 added. The middle's are
> layout areas.
> - This could have been better done by over-riding the schema for dmArea, but
> I wasn't sure how to do that.
> *
> lib/model/doctrine/dmCorePlugin/DmLayout.class.php*
> - Added the extra layout area types to the protected variable $areaTypes
>
> *lib/model/doctrine/dmCorePlugin/DmPageView.class.php*
> - Overloaded setup() to make dmPageView have a one-to-many relation with
> dmArea, rather than a one-to-one. Hence it now has a the properties "Layout"
> and "Areas" instead of "Layout" and "Area"
> - Again this could have been better done by just over-riding the schema, but
> I wasn't sure how to do that.
> - Added some code copied from dmLayout (which already handles multiple
> areas), and also a method checkMissingAreas() that auto-adds any missing
> areas to a dmPageView upon saving it.
> - This is necessary because I wanted to be able to add this patch to project
> with already a lot of pages.
> *
> lib/model/doctrine/dmCorePlugin/DmPageViewTable.class.php*
> - Added a method that loads ALL dmPageViews and just resaves them,
> triggering the checkMissingAreas method above.
>
> *lib/model/doctrine/dmCorePlugin/DmPageTable.class.php*
> - Overloaded the checkBasicPages() method to also call the
> checkMissingAreas() method above.
> - Whenever "symfony dm:setup" task is run, one of the things it does is call
> checkBasicPages() to ensure that the 3 basic pages (login, error404, and
> home) exist. Now, it will also automatically upgrade the database to include
> all the newer areas on existing pages.
>
> *apps/front/modules/dmFront/templates/pageSuccess.php*
> - Add lines to render all the extra areas.
> - You will need to add them to all other xxxSuccess.php layout files as well
>
> *apps/front/lib/myFrontPageBaseHelper.php*
> - Overloaded renderArea() and getAreaTypeTagName() to overcome some
> assumptions that a pageView has only one content area.
> - Also set it as the value for "page_helper.class" in
> apps/front/config/dm/services.yml
>
> The best thing is that the current database layout did not need to be
> changed at all. So nothing existing has broken - just extra entries for
> dmAreas added and used. I also changed the CSS so that in edit mode,
> Layout-Zones are colored differently than Page-Zones, so that one can
> quickly identify which is which.
>
> I'm wondering if it would be worthwhile packaging this up as a
> dmAdvancedLayoutPlugin, where you have a config file to define what areas
> (name and whether its layout or page specific) you want, and the plugin sets
> things up automatically for you.
>
> Regards,
>
> *Loban Amaan Rahman
> Project Manager & Technical Lead
> HottMedia Limited*
> loban.rah...@hottmedia.com
> +8801611646613
> +8801711646613
>
> When the going gets scary, the scared get scarce.
>
> dmMultipleContentAreas.patch
> 11KViewDownload
Also myFrontPageBaseHelper is abstract, but that may be the DI in play
here.
Any help will be greatly appreciated.
Best Regards,
Fotis
<dmMultipleContentAreas1.patch><dmMultipleContentAreas2.patch>
<dmMultipleContentAreas1.patch><dmMultipleContentAreas2.patch>