Hi atmorell,

do you mean a CMS (that anybody can use) or you mean you (as a
developer) want to be able to manage the content?

Assuming the latter I would suggest handling things seperately, and as
such the tasks become much smaller

[EMAIL PROTECTED] wrote:

> Text and images should be stored in the database. Does anyone have a
> clue about how I should approach this?

Storing the text in a database, would just mean something that is (in
princple) very similar to the blog tutorial.
Storing images in the database is quite easy, if you generate the links
for your images in the form <a
href='/MyImageControllerName/Display/ImageID /> then if you create an
image controller, with a function display, that reads from the db the
image with the id ImageID, outputs the correct headers and dumps the
image data - that´s that task completed. 'MyImageControllerName' can
be anything, you could call it ImgController and for any file that
isn´t in your root /img/ folder, this controller would be triggered.

> I am thinking about creating a login form  - if a user has validated I will 
> display a
> modify/delete bottom below each element (text/image) - this logic will be 
> placed in
> each view!! (are this ok?) There will only be one admin user.

Acccess control would just mean (for example) setting a session
variable when someone logs in, and checking for this session variable
to display 'admin' content. You should also put a check in the
beforeFilter of your controller (or app controller if you want acl site
wide in one call) so that should anyone guess the right url they don't
get access to something they shouldn't. you could do something like
    if ($Session['MemberLoggedIn']) {
$this->renderElement("AdminActions"); }
In your view/layout to keep the views simple and the logic easily
seperable.

> So far I have created the following controllers:
>
> ccases  (customer cases),
> ccases_pictures (ccase_id, file_id)
> text (all text, e.g. about us, contact, description etc),
> files,

Assuming that you mean a CMS for a single site, you don´t need a text
controller, there is an inbuilt one named "pages" that is used to
display static content. It isn´t too difficult to create a controller
to edit your static pages, should that be required. A contact form
requires a form target and as such it´s best to give it it's own
controller.

> How do I put all this together? Should I create a page controller with
> one action for each tab? (forside, om-os, det-kan-vi, cases, kontakt)
> (translated: home, about-us, skills, cases, contact)

If you pages are static in nature (dont require controller logic) use
the pages controller. You can use routes such that /forside is
understood by cake to mean /pages/display/home.

I hope this helps answer some of your questions,

Cheers,

AD7six


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to