Forum OpenACS Q&A: Clickthrough-enabled links

Collapse
Posted by Jarkko Laine on
From clickthrough requirements document:
20.20.10.10 A developer shall be able to build a clickthrough-enabled link in a dynamic page (e.g., Tcl or ADP pages) just by passing the destination, or foreign, URL to a procedure. This procedure will return the content of the href attribute of an <a> tag. Such content will be determined at run-time and will correspond either to a plain link to the provided URL or to a clickthrough-enabled link to that same address, depending on whether a Clickthrough package is mounted under the package to which the page belongs, or not.
Is there such an adp tag or tcl proc or is the whole clickthrough package already just a historical thing? At least I couldn't find anything resembling from docs nor clickthrough api docs.
Collapse
Posted by Jarkko Laine on
Oh yes, and the reason I came to this was that I don't get anything to my clickthroug_log table, even though I self try to populate it hacking links so that my fingers hurt.

Example:

<a href="/ct/basics/books.html?send_to=http://philip.greenspun.com">Test link</a>

Still, after clicking that link a couple of times:
suisse-dev=# select * from clickthrough_log;
 local_url | foreign_url | entry_date | click_count | package_id 
-----------+-------------+------------+-------------+------------
(0 rows)

suisse-dev=# 
And this is by no means the only place where I have these links. I've tried to make every link I put in my blog to use clickthrough, with no effect.
Collapse
Posted by Ola Hansson on
Check out clickthrough_link in packages/clickthrough/tcl/clickthrough-procs.tcl

You may have to restart the server after you have installed and mounted clickthrough, and also after you have changed any parameters.

Collapse
Posted by Dave Bauer on
Make sure the package is mounted. There are two tcl procs clickthrough_href and clickthrough_link and they have ad_proc documentation defined.

ad_proc clickthrough_href {href_url} {
    Detects if a clickthrough instance is mounted beneath the current package
    (ie, if the current package is interested in tracking clickthroughs).
    Builds the href part of a clickthrough-enabled (or plain) HTML link based on the presence (or not) of such a clickthrough instance.

ad_proc clickthrough_link {href_url link_content {link_attributes ""}} {
    Detects if a clickthrough instance is mounted beneath the current package
    (ie, if the current package is interested in tracking clickthroughs).
    Builds a full clickthrough-enabled (or plain) HTML link based on the presence (or not) of such a clickthrough instance.

You'll have to write some code to substitute links with these URLs in your weblog.

Collapse
Posted by James Harris on
I've been trying to get clickthroughs to work with manually created links.

I tried mounting /clickthroughs and using a link such as /clickthroughs/package/file?send_to (which I gather is incorrect) and no clickthroughs showed up in the logs.  I then tried mounting /package/clickthroughs and using the links /package/clickthroughs/file?send_to which didn't work either.

Both automatically redirect the page but do not appear to log the clickthrough, even after taking in to account the cache time.

Any help would be appreciated (either on the manual links or having them automatically created when appropriate - though this was in ETP so automatic links might be more difficult).