First time here? Check out the FAQ!
2

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

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.

Evgeny's avatar
13.2k
Evgeny
updated 2011-02-02 12:08:04 -0500
Benoit's avatar
875
Benoit
asked 2011-02-02 09:59:28 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

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.

Evgeny's avatar
13.2k
Evgeny
updated 2011-02-02 12:38:53 -0500, answered 2011-02-02 12:11:57 -0500
edit flag offensive 0 remove flag delete link

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's avatar Benoit (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's avatar Evgeny (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's avatar Evgeny (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's avatar Benoit (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's avatar Evgeny (2011-02-03 16:58:57 -0500) edit
add a comment see more comments