Solved

I am trying to make a Content Management System by anylizing huffingtonpost.com

Posted on 2015-01-27
9
106 Views
Last Modified: 2015-01-28
I have never made a CMS before. I want the ability to place a varying number of images within the body of the text article on the page php will serve. So imagine a page top to bottom that has text, image, text, image, text and so on. Some pages may have a lot of images and some may have none.

I look at news paper sites like the huffington post to try and figure out how on earth they manage there content. I know there are programs like Word Press, but I just want something simple for my site.

So I look at the url: http://www.huffingtonpost.com/2015/01/27/iphone-6-sales_n_6557550.html
and I wonder do they store every news article as an html page in a folder directory like folder 2015 > folder 01 > folder 27 has the html. and store all images in one big image folder. There for the database does not hold the meet of the article. It holds only the title and image names?

Sometimes there is no .html at the end of the url. Does this mean the url fragments are for the sole purpose of accessing the database to retrieve the entire text of the article plus image names and a php template is used to contact the database and layout the whole article on the page?

Can someone with experience show me how this is done? Thanks.
0
Comment
Question by:kadin
  • 4
  • 3
  • 2
9 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40574370
A site like http://www.huffingtonpost.com/ is enormously more complicated than Wordpress.  URLs without 'html' are either directory names or they are translated to something else on the server.

If you right-click on the image and open it in a separate window, you can see the URL for the image.  A large site like http://www.huffingtonpost.com/ will normally use a 'cookie-less' domain to serve images.  A small amount of time is saved by not dealing with cookies on the image links.

http://www.huffingtonpost.com/ has dozens if not hundreds of people working for them.  Their list of 'news sources' at the bottom of the home page is more than 100.  The people who produce the articles probably have templates they use although I'm sure that the different departments have slightly different versions of the templates.

While analyzing http://www.huffingtonpost.com/ may give you some ideas, it would months if not years to duplicate what they have done.  No one person does a site like that.  The most important thing for your own purposes is to develop a plan that will accommodate all the things you want to do.
0
 

Author Comment

by:kadin
ID: 40574419
Thanks for the advice. That's very helpful. I shall develop a plan specific to my needs then.

The only other question I have regarding a simple CMS, is how to deal with a varying number of images intermixed in the article text. At the moment I am visualizing a CMS form that has - multiple - text inputs, each representing just a few paragraphs of the long article (a block of text). The database would have to have multiple separate columns that represents each article text block. Some articles have just one block of text and no images, other articles have a lot more.

And then another form to upload images. Maybe each image would be named with a number that can later be read by php to place each image in the right location between each article text block. Remember, the number of article text blocks and number of images in the page vary from page to page so the php page that delivers the article must somehow be dynamic.

Any thoughts on how I might go about this?
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40574509
I think storing it all in the database is probably not a good idea.  I would use separate page files and put only the reference information in the database so you can look up the articles.  If you are only going to have small articles like is normal in Wordpress, I guess storing them in the database is ok.  Having many large articles like http://www.huffingtonpost.com/ is a different situation.

The article editor for Wordpress lets you insert images into the articles.  I believe the image upload is part of that editor.  http://www.huffingtonpost.com/ probably uses a similar but more powerful article template page to enter their articles.
0
 

Author Closing Comment

by:kadin
ID: 40574544
Thanks for your help.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40574657
You're welcome, thanks for the points.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40574972
No points for this, please, but building a CMS from scratch is kind of like building a car from scratch.  Others have already done it, and your results are likely to be suboptimal if you don't have substantial financial backing and experience, because you're going to need to hire a lot of programmers to catch up to the status of the current standards in the open source community.

The Huffinton Post site is an aggregator, bringing together several data sources.
http://builtwith.com/huffingtonpost.com

These are the state-of-the-art CMS systems:

Drupal, Joomla, WordPress.  Drupal is the "industrial strength" tool.  WordPress powers about 25% of the internet, from the very smallest blogs, right up to major newspapers.  Joomla is still in wide use, but is not as popular as the others.

If you look at those three and you're still interested in a "build-your-own" solution, then you probably want to start with a platform instead of trying to write all the code yourself.  The current state-of-the-art platform is Laravel.
0
 

Author Comment

by:kadin
ID: 40576452
Thanks for that Ray.

Your right. Starting from scratch can be a colossal undertaking, I just spent 4 years building my very first site.

What I did not mention above is that I am not starting from scratch. Most of my site is done already. I just needed to find a way to program a form that can upload a text article and images and present them intermixed together in unpredictable ways on a web page instead of presenting as a consistent pattern. I was unsure if newspaper sites stored there articles as html files on their server or store them in a database. And if they store them as an html file, how does that work exactly. I am assuming a php program can be written that can collect a text article and images via a form put it together as an html file and save it on the server. I was about to research that now.

If I were starting from scratch, I would go with WordPress or Laravel as per your advice.
0
 

Author Comment

by:kadin
ID: 40576504
Now that I think about it maybe I can just save it as a php file and include it that way.

require_once '/home/bla/bla/my article_with_images_file.php';
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40576622
Given that you already have a good foundation, you might want to look into how WordPress does it.  You can join their site and mailing list.  They use the database to store the information.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now