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.

Browser Tutorial Several Plugins (en)

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2010-10-04T19:18:09
Classification:browser_tut_severalplugins_en
Description:Tutorial Several Plugins for the Browser - the Frontend Engine
Keywords:forAdmins, forDevelopers, forBeginners, forAdvanced, browser, tutorial, frontend-engine, frontend, engine, plugins, multiple, several
Author:Dirk Wildt, Die Netzmacher
Email:wildt.at.die-netzmacher.de
Website:http://die-netzmacher.de
Language:en

img-1 img-2 extKey: browser_tut_severalplugins_en img-3

Browser Tutorial Several Plugins (en)

img-4

Version: 3.4.4., 2010-10-04 - Version is corresponding with the version of the Browser.

Extension Key: browser_tut_severalplugins_en - Tutorial for the extension Browser (extkey: browser)

Language: en

Keywords: forAdmins, forDevelopers, forBeginners, forAdvanced, browser, tutorial, frontend-engine, frontend, engine, plugins, multiple, several

Copyright 2009-2010, Dirk Wildt, Die Netzmacher, <wildt.at.die- netzmacher.de>

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.org

Screenshots

Frame5 Frame5

img-6 Illustration 3: Tutorial in PDF format

Introduction What does the Tutorial do? ^^^^^^^^^^^^^^^^^^^^^^^^^^

This is a tutorial for the extension Browser (extkey: browser).

It is

a step-by-step introduction for using the Browser plugin several times on the same page

only.

If you are interested in other issues, please note the section "Further Informations" below.

The three Plugins Example

We will display three lists in the frontend:

  • Frontend users
  • Backend users
  • News

Pages and Sysfolders

You need

  • a page for the output - we called it "tutorial",
  • a sysfolder with the frontend users and
  • a sysfolder with the news

like in the illustration below:

Frame5

Add to the page "tutorial" the plugin Browser three times.

Call the plugins:

  • view 1
  • view 2 and
  • view 3

Set the header type to "hidden".

TypoScript

Add to your page "tutorial" a template.

Include the static template from the Browser.

Frame5

Add in the tab [General] in the field [setup] this TypoScript snippet:

plugin.tx_browser_pi1 {

views {

list {

1 {

name = Frontend User with their groups

select = fe_users.username, fe_groups.title

}

2 {

name = Backend User with their groups

select = be_users.username, be_groups.title

}

3 {

name = News with their categories

select = tt_news.title, tt_news_cat.title

}

}

}

}

The snippt should be easy to understand.

Configuring the Plugins

Startingpoints

Frame5

Please add the startingpoints.

The startingpoint of the plugin "View 1" is the sysfolder fe_user.

The startingpoint of the plugin "View 3" is the sysfolder news.

Select the Views

Frame5

Please select in each Browser plugin

the devider [Plugin]

the devider [General].

Set the select box [views] to "configured".

Add to the field [Views: Enabled list views, which are handled by the plugin. ...the list, you want to display.

Enable the Displaying of Backend Users

To display backend users is a special case, because they aren't stored in any sysfolder. All be_users have the pid 0, the pid of the TYPO3 root.

Select the plugin "View 2".

Select the tab [General] of the plugin.

Select in the select box [Configure Relations] the value "Configured"

Field [Records without Pid]: Please enable "Display records of the root level too".

List Title

Please select the second tab [Lists] of each plugin.

Set the field [Title]:

View 1: = Frontend Users

View 2: = Backend Users

View 3: = News

Display empty List at Start

Please select the second tab [Lists] of each plugin.

Select in the select box [Display] the value "Adjusted".

Enable in each view the option [Empty List at Start].

Result in the Frontend

Frame5

The one Plugin example with three lists

Manage all three views with one Plugin

You can manage all three views with one plugin only. These are the steps:

  • img-7 Illustration 9: One plugin with three views

    Take the first plugin from this tutorial above.

  • Add to the plugin the other two list views.

  • Enable records from rootlevel.

  • Maintain the startingpoint.

  • Enable Labelling.

Configure the Plugin

Please select in each Browser plugin

the devider [Plugin]

the devider [General].

Set the select box [views] to "configured".

Add to the field [Views: Enabled list views, which are handled by the plugin. ...the list, you want to display.

Enable the Relations Configuration.Select [Configured]

Enable to display records of the root level (we need it for the records of the backend users).

Add to the startingpoint the folder with your news.

TypoScript

Add to your TypoScript values for labelling.

The values list_mode_x will label the devider of the list view with the element number x in the TypoScript.

plugin.tx_browser_pi1 {

views {

list {

1 {

name = Frontend User with their groups

select = fe_users.username, fe_groups.title

}

2 {

name = Backend User with their groups

select = be_users.username, be_groups.title

}

3 {

name = News with their categories

select = tt_news.title, tt_news_cat.title

}

}

}

_LOCAL_LANG.default {

list_mode_1 = fe_user

list_mode_2 = be_user

list_mode_3 = news

}

}

Frontend

Frame5

With the latest three News

The third plugin should display only the latest three news.

TypoScript

Add to the third view the following TypoScript the lines 12 and 13 (see the TypoScript snippet below):

plugin.tx_browser_pi1 {

views {

list {

1 {

select = fe_users.username, fe_groups.title

}

2 {

select = be_users.username, be_groups.title

}

3 {

select = tt_news.title, tt_news_cat.title

orderBy = tt_news.datetime DESC

limit = 0,3

}

}

}

}

Line 12: News will be ordered by their datetime and descending.

Line 13: News will limited to the first three records.

Plugin

We don't want to display

  • any search field
  • any a-z browser
  • any page browser

and we don't want an empty list at start.

Frame5

Result in the Frontend

Frame5

Templating

If you like to change the template please read the section "HTML Templating" in the Tutorial Basic:

HTML: http://typo3.org/documentation/document-library/extension- manuals/browser_tut_basics_en/current/

No Cache

The Browser enables to use several plugins cached and no cached on the same page

Case story

Let's assume we want to display

  • a plugin for news with the latest ten news
  • a plugin for people with three random peoples.

The plugin doesn't be cached. If it would be cached, there would be a random list once only.

Tutorial

You configure the plugin for the ten latest news in the common way.

You configure the plugin for the three random people like in the example below.

Plugin

Frame5

You are using the plugin "Browser (no cache)".

Include Static Template

Frame5

You are including both Browser templates:

  • Browser (browser)
  • Template of third party extension
  • Browser (no cache) (browser)

The third one needs the first one, because the third one takes the TypoScript code of the first one and save it as plugin.tx_browser_pi4 = USER_INT

USER_INT effects, that the plugin won't be cached.

TypoScript Snippet

Configure your people views with the plugin.tx_browser_pi1 array, if you are configuring a static template which will be included.

plugin.tx_browser_pi1 {

views {

list {

1 {

select (

fe_users.last_name,

fe_users.first_name

)

random = 1

}

}

single {

1 {

select (

fe_users.last_name,

fe_users.first_name,

fe_users.title,

fe_users.image,

fe_users.telephone,

fe_users.fax,

fe_users.email

}

}

}

}

}

If you are configure the browser in your template directly - in the setup field - and configure the plugin.tx_browser_pi4

plugin.tx_browser_pi4 {

views {

list {

1 {

select (

...

RealUrl

Configurable tx_browser_pi1[showUid]

If your are using realUrl and plugins with different databases, you can configure the name of the piVar showUid.

showUid is the URL parameter with the record uid for links to the single view.

Example

You have two plugins on the same page

The first plugin displays a list of tt_news records.

The second plugin displays a list of fe_users records.

TypoScript

plugin.tx_browser_pi1 {

views {

list {

1 {

select (

tt_news.title

)

}

2 {

showUid = feusersUid

select (

fe_users.name

)

}

}

}

}

The TypoScript above effects, that

the tt_news.uid will get the parameter name tx_browser_pi1[showUid] (this is the default)

the fe_users.uid will get the parameter name tx_browser_pi1[feusersUid]

Now you are able to configure in the realUrl configuration array the lookuptables differently.

RealURL configuration snippet

$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['postVarSets'] = array

(

'_DEFAULT' => array

(

'news' => array

(

array

(

'GETvar' => 'tx_browser_pi1[showUid]',

'lookUpTable' => array

(

'table' => 'tt_news',

'id_field' => 'uid',

'alias_field' => 'title',

'addWhereClause' => ' AND NOT deleted AND NOT hidden',

'useUniqueCache' => 1,

'useUniqueCache_conf' => array

(

'strtolower' => 1,

'spaceCharacter' => '-',

),

)

),

),

'name' => array

(

array

(

'GETvar' => 'tx_browser_pi1[feusersUid]',

'lookUpTable' => array

(

'table' => 'fe_users',

'id_field' => 'uid',

'alias_field' => 'name',

'addWhereClause' => ' AND NOT deleted AND NOT hidden',

'useUniqueCache' => 1,

'useUniqueCache_conf' => array

(

'strtolower' => 1,

'spaceCharacter' => '-',

),

)

),

),

),

),

Helpful suggestions

If you have helpful suggestions, feel free to contact me: wildt.at .die-netzmacher.de.

To-Do List

Nothing to do.

Change Log

3.4.4 New Features - #9917: Selecting a random sample from a set of rows.Browser Plugin no cache.

3.4.2 New Features - #9683: Selectable list views from TypoScript in the plugin- #9599: Manual configuring of piVar showuid

Publishing

3.0.1 Publishing

Illustration Index

Illustration 1: Example with three plugins 3

Illustration 2: Same example but with latest news 3

Illustration 3: Tutorial in PDF format 4

Illustration 4: Page tree with the page "tutorial" and the sysfolders "fe_user" and "news". 5

Illustration 5: Include static template from extension 6

Illustration 6: Adding the startingpoints 6

Illustration 7: Adding the view 7

Illustration 8: The three plugins in the Frontend 8

Illustration 9: One plugin with three views 9

Illustration 10: Result in the Frontend 10

Illustration 11: Plugin with disabled options 11

Illustration 12: With latest news 12

Illustration 13: Plugin Browser (no cache) 14

Illustration 14: Plugin Browser (no cache) 14

22