7

I would like to be able to use a referral link to Q&As but still have the question title visible somehow.

Currently there does not seem to be a way to construct a URL such as this.

For example, here I've attempted to insert my ID at the end of a long URL in the same manner as the share link:

https://stackoverflow.com/questions/2745265/is-listdog-a-subclass-of-listanimal-why-arent-javas-generics-implicitly-p/2745301#2745301/2891664

But this takes us to the question, not the answer, so it appears to be invalid. (At least for answers. Does it succeed for questions?)

Another (possibly better) option could be to implement a tooltip for Q&A links that shows the question title:

You may know that <a href="https://stackoverflow.com/q/2745265" title="Is List<Dog> a subclass of List<Animal>? Why aren't Java's generics implicitly polymorphic?">a <code>List&lt;Dog&gt;</code> is not a <code>List&lt;Animal&gt;</code></a>, so ...

(I don't really know HTML so I apologize if the snippet is somehow an incorrect way to write a tooltip.)

I realize this is a small thing, but I like for people to be able to see where I am linking them to, and at the same time I'd like to participate in the track for the badge.

I usually just try to use phrasing such as 'See Jon Skeet's answer to "Is List<Dog> a subclass of List<Animal>? Why aren't Java's generics implicitly polymorphic?".' but it's inflexible and distracting.

1
  • 3
    Appending the slug to the end after a question mark seems to work, like so: http://meta.stackoverflow.com/q/290643/246246?show-question-titles-for-publicist-track-referral-links - Bit hacky looking but it does get the title in there without much work.
    – animuson StaffMod
    Commented Apr 18, 2015 at 0:20

1 Answer 1

3

It appears that we can use the following workaround for a long referral link:

http://stackoverflow.com/questions/2745265/2891664?is-listdog-a-subclass-of-listanimal-why-arent-javas-generics-implicitly-p/2745301#2745301

Thanks, @animuson for the hint. Would be nice to get a confirmation that a constructed link like this contributed to the badge track. (As a primarily non-web programmer, I don't know how it works in the first place.)

Also, title attribute appears to be enabled for markup:

You may know that <a href="https://stackoverflow.com/questions/2745265/2891664?is-listdog-a-subclass-of-listanimal-why-arent-javas-generics-implicitly-p/2745301#2745301" title="Is List&lt;Dog&gt; a subclass of List&lt;Animal&gt;? Why aren't Java's generics implicitly polymorphic?">a <code>List&lt;Dog&gt;</code> is not a <code>List&lt;Animal&gt;</code></a>, so ...

You may know that a List<Dog> is not a List<Animal>, so ...

I would like to keep the feature request open though, since it would be nice if such a feature were automatic.

2
  • Better use / instead of ?
    – Bergi
    Commented Apr 18, 2015 at 17:58
  • 1
    FWIW, this works because ? initiates a query string, which isn't part of the path. In this case, the GET parameter is generates is ignored and unused, so it's a bit of a hack, but it works. Commented Apr 18, 2015 at 18:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .