Search code examples
phptagstagging

How can I add TAGS to my existing non-cms website?


I was looking other day jealously at all the features that CMS-enabled WordPress sites have, and I realised one thing that I've missed out: tagging.

enter image description here

Is there any way I can have such a thing on my non-cms, non-database flat files php website? Which is basically bunch of web page files like home.php, contact.php, somepage1.php, somepage2.php, etc.

is this actually possible at all?

I was thinking of something like this:

  • each page includes tagsys.php
  • each page has footer with some tags banana, peach, tomato
  • the hyperlinks go respectively to /tags/banana, /tags/peach, /tags/tomato
  • since there are no actual files as banana / peach / tomato, the tagsys.php which is included, has to know how to sort of generate a new page, in which it captures the essence ($title and $descr) of every page with that tag, and so all could be automated.

Solution

  • You could also add an id to each page (it may be the filename, wich you can get using php : http://www.expertcore.org/viewtopic.php?f=67&p=1453)

    Then in your DB store create a table with a list of tags and another one to create a relation between your pages IDs and the tags.

    In this way you will be able to create a kind of "tag administration interface" easily.

    But as Brent Friar said, if possible, prefer upgrading to an existing cms, it's quite fast and easy, and it'll save you hours of maintenance!