• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
’Build a CMS in CodeIgniter’ tutsplus - Create a contact page or a gallery page

#1
[eluser]Lykos22[/eluser]
Hi I’d like some feedback please. I have created the CMS from the tutorial Build a CMS in CodeIgniter on tutsplus and what I'd like to do is to make some pages like Contact page or a Gallery page.

Well, the first thing I thought was to create those pages seperatly from the logic of the other dynamic pages, something like 'fixed' pages, but I'm not quite sure if this is the best way, as not all websites with cms have for instance a gallery.
Another thought was to create two more (in my example) dynamic pages, but their content should be different from other pages (a contact page should have a contact form and a gallery page should have lots of images/thumbs), but I 'm not quite sure how this can be done. Maybe asign them to a different template than other pages, like 'contact' or 'gallery' template??

Which is the best way to make this or is there another way better than these two??

#2
[eluser]Otemu[/eluser]
Hi,

The contact page is quite easy to create as a fixed page, normally a contact page is rarely updated so is very easy to maintain, creating it as a CMS page is not too difficult either, just have like you already suggested a "contact template", which you setup however you like and load whatever bits of data you like from the CMS.

The Gallery is ideal for a CMS page as it makes things much easier to maintain the CMS could allow for the following things:

image upload
batch image upload
auto thumbnail generation
captions
categories, etc

A Gallery is a bit more involved, depending on how many features you want to include, if your not too concerned about updating the Gallery then a fixed page is a quick solution.

From a CMS point of view, your need some kind of media management within the CMS, where users can upload images, probably store the paths of images, captions, alt tags within the CMS.

When setting up your gallery within the CMS, give the user the option to select images from media management, then render the gallery from whatever images the user has chosen. This is a simple solution and can be more complex depending on what your trying to achieve.




#3
[eluser]Lykos22[/eluser]
Hi and thanks for the reply! Well I guess you have also viewed this tutorial. The main idea is that all pages are dynamic-cms pages as you said, so the navbar at the front end is also dynamic, so I guess if I have to make some fixed pages (and not cms pages) I 'll also have to do and some small changes there.

[quote author="Otemu" date="1381771002"]
The contact page is quite easy to create as a fixed page, normally a contact page is rarely updated so is very easy to maintain, creating it as a CMS page is not too difficult either, just have like you already suggested a "contact template", which you setup however you like and load whatever bits of data you like from the CMS.
[/quote]

I agree with you that the contact page as a fixed page is a very easy and quick solution, which is something that I keep on my mind. The contact page as cms page is somthing that I can't figure out exactly how it should be done. In the admin panel (in the tutorial) there's a form that creates all pages with title, template, slug, body etc so the contact form would normally placed in the body-textarea. I could switch the wysiwyg editor to html and add the html code there, but this is not something that you would do in a real project, as most common users don't know coding. Even though I'm still in planning I have also not figured out how the "contact template" solution should be exactly working.

[quote author="Otemu" date="1381771002"]
The Gallery is ideal for a CMS page as it makes things much easier to maintain the CMS could allow for the following things:

image upload
batch image upload
auto thumbnail generation
captions
categories, etc

A Gallery is a bit more involved, depending on how many features you want to include, if your not too concerned about updating the Gallery then a fixed page is a quick solution.
[/quote]

With the Gallery what I'm having on my mind is two options.
1. A gallery that will look mostly like a portfolio page, where you can have a list of images with maybe a title, a description and links and also maybe some kind of lightbox
2. An image gallery page that wiil have a list of images with captions and lightbox effects too.
Well in both cases tha basic idea is that the main content of those pages are the images (which I usually put them in list tags) and less text, so I also guess the layout will be a little bit different than other cms pages.

[quote author="Otemu" date="1381771002"]
From a CMS point of view, your need some kind of media management within the CMS, where users can upload images, probably store the paths of images, captions, alt tags within the CMS.

When setting up your gallery within the CMS, give the user the option to select images from media management, then render the gallery from whatever images the user has chosen. This is a simple solution and can be more complex depending on what your trying to achieve.
[/quote]
Well if I go with cms pages I think I'll have to change the admin panel a little bit, so I guess I should have something like tabs, where in first tab I should have the main settings of the page (title, template, slug, body) and in second tab the media management, right? Else in case of fixed pages I could put the galleries in a seperate section of the admin panel.

#4
[eluser]noideawhattotypehere[/eluser]
Make your own plugin system, the best way to extend your CMs while still letting not-programmers embed galleries etc in pages

#5
[eluser]Otemu[/eluser]
Hi,

Building a cms can be quite complicated and so much can be involved, I would try and make it simple as possible or if you can use an already built solution.

Quote:Well I guess you have also viewed this tutorial.
Actually no I never looked at the tutorial, but I have worked with several different cms, also currently developing a simple custom cms. Most cms function with different template layouts within the cms.

Quote:The main idea is that all pages are dynamic-cms pages as you said, so the navbar at the front end is also dynamic

I find working with a cms navigation that is generated from its top level nodes and sub nodes automatically can be a bit inflexible at times, I find a custom generated cms menu more flexible, so within your cms a user could select any article/page or create a custom link for top level navigation and sub levels, the navigation will be then be generated from that custom list. If however you don't need that flexibility then auto generated is sufficient.

Quote:The contact page as cms page is somthing that I can’t figure out exactly how it should be done. In the admin panel (in the tutorial) there’s a form that creates all pages with title, template, slug, body etc so the contact form would normally placed in the body-textarea. I could switch the wysiwyg editor to html and add the html code there, but this is not something that you would do in a real project, as most common users don’t know coding. Even though I’m still in planning I have also not figured out how the “contact template” solution should be exactly working.

In most real world situations the cms wouldn't handle the contact us page, this would be something that would be custom built by the developers and the users would just have control over the text, you do have some cms that have form builders to handle various forms but I doubt your looking for that kind of level of functionality, if you are I explain how you can include that. You could do the contact page completely in the wysiwyg as you said above or you could create a custom view, with the form fields, when loading the page you check what template to use, if it using contact template then load that custom view and any text you need from the cms. Another option is to use macro style like umbraco does, where developers can build custom macro(modules) features for the user and then these custom functionality can simply be dropped in any of your pages.

Quote:Well if I go with cms pages I think I’ll have to change the admin panel a little bit, so I guess I should have something like tabs, where in first tab I should have the main settings of the page (title, template, slug, body) and in second tab the media management, right? Else in case of fixed pages I could put the galleries in a seperate section of the admin panel.
Have you looked at available cms, such as Joomla, Drupal, Umbraco etc? This will give you a good example of how cms are structured and work, then you could take certain aspects from them to build the cms how you want, there are online demos for joomla here http://demo.joomla.org/ and other cms have online demos too.

Normally media manager is a completely separate section in cms, which is purely for media management, with the tabs to add media would normally just be a button like add media or attach media.

You could create a custom gallery and contact controller, with custom views, if you need data from the cms for those pages, then these custom controllers can handle that, for instance the custom contact controller, would check if there is a page within your cms called contact, then load that data and add any other things that you have specified in your custom view, this way you keep the cms generic, as am sure you don't want to get in the habit of creating a new cms section for every time you need a new layout.






#6
[eluser]Lykos22[/eluser]
Thanks for the reply both of you.

@noideawhattotypehere: Could you be more thorough please?? Not sure what you mean.

@Otemu: Ok so if I understand you right, you are suggesting that it is better to keep my contact page apart from the cms-pages logic and always make it fix, right?
The page that will have my gallery/portfolio-gallery will be also in the cms-pages logic or should I also keep them apart??

As far as the navigation, this is generated from custom cms-pages list, including also parents and child pages-list items. So in case I go with some fixed contact and gallery pages, I guess I 'll have to keep 2 or 3 list-items (in case of using a 'home' page) of the navigation fixed and rest could be dynamic, right?
Something like:
Home(fixed) | About (cms page - dynamic) | Blog(cms page)| News(cms page)| Gallery(fixed) | Contact (fixed)

#7
[eluser]Otemu[/eluser]
Hi,

Well make the contact page a combination of cms and fixed, so the contact page will use cms fields such as title, meta, body etc but the fixed portion contact controller will load the actual form.

I would have an options in cms, called main menu and build your list from there, which would be a custom menu, but can include items from the cms and display as you said Home(fixed) | About (cms page - dynamic) | Blog(cms page)| News(cms page)| Gallery(fixed) | Contact (fixed)




#8
[eluser]JoostV[/eluser]
A flexible way to incorporate complex html elements into a CMS page is by building a shortcode library for them.

Once that's ready, a client can easily add a Google map by typing something like
Code:
[ai:maps address=1 Infinite Loop Cupertino]

There's a video tut online that shows you how to do that: codeigniter.tv/a-6/Create-a-Codeigniter-Wordpress-like-shortcode-parser. The tut's a little old and crappy, but it should get you on your way.

You can create a similar shortcode for a gallery.

Gallery admin handling shoudn't be too hard:
* a tabel of galleries
* a table of gallery images

#9
[eluser]Lykos22[/eluser]
@JoostV: Thank you for your reply! Definetly I will take a look at it and try to implement it on my needs. However I haven't reached to that point yet, but as soon as I get, I'll post on my topic for any feedback if needed.

I have also a question about the articles (blog-posts) and the cms pages. In case the content isn't always just a text, but also having some images or videos, which is the best way to implement that? To be more specific, I'm thinking of 2 options:

1st. To add an input field where I can upload files so I can display them above the content (text) at the front end.

2nd. I've set up tinymce on the textarea for typing the content of the page and as usually tinymce has a button for inserting image(s) and the option for adding videos, but has the ability to embed them with the text. The problem with that is ... I haven't done this before :-P , so I'm not quite sure how I can upload the image/video to my uploads folder through a wysiwyg editor.

#10
[eluser]JoostV[/eluser]
[quote author="Lykos22" date="1383075687"]
2nd. I've set up tinymce on the textarea for typing the content of the page and as usually tinymce has a button for inserting image(s) and the option for adding videos, but has the ability to embed them with the text. The problem with that is ... I haven't done this before :-P , so I'm not quite sure how I can upload the image/video to my uploads folder through a wysiwyg editor.[/quote]

Option 1 is easy to set up, but very inflexible. TinyMCE has a pretty good image and file upload plugin. It is a paid solution. You can find it at http://www.moxiemanager.com/


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.