DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Stock Quote

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2005-04-01T14:54:13
Classification:Ameos Stock Quote Extension
Email:typo3@ameos.com
Info 2:
Info 3:
Info 4:

Stock Quote

Extension Key: ameos_stockquote

Copyright 2000-2005, typo3@ameos.com, <typo3@ameos.com>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

Stock Quote 1

Introduction 1

What does it do? 1

Screenshots 1

Credits 2

Users manual 2

FAQ 2

Templates 2

Modifying existing templates 2

Template markers 3

Creating additional templates 3

TypoScript Reference 3

Integrating a stock quote in the template 3

Known problems 4

To-Do list 4

Changelog 4

Introduction

What does it do?

This extension lets you create little boxes on your page displaying live stock quotes.

Screenshots

For example a stock quote box like this...

img-1

...is created with the following content element:

img-2

Credits

This extension has been createdby the French company Ameos .

Users manual

Just create a content element of the type "Insert plugin" and choose "Stock Quote" in the selector box. Now click "save" and then there are two more form elements: "Template" and "Symbol". Enter a valid stock exchange symbol and save.

That's it. You'll have a nice little stock exchange box on your page.

FAQ

  • Q: Which stock exchanges can I query?
  • A: Depends on availability of the stock exchange on finance.yahoo.com

Templates

Modifying existing templates

You can simply modify the templates found in the folder typo3[conf]/ext/ameos_stockquote/tmpl/.

The following markers are available for the templates:

Template markers

Dynamic markers
###Symbol###

Marker name

###Symbol###

Description

Symbol as entered in the backend form

Example values

IBM

###Last###

Marker name

###Last###

Description

Last stock price

Example values

89.50

###Date###

Marker name

###Date###

Description

Date of stock price

Example values

22 March

###TStamp###

Marker name

###TStamp###

Description

Example values

4:00pm

###Change###

Marker name

###Change###

Description

$ difference between current and previous close price.

Example values

-0.01

###PercChange###

Marker name

###PercChange###

Description

% difference between current and previous close price.

Example values

-0.01

###Open###

Marker name

###Open###

Description

Example values

89.61

###High###

Marker name

###High###

Description

Example values

90.34

###Low###

Marker name

###Low###

Description

Example values

89.26

###Volume###

Marker name

###Volume###

Description

Example values

4453400

###PrevClose###

Marker name

###PrevClose###

Description

Example values

89.51

###Name###

Marker name

###Name###

Description

Example values

INTL BUSINESS MAC

###Bid###

Marker name

###Bid###

Description

Example values

N/A

###Ask###

Marker name

###Ask###

Description

Example values

N/A

###EPS###

Marker name

###EPS###

Description

Example values

4.94

###YrLow###

Marker name

###YrLow###

Description

Year low

Example values

81.90

###YrHigh###

Marker name

###YrHigh###

Description

Year high

Example values

99.10

###PE###

Marker name

###PE###

Description

Example values

18.12

###change_color###

Marker name

###change_color###

Description

This is usually red, green or black; depending on wheter ###Change### is positive or negative. The specific colours can be configured via TypoScript (see section TypoScript Reference of this manual).

Example values

Red

Locall language string markers

The following markers return local language strings in the language configured with the global TypoScript option “config.language“.

Example for making the extension return German strings:

config.language = de

or French:

config.language = fr
###symbol_header###

Marker name

###symbol_header###

Description

English values

Symbol

###last_trade_header###

Marker name

###last_trade_header###

Description

English values

Last Trade

###trade_time_header###

Marker name

###trade_time_header###

Description

English values

Trade Time

###trade_time_fomatting###

Marker name

###trade_time_fomatting###

Description

English values

%d %B

###change_header###

Marker name

###change_header###

Description

English values

Change

###prev_close_header###

Marker name

###prev_close_header###

Description

English values

Prev Close

###open_header###

Marker name

###open_header###

Description

English values

Open

###bid_header###

Marker name

###bid_header###

Description

English values

Bid

###ask_header###

Marker name

###ask_header###

Description

English values

Ask

###days_range_header###

Marker name

###days_range_header###

Description

English values

Day's Range

###52wk_range_header###

Marker name

###52wk_range_header###

Description

English values

52wk Range

###volume_header###

Marker name

###volume_header###

Description

English values

Volume

###p_e_ttm_header###

Marker name

###p_e_ttm_header###

Description

English values

P/E (ttm)

###eps_ttm_header###

Marker name

###eps_ttm_header###

Description

English values

EPS (ttm)

Creating additional templates

For introducing a new, additional template, you can just create new templates in the tmpl/ folder of the extension, or in any other path configured in the “ Comma list of paths to templates ” and they are picked by the extension automatically if they have one of the following file extensions: *.tmpl, *.html or *.htm.

Additionally you can create a thumbnail GIF file as a preview of your template. The GIF file has to have the same base name as the template file but the extension *.gif. They are picked automatically then.

TypoScript Reference

symbol

Property

symbol

Data type

string

Description

Symbol of the stock.

Example: IBM or RHAT

Default

IBM

template

Property

template

Data type

resource

Description

Template file.

Example: fileadmin/mytmpl.html or EXT:ameos_stockquote/tmpl/advanced.tmpl

Default

EXT:ameos_stockquote/tmpl/simple.tmpl

colors.positive

Property

colors.positive

Data type

HTML-color

Description

HTML color code that is put into the ###change_color### marker for you to use in templaes if the stock price went up .

Default

green

colors.negative

Property

colors.negative

Data type

HTML-color

Description

HTML color code that is put into the ###change_color### marker for you to use in templaes if the stock price went down .

Default

red

colors.stagnating

Property

colors.stagnating

Data type

HTML-color

Description

HTML color code that is put into the ###change_color### marker for you to use in templaes if the stock price didn't change .

Default

black

Integrating a stock quote in the template

Apart from displaying boxes of stock quotes on one page only, you can also include it in the template for all sites.

Imagine your template looks as simple as that:

page = PAGE
page.typeNum = 0
page.10 < styles.content.get

Now you'd like to display a box with the latest stock quote of Redhat on every page below the content. Just add the following line to your template.

page.20 < plugin.tx_ameosstockquote_pi1
page.20.symbol = RHAT

Have a look at the frontend, it should already display the stock quote.

If you want to customize the template of the stock rate box, you can create a new template as explained earlier in this manual. In order to tell the extension which template to use, add the following line:

page.20.template = fileadmin/my_new_template.html

Known problems

There are no known problems.

To-Do list

It would be cool if the box would also show a graph visualizing the development of the stock price.

If you have more suggestions, just tell us, Ameos typo3@ameos.com, <typo3@ameos.com>.

Changelog

01.04.2005: Adding translations, icons, displaying default fields for not translated fields, extension now maintained by Ameos, thanks Ingmar

22.03.2005: Minor update; added this manual to the extension.

21.03.2005: Initial Release

img-3 Stock Quote - 4