fantasticham Posted July 6, 2009 Share Posted July 6, 2009 I have a few articles that I would like to group together with tags. Like say I have two small articles I've written, I want both to have a tag bar full of words that define the page and when you click each word, it groups all the articles with the same tags. Similar to the "filed under" thing on escapistmagazine.com: http://www.escapistmagazine.com/news/view/92935-Tecmo-Koei-President-Concerned-About-Motion-Controls-on-360-PS3 I'm unable to find a way to do this. Any help is appreciated. Link to comment https://forums.phpfreaks.com/topic/164986-how-do-i-go-about-creating-tags-for-articles/ Share on other sites More sharing options...
p2grace Posted July 6, 2009 Share Posted July 6, 2009 There are a couple of ways of doing this. If you plan on allowing more than one tag to be assigned to an article, then create a tags table, and a tag_associations table. The tags table contains the actual tag while the tag_associations table creates the relationship between the tag and the article. If you are only going to allow one tag per article, then simply adding another field to the article called "tag" would be efficient. Then simply parse the table into a form and use $_GET['tag'] vars to display articles by category. Link to comment https://forums.phpfreaks.com/topic/164986-how-do-i-go-about-creating-tags-for-articles/#findComment-869979 Share on other sites More sharing options...
fantasticham Posted July 6, 2009 Author Share Posted July 6, 2009 There are a couple of ways of doing this. If you plan on allowing more than one tag to be assigned to an article, then create a tags table, and a tag_associations table. The tags table contains the actual tag while the tag_associations table creates the relationship between the tag and the article. If you are only going to allow one tag per article, then simply adding another field to the article called "tag" would be efficient. Then simply parse the table into a form and use $_GET['tag'] vars to display articles by category. I'd like more than one tag on each page, yeah. I'm pretty new to PHP and wouldn't really know where to start creating the table and grouping them together. I get the jist of what you're saying but I need it spelled out to me a little more. Sorry. Link to comment https://forums.phpfreaks.com/topic/164986-how-do-i-go-about-creating-tags-for-articles/#findComment-869986 Share on other sites More sharing options...
blueman378 Posted July 6, 2009 Share Posted July 6, 2009 well, your articles you mentioned, how are they stored & retrieved? Database? Link to comment https://forums.phpfreaks.com/topic/164986-how-do-i-go-about-creating-tags-for-articles/#findComment-870013 Share on other sites More sharing options...
fantasticham Posted July 6, 2009 Author Share Posted July 6, 2009 well, your articles you mentioned, how are they stored & retrieved? Database? No, they're just normal pages on a web server, I was just wondering if there was a way to group them together with tags. Link to comment https://forums.phpfreaks.com/topic/164986-how-do-i-go-about-creating-tags-for-articles/#findComment-870051 Share on other sites More sharing options...
p2grace Posted July 6, 2009 Share Posted July 6, 2009 How much do you know about mysql table construction? I'd begin by googling and practicing making mysql tables and querying them from php. Link to comment https://forums.phpfreaks.com/topic/164986-how-do-i-go-about-creating-tags-for-articles/#findComment-870052 Share on other sites More sharing options...
blueman378 Posted July 6, 2009 Share Posted July 6, 2009 How much do you know about mysql table construction? I'd begin by googling and practicing making mysql tables and querying them from php. Good advice, ATM it seems all your data is static which is fine except you would have to manually create a list for every single tag and update it manually, the other option which is more practical is to follow the above advice, dynamics are the core of a good php app. Link to comment https://forums.phpfreaks.com/topic/164986-how-do-i-go-about-creating-tags-for-articles/#findComment-870081 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.