Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-11-21 10:15:02
- vanderkerkoff
- Member
- Registered: 2005-05-26
- Posts: 45
add google code to xhtml tags
Hello everyone
I need to edit the xhtml tag generator so that we can add the neccessary google code so that google will pick up the download stats for documents.
Can anyone tell me which file I need to be editing to do this?
Or if it’s not possible then let me know.
Thanks in advance
Textpattern version: 4.0.5 (r2466)
Last Update: 2007-11-13 13:26:32/2007-07-01 21:03:44
Offline
Re: add google code to xhtml tags
What prevents just pasteing required code into presetation (page or form)?
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#3 2007-11-21 10:49:33
- vanderkerkoff
- Member
- Registered: 2005-05-26
- Posts: 45
Re: add google code to xhtml tags
hello the_ghost
nothing at all mate, I’m the technical person, the content people are lazy and want it done automatically :-)
do you know how to?
Offline
Re: add google code to xhtml tags
So you need paste some string into presentation textarea by just clicking some button on the page? If yes, look into jquery. It’s really powerful and rather simple framework ;)
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#5 2007-11-21 15:38:35
- vanderkerkoff
- Member
- Registered: 2005-05-26
- Posts: 45
Re: add google code to xhtml tags
Thanks for getting back to me again ghost
What I was really after is the name of the php file/files that control the xhtml tag generator, then I could edit that/those.
Does anyone know what files the XHMTL tag generator uses to construct it’s tags?
Offline
Re: add google code to xhtml tags
Does anyone know what files the XHMTL tag generator uses to construct it’s tags?
What you mean by that? The forms and pagetemplates? They are stored in database, and they are meant for those kind of codes and presentation.
I don’t actually get what you mean by XHTML tag generator. Textile? Forms? Pagetemplates? Taghandlers?
Cheers!
Offline
#7 2007-11-21 17:40:39
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: add google code to xhtml tags
If you could provide an example of what you need to insert where, we might be able to find you the right file(s) ;)
Offline
#8 2007-11-21 21:38:11
- vanderkerkoff
- Member
- Registered: 2005-05-26
- Posts: 45
Re: add google code to xhtml tags
Hi Gocom, Els
Gocom, if you don’t know what I’m talking about, go to content, files, and click on the XHTML option in tags.
Here’s the link to how google analytics do it
http://www.google.com/support/googleanalytics/bin/answer.py?answer=55529
Here’s the example code they use for a file called map.pdf
<a href=“http://www.example.com/files/map.pdf” onClick=“javascript:urchinTracker (‘/downloads/map’); “>
Here’s the XHTML generated tag for a file in textpattern called apple crumble.pdf
<a href=“http://glamlife.glam.ac.uk/file_download/1039/apple crumble.pdf” title=“Apple Crumble Recipe”>apple crumble.pdf</a>
So I need to add to that tag
onClick=“javascript:urchinTracker (‘/downloads/filename without extension’);
Can you let me know what files I need to edit?
Thanks in advance
Offline
Re: add google code to xhtml tags
The TXP tag generating code is in the file textpattern/include/txp_tag.php
Offline
#10 2007-11-21 22:20:42
- vanderkerkoff
- Member
- Registered: 2005-05-26
- Posts: 45
Re: add google code to xhtml tags
thanks ruud
Offline
#11 2007-11-23 03:20:13
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: add google code to xhtml tags
Just edit your files form, don’t hack Txp.
Offline
#12 2007-11-23 08:28:23
- vanderkerkoff
- Member
- Registered: 2005-05-26
- Posts: 45
Re: add google code to xhtml tags
Hi Mary
Do you mean once you’ve generated the tag, and placed it into a page, edit the tag then?
I’m not sure what you mean by files form.
Thanks
Matt
Offline
Re: add google code to xhtml tags
I think that what Mary means to to go to Forms>files and insert the google code in there. After doing that you can call the “files” form in your templates.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#14 2007-11-23 09:53:11
- vanderkerkoff
- Member
- Registered: 2005-05-26
- Posts: 45
Re: add google code to xhtml tags
I got you
Go to admin, then forms, then on the left hand side is a File Downloads section.
In there is a File Download Link, you can use that go build the tag.
So mary is suggesting that you use that to build the file download tag, and manually enter the google code into every seperate file download link.
Is that what you think Mary means? Or if you’re there Mary, is that what you mean?
Offline
Pages: 1