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.

Auto grouping sitemap and menu

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2012-07-10T22:01:59
Classification:autositemap
Description:Plugin for a sitemap and menu which groups the first four menus in first four columns and all others in a fifth column. Great menus will get a linebreak. Configuration is based on TypoScript HMENU.
Keywords:sitemap, menu, grouping
Author:Dirk Wildt, Die Netzmacher
Email:http://wildt.at.die-netzmacher.de
Website:http://die-netzmacher.de
Language:en

img-1 img-2 extKey: autositemap img-3

Auto grouping sitemap and menu

img-4

Version: 1.1.1, 2014-01-09

Extension Key: autositemap

Language: en

Keywords: sitemap, menu, grouping

Copyright 2012-2014, Dirk Wildt, Die Netzmacher, <http://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

Table of Contents

Auto grouping sitemap and menu 1

Screen Shots 3

Frontend 3

Backend 3

Layout Samples 4

Introduction 5

What does it do? 5

Installation 6

One page only 6

Website wide Installation 6

Priority 7

First of all 7

Maximum of line breaks 7

One line break only 9

No line break for any menu 10

TypoScript Constant-Editor 11

AUTOSITEMAP – MENU CONFIGURATION 11

AUTOSITEMAP – RULES 12

AUTOSITEMAP – DEBUGGING 12

TypoScript Object-Browser 13

CSS 13

Master Template 13

Debugging 14

Follow the Workflow 14

HTML Code 15

Reference 17

Whats new in ... 20

... version 1.0? 20

Update 21

Update from < 0.9.x 21

Helpful suggestions 22

Known Bugs 23

To-Do List 24

Change Log 25

Illustration Index 26

Screen Shots

Frontend

Frame1 Frame1

Frame1 Frame1

Backend

Frame1

Layout Samples

Four examples. Ten layouts are possible.

Frame1 Frame1

Frame1 Frame1

Introduction

What does it do?

  • autositemap generates a sitemap or menu in columns.

  • autositemap tries to split menus for the best design. Ten designs are possible.

  • For example: Big menus can get two columns.

  • If you have more than four menus, the rest will placed in a fifth column.

  • The menus in the first four columns has a depth of three levels by default.

  • The menus in the fifth column has a depth of two levels by default.

  • You can control the behaviour of placements with one of three priorities:

    • Maximum of line breaks
    • One line break only
    • No line break for any menu

    See "Priority" on page 7 below for more details.

  • The menus are configured by TypoScript. They are based on the HMENU and TMENU. But you can't use all HMENU properties!

  • The used HTML classes by the include static template "+Autositemap YAML (autositemap)" are based on the YAML CSS. But the JavaScript framework YAML isn't needed.

Installation

One page only

  • Install the extension.
  • Add the plugin to a page, where you like to use the autositemap.
  • Add the TypoScript templates to the static templates of the TypoScript of this page:
    • Autositemap (autositemap)
    • +Autositemap YAML (autositemap)
  • Configure autositemap supported by the TypoScript Constant Editor.

Frame1

Website wide Installation

  • Install the extension.
  • Add a sysfolder "libraries" to your website.
  • Add a page "sitemap" into the page "libraries".
  • Add the plugin into the page "sitemap"
  • Add the TypoScript templates to the static templates of the TypoScript of your root page:
    • Autositemap (autositemap)
    • +Autositemap YAML (autositemap)
  • Include the content of the page "sitemap" website wide by TypoScript or TemplaVoilá.
  • Configure autositemap supported by the TypoScript Constant Editor.

Frame1

Priority

First of all

The marginal Column

The fifth column is a marginal column. It contains menus, which aren't contained by the first four columns. The fifth column doesn't place any line break in a menu.

The Competition of big Menus

There are some cases imaginable with menus which compete against other menus for a line break. autositemap tries to find the best solution in this cases.

Maximum of line breaks

Explanation

autositemap gives priority to the maximum of line breaks.

If first two menus have enough items for a line break, they will fill the first four columns. All other menus will fill the fifth column.

TypoScript Constant Editor

Frame1

Web Modul: Template

Page tree: Root page or page of your choice

Edit area: [Constant Editor]

Categorie: [AUTOSITEMAP – RULES]

Priority: [maxLineBreaks]

Possible cases

Frame1 Frame1

Frame1 Frame1

Frame1

If you haven't enough menus, there won't be any marginal column.

One line break only

Explanation

Only one menu will get a line break at maximum.

If there are only three menus, one of the menus must have enough items for a line break.

If there are more than three menus, one of the first two menus must have enough items for a line break.

TypoScript Constant Editor

Frame1

Web Modul: Template

Page tree: Root page or page of your choice

Edit area: [Constant Editor]

Categorie: [AUTOSITEMAP – RULES]

Priority: [oneLineBreak]

Possible cases

Frame1 Frame1

Frame1 Frame1

If you haven't enough menus, there won't be any marginal column.

No line break for any menu

Explanation

Any menu won't get any line break.

TypoScript Constant Editor

Frame1

Web Modul: Template

Page tree: Root page or page of your choice

Edit area: [Constant Editor]

Categorie: [AUTOSITEMAP – RULES]

Priority: [noLineBreak]

Possible cases

Frame1 Frame1

If you have less than four menus, you will receive less columns.

TypoScript Constant-Editor

AUTOSITEMAP – MENU CONFIGURATION

Root page id (this is a must!)

Uid of the root page. Menu / sitemap will calculated from this startingpoint. You will get an error, if root page id is empty!

Doktypes

You can exclude doktypes from the sitemap.

The doktypes 3, 6, 7, 199, 254, 255 (see below) are excluded by default. That means: the doktypes page and short cut will displayed by default.

Frame1

Defined doktypes

1: page

3: link to an external URL

4: Shortcut

6: page for backend user

7: mount point

199: menu seperator

254: folder

255: recycler

Exclude uids

Comma separated list of ids of pages, which should ignored. All subpages of an excluded page will ignored too.

AUTOSITEMAP – RULES

Priority

Frame1

  • maxLineBreaks: If menus have enough items, they become double columns.
  • oneLineBreak: The greeatest menu will get a double column, if there are less than four menus.
  • noLineBreak: If there are enough menus, each menu becomes one column only.

See details at "Priority" on page 7 above.

Minimum menu items for a line break

A menu must contains at least this number of submenus or and items, if it should get a line break.

AUTOSITEMAP – DEBUGGING

Enable Debugging

HTML comments will displayed.

See details at "HTML Code" on page 15 below.

TypoScript Object-Browser

CSS

autositemap includes a CSS file while runtime.

page.includeCSS {

tx_autositemap_pi1_yaml = EXT:autositemap/res/pi1/yaml/autositemap_yaml.css

}

If you don't need it, please configure:

page.includeCSS {

tx_autositemap_pi1_yaml >

}

If you need an own CSS file please configure something like this:

page.includeCSS {

tx_autositemap_pi1_yaml >

tx_autositemap_pi1_yaml = fileadmin/my_files/my_own.css

}

Master Template

The TypoScript properties are configured by a master template in general.

The parts of the master template are allocated to the autositemap plugin like in the snippet below:

plugin.tx_autositemap_pi1 {

css < plugin.tx_autositemap_pi1.master_templates.yaml.css

html < plugin.tx_autositemap_pi1.master_templates.yaml.html

menu_main < plugin.tx_autositemap_pi1.master_templates.yaml.menus.menu_main

menu_main_last < plugin.tx_autositemap_pi1.master_templates.yaml. menus.menu_main_last

menu_margin < plugin.tx_autositemap_pi1.master_templates.yaml.menus.menu_margin

}

If you like to configure your own layout, please configure your own master template. A good example is the TypoScript of "+Autositemap YAML (autositemap)". See the files:

autositemap/static/pi1/yaml

  • constants.txt
  • setup.txt

Example: Third level in the menu margin

The menu margin renders menus two levels only by default.

If you like to display the third level too, please use this code snippet:

plugin.tx_autositemap_pi1 {menu_margin {3 < plugin.tx_autositemap_pi1.menu_main.3}}

See more supporteed by the TypoScript Object Browser.

More Configuration in Depth

There are a lot of properties for customising.

Sorry, that these properties aren't a subject of this manual.

You have the option to inspect the TypoScript only.

Debugging

Follow the Workflow

You can follow the workflow with the DRS – the Development Reporting System.

You need the extension devlog.

DRS – Development Reporting System

The DRS – Development Reporting System – prompts the whole workflow into the devlog.

If you have any unexpected result, please enable the DRS by the extension manager.

Enabling

Frame1

Modul Admin Tools: Extension Manager

Edit area: Select autositemap

[Configuration]

DRS: [Enabled]

[Update]

Reload the page with the autositemap in the frontend.

Report

Frame1

Follow the workflow: read the report!

HTML Code

The autositemap uses some markers for replacement of HTML wraps.

It simplifies to fix bugs, if the markers won't replaced in the HTML code, if there is any unexpected result,

Debugging

Frame1

Enable HTML comments (markers won't removed):

Modul Web: Template

Page tree: Select a page with the autositemap plugin

Edit area: [Constant Editor]

Category: [AUTOSITEMAP - DEBUGGING]

[X] Enable Debugging

Reload the page in the frontend.

Inspect the HTML source code.

Frame1

Reference

css

Property

css

Data type

array

Description

Variables for your CSS classes.

Please take a look into TypoScript of "+Autositemap YAML (autositemap)" see "Master Template" on page 13 above.

Example:

plugin.tx_autositemap_pi1 {
  css {
      // One menu in a single column
    10 = tx_autositemap_pi1_menus_01
    10 {
        // Class for a single column
      mainSingle = TEXT
      mainSingle {
        value = 100
      }
    }
      // One menu in a double column
    11 = tx_autositemap_pi1_menus_01_wi_01_double
    11 {
        // Class for a double column
      mainDouble = TEXT
      mainDouble {
        value = 100
      }
    }
    ...
  }
}

Default

debugging

Property

debugging

Data type

array

Description

Support for debugging: HTML comments will removed by default (0).

Please configure it by the TypoScript Constant Editor!

Example:

plugin.tx_autositemap_pi1 {
  debugging {
    dontRemoveHtmlComments = TEXT
    dontRemoveHtmlComments {
      value = 0
    }
  }
}

Default

0

html

Property

html

Data type

array

Description

HTML snippets for wraps. The snippets must contain the variable %content%. %content% will replaced with the current main menu or submenu.

Please take a look into TypoScript of "+Autositemap YAML (autositemap)" see "Master Template" on page 13 above.

Example:

plugin.tx_autositemap_pi1 {
  html {
    sitemap = TEXT
    sitemap {
      ...
    }
    menuMainOuterWrap = TEXT
    menuMainOuterWrap {
      ...
    }
    menuMainInnerWrap = TEXT
    menuMainInnerWrap {
      ...
    }
    menuSubOuterWrap = TEXT
    menuSubOuterWrap {
      ...
    }
  }
}

Default

master_templates

Property

master_templates

Data type

array

Description

Master templates: it contains the whole configuration for the HMENU with TMENUs.

Please take a look into TypoScript of "+Autositemap YAML (autositemap)" see "Master Template" on page 13 above.

Example:

plugin.tx_autositemap_pi1 {
  master_templates =
  master_templates {
    ...
  }
}

Default

rules

Property

rules

Data type

array

Description

Rules for the number of columns and the line break position.

Please configure it by the TypoScript Constant Editor!

Example:

plugin.tx_autositemap_pi1 {
   // Rules for number of columns and line break
  rules =
  rules {
      // Minimum of submenus and items for a line break
    menuItems =
    menuItems {
      ...
    }
      // Number of columns ...: DON'T TOUCH IT!
    numberOfColumns =
    numberOfColumns {
      ...
    }
      // Priority
    priority = TEXT
    priority {
      ...
    }
  }}

Default

sql

Property

sql

Data type

array

Description

SQL statements. Contains an andWhere for the pages table only.

Configuration has to correspond with the configuration of the HMENU.

You don't need to configure it.

Example:

plugin.tx_autositemap_pi1 {
  sql {
      // Table
    pages =
    pages {
      andWhere = TEXT
      andWhere {
        value =       AND doktype NOT IN \
 ({$plugin.tx_autositemap_pi1.hmenu.excludeDoktypes})\
                      AND nav_hide = 0
        noTrimWrap  = | ||
      }
    }
  }
}

Default

Whats new in ...

... version 1.0?

Exclude page Ids

[1.0.0]

You can exclude page ids from the the menu / sitemap.

Configurable rootpage ID

[1.0.0]

You can configure the rootpage / staringpoint of the menu / sitemap.

Update

Update from < 0.9.x

You have to allocate the root page id supported by the TypoScript Constant-Editor. See "Root page id (this is a must!)" on page 11 above.

Helpful suggestions

If you have helpful suggestions, feel free to send a question, a bug or a code snippet by e-mail. See http://wildt.at.die-netzmacher.de .

E-mails are welcome in English and German.

Known Bugs

The option "One Line Break" doesn't seem to work proper.

To-Do List

Check the option "One Line Break".

Change Log

1.1.1 Improvement #i0002: ManualSample for a third level in the menu margin

1.1.0 Task * #53373: State: Alpha -> BetaBug* #53374: calcMenusForCase: array_keys() expects parameter 1 to be array, null given* pi1class.tx_autositemap_pi1.php on line 1120

1.0.1 Bugfix * #i0001: CSS

1.0.0 New Features * #43696: Exclude page ID* #43695: Configurable rootpage ID

0.9.3 Bugfix * static/pi1/yaml/setup.txt: ACRIFSUB > ACTIFSUB

0.9.2 Bugfix * array_keys() expects parameter 1 to be array in pi1/class.tx_autositemap_pi1.php line 2729

0.9.1 Publishing Update* Manual

0.0.4 Improvements * margin column get the class ym-gr (former: ym_gl)* Configuring the TypoScript Constant EditorBugfix* pi1/locallang.xml

0.0.3 New Feature * multiple master_templatesEffected file: static/pi1/setup.txt* priorities: plugin.tx_autositemap_pi1.rules.priority* maxLineBreaks* oneLineBreak* noLineBreak

0.0.2 Manual

0.0.1 Initial release Dirk Wildt http://wildt.at.die- netzmacher.de

Illustration Index

Illustration 1: Two main columns, one marginal column 3

Illustration 2: Four main columns, one marginal column 3

Illustration 3: Three main columns, one marginal column 3

Illustration 4: Four main columns, one marginal column 3

Illustration 5: TypoScript Constant Editor 3

Illustration 6: Four main columns, one marginal column 4

Illustration 7: Three main columns, one marginal column 4

Illustration 8: Two main columns 4

Illustration 9: Four main columns 4

Illustration 10: Include static (from extensions) 6

Illustration 11: The autositemap plugin 6

Illustration 12: TypoScript Constant Editor - maxLineBreaks 7

Illustration 13: Any menu hasn't enough items for a line break. 8

Illustration 14: The 1st menu has enough items for a line break. 8

Illustration 15: The 2nd menu has enough items for a line break. 8

Illustration 16: The 3rd menu has enough items for a line break. 8

Illustration 17: The 1st and 2nd menu have enough items for a line break. 8

Illustration 18: TypoScript Constant Editor - maxLineBreaks 9

Illustration 19: Any menu hasn't enough items for a line break. 9

Illustration 20: The 1st menu has enough items for a line break. 9

Illustration 21: The 2nd menu has enough items for a line break. 9

Illustration 22: The 3rd menu has enough items for a line break. 9

Illustration 23: TypoScript Constant Editor - maxLineBreaks 10

Illustration 24: Any menu hasn't a line break. 10

Illustration 25: Same case with four menus 10

Illustration 26: Configuring doktypes 11

Illustration 27: Rule for a line break 12

Illustration 28: Enable the DRS – Development Reporting System 14

Illustration 29: Report of the DRS – Development Reporting System 15

Illustration 30: Display HTML comments 15

Illustration 31: HTML source code with autositemap marker 16

26