Jump to content
xisto Community
Sign in to follow this  
True2Earn

A Simple Way To Maintain Many Webpages Without A Cms

Recommended Posts

Here is a very simple way to maintain many webpages without using a content management system (CMS). One of the advantages to this is you can change templates very easily. Your article would be in a separate file, for an example we'll create a file called my_page_article.php

<?$PageTitle = "My Page";$articleDescription = "This is my page";$articleTitle = "All about my page";$articleKeywords = "my page";$articleBody  ='<strong>Welcome to my page.<br>This is <a href="http://google.com; target="_blank">Google</a>!</strong>';?>
Next, we design a template and enter our variables where we want them. As an example and to save space, here is a very plain template. For our article above we'll name it my_page.php

<? include ("article.php"); ?><html><head><title><? echo "$pageTitle"; ?></title><META NAME="description" CONTENT="<? echo "$pageDescription"; ?>"><META NAME="keywords" CONTENT="<? echo "$articleKeywords"; ?>"><META NAME="revisit-after" CONTENT="7 days"><META NAME="robots" CONTENT="index, follow"><META NAME="rating" content="general"><META NAME="distribution" content="global"></head><body><p><? echo $articleTitle; ?></p><p><? echo $articleBody; ?></p></body></html>
Such a simple template system as the above can be expanded upon to use mySQL to store all the info instead of the first file listed above. But, for a quick and dirty way of getting a large number of pages up in a short time, this works pretty well.

But now you're probably saying, "ok, now I have 100 pages all ready to upload. What about an index page?" No problem! We'll make the index.php like this

<? $indexTitle = "My Page Index";$pageDescription = "This is my page index";$pageKeywords = "my page,my index';$articleTitle1 = "My 1st Article";$articleLink2 = "my_article_1.php;$articleDecrip_1 = "Learn all about apples and oranges";$articleTitle2 = "My 2nd Article";$articleLink2 = "my_article_2.php;$articleDecrip_2 = "Learn all about peaches and pears";$articleTitle3 = "My 3rd Article";$articleLink2 = "my_article_3.php;$articleDecrip_2 = "Learn all about rocks and rolls";<html><head><title><? echo "$indexTitle"; ?></title><META NAME="description" CONTENT="<? echo "$pageDescription"; ?>"><META NAME="keywords" CONTENT="<? echo "$pageKeywords"; ?>"><META NAME="revisit-after" CONTENT="7 days"><META NAME="robots" CONTENT="index, follow"><META NAME="rating" content="general"><META NAME="distribution" content="global"></head><body><a href="<? echo $articleLink1 ?>"><? echo $articleTitle1; ?><br><? echo $articleDescription1; ?><br><br><a href="<? echo $articleLink2 ?>"><? echo $articleTitle2; ?><br><? echo $articleDescription2; ?><br><br><a href="<? echo $articleLink3 ?>"><? echo $articleTitle3; ?><br><? echo $articleDescription3; ?><br><br><!-- you can add more pages by doing this --><a href="index.php">1</a> - <a href="index-2.php">2</a> - <a href="index-3.php">3</a></body></html>
and there's your template/guideline for making an index page for all your articles.

Share this post


Link to post
Share on other sites

Looks good though some people dont like to use single quotes will have to slash their double quotes (EX: " will be \") which you will have to do if you use the code from my_page_article.php

$articleBody  ='<strong>Welcome to my page.<br>This is <a href="http://google.com; target="_blank">Google</a>!</strong>';
The easisest and most user friendly way would to have the information they want as the body to be stored in a MySQL database. Then just retrieve the data and set it as $articleBody and it'd work just as great but with no hassle :).

Share this post


Link to post
Share on other sites

Yes this is a nice solution. But please think about it for a second. Is it really worth the time and effort? That method could be viable if your time costs nothing. In any other case you are better off using mysql. God forbid that your site would be successful and would become bigger in size. Who would administer all that content I do not know. Still - a nice exercise in clean design.

Share this post


Link to post
Share on other sites

If you think about it. This is like manual-CMS. Nice planned-out alternative, though. May be useful for many.

Share this post


Link to post
Share on other sites

Here is a very simple way to maintain many webpages without using a content management system (CMS). One of the advantages to this is you can change templates very easily. Your article would be in a separate file, for an example we'll create a file called my_page_article.php

<?$PageTitle = "My Page";$articleDescription = "This is my page";$articleTitle = "All about my page";$articleKeywords = "my page";$articleBody  ='<strong>Welcome to my page.<br>This is <a href="http://google.com; target="_blank">Google</a>!</strong>';?>
Next, we design a template and enter our variables where we want them. As an example and to save space, here is a very plain template. For our article above we'll name it my_page.php

<? include ("article.php"); ?><html><head><title><? echo "$pageTitle"; ?></title><META NAME="description" CONTENT="<? echo "$pageDescription"; ?>"><META NAME="keywords" CONTENT="<? echo "$articleKeywords"; ?>"><META NAME="revisit-after" CONTENT="7 days"><META NAME="robots" CONTENT="index, follow"><META NAME="rating" content="general"><META NAME="distribution" content="global"></head><body><p><? echo $articleTitle; ?></p><p><? echo $articleBody; ?></p></body></html>
Such a simple template system as the above can be expanded upon to use mySQL to store all the info instead of the first file listed above. But, for a quick and dirty way of getting a large number of pages up in a short time, this works pretty well.

But now you're probably saying, "ok, now I have 100 pages all ready to upload. What about an index page?" No problem! We'll make the index.php like this

<? $indexTitle = "My Page Index";$pageDescription = "This is my page index";$pageKeywords = "my page,my index';$articleTitle1 = "My 1st Article";$articleLink2 = "my_article_1.php;$articleDecrip_1 = "Learn all about apples and oranges";$articleTitle2 = "My 2nd Article";$articleLink2 = "my_article_2.php;$articleDecrip_2 = "Learn all about peaches and pears";$articleTitle3 = "My 3rd Article";$articleLink2 = "my_article_3.php;$articleDecrip_2 = "Learn all about rocks and rolls";<html><head><title><? echo "$indexTitle"; ?></title><META NAME="description" CONTENT="<? echo "$pageDescription"; ?>"><META NAME="keywords" CONTENT="<? echo "$pageKeywords"; ?>"><META NAME="revisit-after" CONTENT="7 days"><META NAME="robots" CONTENT="index, follow"><META NAME="rating" content="general"><META NAME="distribution" content="global"></head><body><a href="<? echo $articleLink1 ?>"><? echo $articleTitle1; ?><br><? echo $articleDescription1; ?><br><br><a href="<? echo $articleLink2 ?>"><? echo $articleTitle2; ?><br><? echo $articleDescription2; ?><br><br><a href="<? echo $articleLink3 ?>"><? echo $articleTitle3; ?><br><? echo $articleDescription3; ?><br><br><!-- you can add more pages by doing this --><a href="index.php">1</a> - <a href="index-2.php">2</a> - <a href="index-3.php">3</a></body></html>
and there's your template/guideline for making an index page for all your articles.
nice

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.