[PLANNING] Yii CMS - a different approach


(Asgaroth Belem) #21

This looks very promising, thanks for your contribution, im looking forward to test this and give you some feedback when i can.


(Tydeas Dr) #22

Waiting some roadmap update so I could contribute. dmtrs on github


(Leet) #23

Hey schmunk,

I just had a look at the GitHub - code. I don’t really get the difference to phundament. In Phundament you also rely on modules like SBARC. I took me only a few minutes to migrate phundament cms to my existing application, because I already had user management with access control.

Of course phundament has a lot of „too much“ functionality.

So what will be the difference with this approach to your existing phudament cms functions? Reduce complex functionality ?

When I tested the github-branch I played around with the widgets. I like the drag’n’drop usability a lot. Right now there is only the widget functionality.

So are you planning to integrate cells and content features as well?

Best regards from Munich,

peili


(Schmunk) #24

Hi peili,

Yes, you always need different modules. But they should be pluggable …

If you can leave SRBAC aside and only use phundament - thats wonderful, because it proves it’s ‘pluggability’ :)

In the current code there’s a P3AdminModule for installation of other modules.

And the P3WidgetModule which can create other widgets.

Content is created by any type of widget, but there are no modules for that included at the moment.

But I think another thing should be a P3ControllerModule, which serves as a dynamic controller, like P2Page in the old version.

The thing is, that this just a controller, but if you need to have a backend, you’ll usually end up in a module.

Hmmm, P3WidgetContainer should be the cell feature?!

Other features as mentioned above.

Modules for content should also be pluggable.

But I think I’ll add another module like P2Html, HTML editor plus file manager.

Best regards,

schmunk


(Schmunk) #25

Hi guys,

I’ve something for you.

https://github.com/schmunk42/phundament/archives/e58ea2f9a5366f8446add63e793f8711353dd40d

In the download itself you’ll find an app, based on the Yii webapp skeleton. To keep it slim, Yii itself is currently not bundled with the application.

See the INSTALL file for detailed instructions and have a look at the demo video:

You can watch this in 720p fullscreen on youtube, if you want to able to read a thing ::)

Some more words about the setup.

Even a small scaled application needs a user and a rights management. Therefore I’ve included the two existing module exentions ‘yii-user’ and ‘rights’, instead of writing or using my own extensions.

When using existing modules I’ve found it problematic that there’s always of different ways of installing the modules.

You have to configure it and for these two modules you also have to setup database tables. For example one module has an installer, but for the other one you have to create the tables manually.

This led me to the idea of writing a module which performs these schema setups with database migrations, to be honest a fairly new feature, so it’s clear that it is not widely used.

It’s very easy to create migration classes instead of sql dumps, there’s also already an extension command for that.

I added those to the modules ‘rights’ and ‘yii-user’, besides a default config file.

Another part which has been added to the release above is the P3WidgetContainer. Simply a widget which allows you to create other widgets. Check out the video for a detalied explanation.

While putting the pieces together I had to work around a few problems.

So I want to address these a bit in detail.

Layout / CSS

Problem:

Modules layouts are inconsistent

Solution:

  • conventions about CSS classes

  • a module should provide a <div class=“modulemenu”><?php $this->widget(‘CMenu’, …)?></div> for its internal navigation.

  • a module should have a link to it’s index page in the breadcrumbs

  • make use of the same layouts as yii application skeleton (column1 and column2)

Admin Role / User

Problem:

Modules use different defaults for administration credentials, user name, role, id, operations and tasks.

Solution:

  • Conventions :) user: ‘admin’, role: ‘Admin’, id: 1 (default superuser)

Installation / Configuration / Migrations (database schema)

Problem:

Same as above, they’re simply different.

Soluton:

  • provide default configs in the module, in /config. ‘main.php’ or ‘module.php’ depending on their array structure.

  • provide migration classes

Known Bugs / Limitations

  • widget ordering

  • request parameter handling not implemented

  • one-step only migration

  • yiic via exec()

For sure there will be more updates on this topic, but depening on my spare time for this project.

As mentioned in the postings above this first main goal is to create conventions for a let’s call it: ‘Yii Standard Application’, while the download provided above is only a setup of this app, called ‘phundament’.

Best regards,

schmunk


(Leet) #26

Hey there,

what about a Javascript HTML WYSIWYG editor integration for widgets.

It’s not really comfortable to create HTML - Code in a JSON String?

Best regards,

peili


(Schmunk) #27

Hi peili,

for sure that’s a planned feature.

I would also create a default JSON string from a reflection of the class properties entered under ‘alias’.

But creating HTML content should be done in a separate widget.

Best regards,

schmunk


(Schmunk) #28

To note one more thing about the JSON editor.

In phundament 2, widgets can provide a custom form for creating and/or selecting content, if they implement the ICellManager interface. I would add something similar into phundament 3.

Any thoughts about this?

Just because, if the HTML editor would be bundled with the current P3CellManager you should also include a filemanager for the editor, which tends to end up in bloated stuff.


(Schmunk) #29

Online Demo: http://demo.phundament.com/3.0-dev/

You can login with

admin / admin

May get broke :o

At this early development stage :)

I will check it from time to time or send me a message.


(Schmunk) #30

I’ve just released the P3WidgetModule in a stand-alone version here:

http://www.yiiframework.com/extension/p3widgets/


(Jacob Moen) #31

Sorry about the non-commenting, but I really like what you’re doing here. :)

I don’t mind if you keep it up. :lol:

I briefly checked it out, and it looks like a neat overall solution to managing an array of various modules/extensions.


(Leet) #32

Excellent with the content editor.

I’am using cmssitestructuremodule and I am having problems to include your widgets in the views.

First of all, inside a widget view "$this->widget" ist not working.

But also your p3widgets require a unique path for controller, which i cannot provide with cmssitestructuremodule.

Do you understand what i mean? Any ideas?

Another feature would be nice, to add existing widgets to view.

Best regards,

peili


(Soyhobo) #33

CMS demo ain’t working, could you update it please.

Besides download app is broken, there are missing files and configurations, like "The table "p3_widget" for active record class "Widget" cannot be found in the database."

p.s. where is p3widgets db schema?

No offense but this seems more like a personal app than a developer targeted cms.

Though don’t really get what phundament targets to, or what phundament actually is.

If you let me tell you some thoughts, this is what a serious CMS should have at its core:

-coding guidelines

-pages module

-users module

-basic configuration

-defined module/plug-in architecture for extending it

-backend for managing default modules (pages, users, etc.), developer modules, and the basic configurations.

-no frontend, and this is important, as developer will code this as views (perhaps providing a default theme), and with this i’m suggeting forgetting p3widgets for a moment at least, while other things get solved first.

The backend should be independent from frontend, each one having their own default themes.

I can help you with themming, but you have(if you want to of course) to work on those things.


(Leet) #34

I would suggest you read the beginning of this thread. I don’t think the author schmunk want’s to build an entire CMS application. More an approach to fill the gap for modules to build your own cms.

Best regards,

peili


(Soyhobo) #35

(Prone to erros) I think he’s trying to fill the gap of “everythime we need to start a web project and have to write from the very begin the very same widespread features cms’s contain”.


(Jon) #36

Just a note, when developing using DVCS such as git or mercurial, it’s typically simpler to create forks than branches.

Also, if you want people to be able to use new extensions or modules separately, I’ve found that creating a repository for each, and then including as a sub-repo in my main project has worked very well.

Just a couple of suggestions. Cheers


(Schmunk) #37

Thanks :)

I will check that.

I thought p3widgets would exactly do that?! :mellow:


(Schmunk) #38

As soon as possible.

Take a look at the README file or here: http://www.yiiframework.com/extension/p3widgets/#hh3

It’s in the migration class. So it’s db independent.

Phundament 2 was a complete app, phundament 3 will consist of seperate modules.

Please don’t mix up the complete GitHub Repo with the module available for download.

The application setup is described at the beginning of this thread.

… had to split because of quoting :(


(Schmunk) #39

Proposals in this thread.

Yes.

Yes, plenty very good ones available.

see this thread.

Very basic implementation in p3admin (GitHub Repo)

You can customize a module with Yii’s built-in themeing.

Cool. There are many parts which need work, also writing guidelines. You’re welcome to join, do you have GitHub Repo?


(Schmunk) #40

I want to get the most out of the existing Yii extensions, while keeping maximum flexibility for my own stuff.

But conventions are very important for modules to play together.