Home discussions products about writing Projects

Open Source for Collaborative Knowledge Development and Learning

Note: This site's content is accessible to all versions of every browser. However, this browser may not support basic Web standards, preventing the display of our site's design details. We support the mission of the Web Standards Project in the campaign encouraging users to upgrade their browsers.


Blog Entry [details and replies]

KNotations :: Documentation and development plans from the KnowNet development team Weblog 84 entries 23-June-2006 1 authors
show or hide details for this item How-to specify new categories from an API client Blog Entry 0 replies 19-June-2005 Mike Malloch
Kind:
Blog Entry
Created:
19-June-2005 23:34:45
Last Updated:
20-June-2005 05:49:54
Author:
Mike Malloch
Status:
visible

Steve recently added a bit of a hack to allow API posts to specify new categories.

Users of knotes blogs who post through the web (TTW) will be used to adding new categories ad-hoc as they post. In the TTW form for editing posts, there is a widget for adding a new category and associating it with the post. (The new category is added to your personal categories - at some point we plan to implementt interfaces for negotiating the promotion of personal categories to blog-wide or portal-wide scoping, but that's another issue. :o)

Users who post with a weblog API client like blogjet or ecto, on the other hand, have had to specify their categories in advance, or edit their entries TTW after posting. There is no provision in the API specifications for creating categories when editing or creating posts: category association is taken to be a list-choice. If a category is not already on the list of categories for that blog (and you as an editor), you have to go to the weblog through the web and add it there.

Graham for one was finding this awkward; Steve has built a workaround. To associate an entry with a new category just insert it between a pair of

'<cat>...</cat>'

tags - anywhere at all within the body of the post.

. When you submit the entry, our API implementation will scan for these 'tags', and any new categories so specified will be added to the categories for the entry. The tags themselves will be removed from the text of the entry when the server processes it.

tags. Make sure of course that you are in a raw-html editing mode when you type in the <cat> and </cat> though - otherwise the tags come through encoded like '&lt;cat&gt;...&lt;/cat&gt;'and are not parsed as 'tags'.

Your client probably can help with this. In ecto, for instance, there is a Custom Tags feature ( on the toolbar, HTML tags in the Window menu, or command-shift-M ). See the attached screenshot Ecto-New-Category . Add the 'cat' tag to the list of special tags there (click the big + icon) and you can even assign it a keyboard shortcut. I just tried this: I added the tag and assigned command-option-c, and then tried adding it in rich-text editing mode...no dice. But in html-editing mode it was fine. The only downside is that the html parser in ecto did not, of course, recognise the tag and so would not let me back into rich-text mode. The ecto parser is not the brightest anyway ( it has trouble with some markup that I use a lot, like definition lists and the cite tag) and since I personally prefer to write in raw html this is hard for me to view as an issue. Just go into html=editing mode 'last thing' before posting, add the categories you want anywhere in the post, and submit. When the post comes back from the server, the tags will be gone but the category will be added.

Comments please

If you are already registered here, please click the "Login" button to send your username/password with the comment. Click the "Anonymous" button to leave a comment without logging in.

Please tell us who you are

E-Mail Address (Required)
We need a valid email address in order for you to post a comment. You will recieve an email containing a special validation link. The comment will not be published until validated
Name
Please leave your name
Title
Lead-in
Body Text ( HTML tags are allowed )
Validation
Please enter the text from the image above
Preview your comment