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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 14 years ago
Benoit's avatar
875
Benoit
asked 14 years ago

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 14 years ago, answered 14 years ago
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 (14 years ago)
It must be a POST request, because it changes data, with GET it will be "not kosher"
Evgeny's avatar Evgeny (14 years ago)
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 (14 years ago)
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 (14 years ago)
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 (14 years ago)
see more comments