• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Managing Static Content with CodeIgniter

#1
As part of my application, I have a couple of static, marketing-related pages that promote the app and present a lot of text content.

I need a simple solution to manage and update the content of these pages (basically multiple text areas per page) and maybe generate a dynamic menu based on these static pages.

I don't need a full-blown CMS and neither do I want to reinvent the wheel by developing my own CMS. Just a simple library or class that I can quickly throw in to handle the described situation.

Would appreciate your advice how you deal with content management in the described situation with CodeIgniter.  Smile
Reply

#2
what you are describing is a CMS. so either you learn how to use one that is already built, or you put together the parts for what you need.
there are many cms using codeigniter.
https://github.com/search?utf8=✓&q=codeigniter+cms

if you want to put it together for what you need - if you haven't done the tutorial yet would recommend you do - it covers the first steps for basic content creation.
http://www.codeigniter.com/user_guide/tu...index.html

for basic styling of your text - your next decision will probably be whether to use in place editor for the page content - like tinymce
https://www.tinymce.com
https://github.com/search?utf8=✓&q=codei...rchresults

or use Markdown
https://en.wikipedia.org/wiki/Markdown
https://github.com/search?utf8=✓&q=codeigniter+markdown
Reply

#3
@cartalot, thanks for your response.

Yes, I have done the tutorials.

Which approach are you taking?

Using an existing CMS based on CI or roll your own classes?

As I mentioned, I really don't want to reinvent the wheel here or be stuck with a CMS-implementation that considerably changes default CodeIgniter. Within that CMS, it should be always possible to use the latest CI version.

Not sure which is the most popular CI-CMS. Any recommendations?
Reply

#4
There is no such solution to every situation. On some sites I code my own admin screens within CI to allow users to add content in a very conformal and constrained manner (usually to stop them adding the stupid things that they would try to add if given a full blown editor or CMS), on other sites I simply integrate an alternative CMS like wordpress or ModX, on other sites I give them the ability to add HTML, on some sites I give them the ability to modify database tables directly.

It all depends on entirley on the situation, the demands of your users, the scope of the build, the required editing scope, the nature of the need, the problem you are trying to solve. There is no single library (apart from the much needed CI5 mind reader interface http://forum.codeigniter.com/thread-6484...hlight=CI5) that will do this for you. Assess the needs of the site/users/budget/scope and implement a solution that fits (which may or may not be a pure CI solution).

Best wishes,

Paul
Reply

#5
(11-01-2016, 01:38 PM)PaulD Wrote: There is no such solution to every situation. On some sites I code my own admin screens within CI to allow users to add content in a very conformal and constrained manner (usually to stop them adding the stupid things that they would try to add if given a full blown editor or CMS), on other sites I simply integrate an alternative CMS like wordpress or ModX, on other sites I give them the ability to add HTML, on some sites I give them the ability to modify database tables directly.

It all depends on entirley on the situation, the demands of your users, the scope of the build, the required editing scope, the nature of the need, the problem you are trying to solve. There is no single library (apart from the much needed CI5 mind reader interface http://forum.codeigniter.com/thread-6484...hlight=CI5) that will do this for you. Assess the needs of the site/users/budget/scope and implement a solution that fits (which may or may not be a pure CI solution).

Best wishes,

Paul


@Paul, you are mentioning a couple of interesting ideas.

I had thought about using WordPress (for the marketing side) with CI (for the app). Not sure though how to integrate this. I usually build websites with the ProcessWire-CMS, which is great, because it does not restrict you on the front-end like WordPress and easily allows you to implement custom designs.

I guess the tricky part begins, when you try to call dynamic data from CI within your CMS on a static page. Also not sure how to organize routing to avoid system conflicts.

For this particular situation, I just need a couple of restrictive text-fields per page without any html-features.  

Will have to investigate this further...  Smile
Reply

#6
I have found that accessing a database such as one for WP via CI is not a problem, it is definitely and usually a problem accessing another db from within a CMS. One solution that worked very well for me with MoDx was to have both of them installed on the same database (their was no table conflicts as I controlled the tables for CI more directly) although a common login is a complex issue, it wasn't in this case as CI was only accessed by me, and all users went through the cms.

I have never had a conflict with WP in a subdirectory, and CI on the root. Also, accessing the WP database to get latest posts within CI was not really an issue either but you do need some WP knowledge.

WP is an awful system IMHO but they do certain things really well. I have no experience with ProcessWire but on a brief look just now it looks perfectly good. There are just so many available now and the standards get higher and higher.

As for a few restrictive non-html fields, I would definitely give them some admin pages within CI and some simple forms to add/edit data. Since I have done this many times, now it is just a case of re-using the same libraries and auth systems again and again.

For particularly simple things, I have recently taken to doing on screen editing for users, which is even better than an admin system. So if they are logged in as an admin, tiny edit icons appear on certain things like product titles, descriptions and prices. Clicking it brings up an ajax driven edit field so they can directly, on the page, edit the content. This is (once you get the systems and hang of it) actually relatively trivial to do, and the the users simply love it. I am actually using this quite extensively now and it really does make for a dynamic user experience but a controlled environment to stop users doing all the bolds, stupid text lengths and colours a normal editor field allows.

I have tried to get a more generalised ajax approach so all fields ultimately use the same ajax functions, but in reality it is much easier to extend via copy/paste/minor-edit a working function and just lump a more lengthy js file than try to create a generalised approach. After all, jquery et al have made their code so efficient it comes down to two functions of a few lines per edit field.

Any way, good luck with your approach, but rest assured, CI is ultimately the best, fastest and most efficient answer (unless you really need the CMS or WP functionality).

Paul.
Reply

#7
personally i always make my own and thats what i encourage people to do. or put another way - thats what a framework like codeigniter is for.
and its a great framework for building things.  

AND i always look on github first which is why i gave you those links. Basically take a library that is doing some of what you need -- and make it yours.

Also keep in mind - you can use anything that is written in modern php - its very easy to bring php libraries etc into codeigniter.
Otherwise if you do go for wordpress, and if its for a business, keep aware of the security implications.
Reply

#8
@Neo

For static pages try this solution...

http://forum.codeigniter.com/thread-6600...ght=Eureka

One of many static pages created by CodeIgniter and htaccess accessed before loading PHP, MySql, CodeIgniter, etc

http://www.johns-jokes.com/jotd/1378
download and make your system directory strict
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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