Link tags?
hi Glen,
I'm trying to make a plugin that works as a social bookmarking feature (del.icio.us) by duplicating the Links database and adding tags. It works fine until I try to add the tags. With the tagging code adapted from page.class.inc added, the database isn't updated when I add or edit a link. No errors, it just doesn't add the new link.
Do you think what I'm trying to do is possible? Or will tagging only work with Pages?
I'm trying to make a plugin that works as a social bookmarking feature (del.icio.us) by duplicating the Links database and adding tags. It works fine until I try to add the tags. With the tagging code adapted from page.class.inc added, the database isn't updated when I add or edit a link. No errors, it just doesn't add the new link.
Do you think what I'm trying to do is possible? Or will tagging only work with Pages?
File Attachments
| Download | Info | Size (bytes) | Downloaded | Created |
|---|---|---|---|---|
| bookmark.class.inc.txt | More Info | 6,121 | 38 | July 15, 2006 08:06 |
The problem is that your add() and update() methods never actually add anything; they need to call the parent::add() and parent::update() functions, which actually add (or update) the data in the database.
That worked, but it still isn't writing the tags to the database, or if it is I don't know where. hmmm.
The tags are linked to the object via a link table; for example, in the default, there's a table that links tags to pages. It has a foreign key that requires a valid page_id to be correct. To do this, you'll need to create a table that links bookmarks to tags, similar to the PageTagLink class.
Very nice that someone else is playing. Glen, do you think we would be better served if links became a type of page? Perhaps a user choice of what type of page could be created, and that would drive what is displayed in the form. That way you could inherit all the properties of a page without the need to develop more tables/scripts. The only thing to plugin would be a new page type. So you stay within the folder-page-file model. Just a thought.
Coby
Yes, that's always a possibility. Make Link (or Bookmark, or whatever) a subclass of Page.
I gave up trying to give the links tags and just installed Scuttle in a subfolder. I'm now trying to merge it with Siteframe. We'll see how that goes.