Ask Your Question
2

Is there a way to add an interesting tag via direct URL?

asked 2011-02-02 09:59:28 -0500

Benoit gravatar image

updated 2011-02-02 12:08:04 -0500

Evgeny gravatar image

Is it possible to use craft a URL that would add a tag to the "interesting" list without going through the UI?

We'd like to be able to have users click a link to automatically subscribe to certain tags.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-02-02 12:11:57 -0500

Evgeny gravatar image

updated 2011-02-02 12:38:53 -0500

It is possible right now if the request is of type "POST" and sent as Ajax, data must be in json format and the user must be logged in for that to work.

The url is /mark-tag/interesting/, and data sent as JSON.stringify({tagnames: tagnames}), where tagnames is an array of tags.

The javascript code lives in: askbot/skins/default/media/js/tag_selector.js, where function sendAjax runs the request.

edit flag offensive delete link more

Comments

Hmm...But it's not really possible to do that just as an embedded URL or an <a href="...">subscribe to interesting tag</a> is it?
Benoit gravatar imageBenoit ( 2011-02-02 14:08:35 -0500 )edit
It must be a POST request, because it changes data, with GET it will be "not kosher"
Evgeny gravatar imageEvgeny ( 2011-02-02 14:10:46 -0500 )edit
It may be possible to create some sort of a macro in the templates for the users who wish to create such customization.
Evgeny gravatar imageEvgeny ( 2011-02-02 14:12:44 -0500 )edit
I'm wondering if a URL that consumes a parameter and then does a post internally is feasible: something like .../subscribe-me/?tag=my-interesting-tag. The intent is to be able to send an email to a bunch of people with a link that allows them to subscribe to the same tag with minimal involvement on their part.
Benoit gravatar imageBenoit ( 2011-02-02 14:35:15 -0500 )edit
Well, to save the data that must be a post request, but it is possible to have the link lead to a screen with a "subscribe" button. I think it will actually be more liked by the users, because they will feel more in control this way.
Evgeny gravatar imageEvgeny ( 2011-02-03 16:58:57 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-02-02 09:59:28 -0500

Seen: 97 times

Last updated: Feb 02 '11