Migrating from a CakePHP website

60 views
Skip to first unread message

tiofred

unread,
Apr 18, 2012, 12:05:15 PM4/18/12
to bed...@googlegroups.com
Hello everyone.
I have to migrate a CakePHP website where the content of the views has to be CMSed.
Say in a view there is a text and a picture, I have to make those editable by a non-developer.
In terms of content, there will be text, pictures and videos.
How can I proceed to make the current website a BEdita frontend and replace the text, pictures and videos by calls to BEdita data ?
I was also thinking I could make a section (which is a way to organize data right ?) for the overall-site data, and a section for each controller and a sub-section for each view.
I'm listening to any advice, remark, etc.
Thanks a lot!

Stefano Rosanelli

unread,
Apr 19, 2012, 4:20:51 AM4/19/12
to bed...@googlegroups.com
Hi tiofred,

I would suggest you to create the site structure in BEdita using
"publications" module for sections (which is a container/collection of
contents and it is usually used for organize them and to create menus in
frontend applications) then add "documents" and "multimedia" contents to
this sections.

For your frontend application I would suggest you to start with the
example frontends in BEdita package: html5.example.com for an HTML5
"dummy" frontend to use as a basis for new frontends, or wp.example.com
to have a look at a working example.

Access to sections, subsections and contents via urls is already handled
by BEdita, you don't have to care about that.
You may easily add your application logic to
controllers/pages_controller.php

Hope it helps.... if you need other suggestions or have other doubts,
please ask!

ciao
Stefano

bato

unread,
Apr 19, 2012, 6:46:45 AM4/19/12
to bed...@googlegroups.com
Hi tiofred and welcome on board!

I would also suggest you to have a look at frontend documentation at http://docs.bedita.com/frontends
In particular I will start with:
Since documentation still lacks of many parts I recomend you to ask, ask and ask.

tiofred

unread,
Apr 19, 2012, 8:56:57 AM4/19/12
to bed...@googlegroups.com
Hi Stefano and bato, thanks for your answers.
I've started creating a structure in the backend, where sections and subsections are corresponding to controllers and actions of the former site. That's fine.
I'm working on http://docs.bedita.com/frontends/understand-how-the-view-is-choosed which is a very interesting document.
I mostly gonna have to integrate existing views and match them to subsections.
Then, display matching content, and work on html/css so it looks good.
I won't hesitate asking other questions when they come to mind.
Suggestion :
a tiny tutorial on how-to migrate from a cake php site with multiple controllers to a BEdita frontend.
Thanks a lot guys!

bato

unread,
Apr 19, 2012, 11:13:05 AM4/19/12
to bed...@googlegroups.com
Il giorno giovedì 19 aprile 2012 14:56:57 UTC+2, tiofred ha scritto:
Suggestion :
a tiny tutorial on how-to migrate from a cake php site with multiple controllers to a BEdita frontend.

yeah it sounds a good idea! Well here's a super tiny tutorial written on the fly, so sorry I could have made some mistakes:
  • every controller shoud be a section with nickname equal to controller name 
    Example:
    CakePHP
    class CustomController extends AppController {
    }


    BEdita
    section nickname = custom

    Pay attention that while in CakePHP if you call /custom get a 'missing action' error (unless you have not defined a route rule for that call), in BEdita 'custom' is a section and it will be displayed without errors. If you want receive an error you have to throw it in your BEdita frontend app PagesController, for example adding a check in the callback beditaBeforeRender.

  • every action that displays a single content should be a content in BEdita as document, news, etc.. with nickname equal to action name
    CakePHP
    public function action() {
    }


    view reachable by /custom/action => views/custom/action.ctp 

    BEdita
    section nickname = custom
    content nickname = action

    view reachable by /custom/action displays the 'action' content that is inside 'custom' section. The view used is choosed following http://docs.bedita.com/frontends/understand-how-the-view-is-choosed

  • every action that displays more contents should be a subsection with those contents inside it
    CakePHP
    public function action($var) {
    }


    view reachable by /custom/action => views/custom/action.ctp 
    or view reachable by /custom/action/mycontent =>  views/custom/action.ctp 

    BEdita
    section nickname = custom
    subsection nickname = action
    content nickname = $var where all possible $var values should be contents nicknames or ids. It's strongly recommended the use of nicknames because of the canonical path you can see inside $section view variable are built using them.

    view reachable by /custom/action/mycontent displays the 'mycontent' content that is inside 'action' section that is inside 'custom' section. The view used is choosed following http://docs.bedita.com/frontends/understand-how-the-view-is-choosed
    If in $var

  • Done this you should adjust your views using the $section variable that you will find in every view.
Well I hope it's quite clear.
Reply all
Reply to author
Forward
0 new messages