Add a permanent javascript link

isengrin

Joined: 2007-01-21
Posts: 10
Posted: Sun, 2007-01-21 21:27

Hello,
I try to do my first Module.
I have add a javascript (just insert to try) and in my module.inc I have:
function getSystemLinks() {
$links = array();

$links['Jimodule'] = array(
'text' => $this->translate('ThePermanentLink'),
'params' => array('view' => 'core.UserAdmin',
'subView' => 'testmodule.TestModule',
'return' => 1));

return array(null, $links);
}

I can see the link ThePermanentLink on the top, that is OK, but I would like this link (without all pass): javascript:ViewCart()

How to do ?

On simple HTML I write: <a href="javascript:ViewCart()">Cart</a>

Thanks for your help.

 
ZonaX
ZonaX's picture

Joined: 2006-11-02
Posts: 64
Posted: Tue, 2007-01-23 08:04

Aah cool you've read my module tutorial i see (Jimodule, im jim :3).
To do this i guess you have to edit the theme. There are a few main tpl theme files in the theme folder (not of the module, but of your gallery theme). You have to check a few files to know what page is including those links.

Shouldnt be a problem :)

Signature____________
Have any comment to this post and dont want to place a comment via the forum? Feel free to mail me: Send My A Save Email System

 
isengrin

Joined: 2007-01-21
Posts: 10
Posted: Tue, 2007-01-23 21:36

Hi,
Exactly, thanks for your tutorial, it's nice.
I did it in the theme and it is OK, but it could be very good to do that with a module.
And I also would like to add a button/link under each image to order a paper print, also with à javascript.
Have an idea ?

 
ZonaX
ZonaX's picture

Joined: 2006-11-02
Posts: 64
Posted: Wed, 2007-01-24 08:42

It is very posible to add a link to an image. But again (as far as i know) this doesnt support javascript links. To edit it in the theme you should use photo.tpl. Around line 80 is where you can find the block that includes the image. There you can add it.

Signature____________
Have any comment to this post and dont want to place a comment via the forum? Feel free to mail me: Send My A Save Email System :: Visit my module development tutorial at Combined-Minds.net

 
isengrin

Joined: 2007-01-21
Posts: 10
Posted: Thu, 2007-01-25 15:56

Hello,
Exactly, thanks, I have found where to insert.
In photo.tpl (that I copy in local) line 50-90 there is the large image (after we click on thumbnail).
In album.tpl I have found that the thumbnail is on line 98-116.
I would like to add the url of the thumbnail in a javascript and I have found this:
{g->image item=$child image=$child.thumbnail class="giThumbnail"}
that show the thumbnail, but I cannot copy that directly in urlofthethumbnail:
<a href="javascript:AddImage('urlofthethumbnail','urlofthehighestqualitytoprint')">
To Cart
</a>

Someone have an idea ?

Thanks