Suggestion #9486

breadcrumb

Added by Soren Malling about 9 years ago. Updated over 8 years ago.

Status:
New
Priority:
Could have
Assignee:
-
Start date:
2010-08-28
Due date:
% Done:

0%

Has patch:
Tags:

Description

A breadcrumb viewhelper could be made using the cObj viewhelper, but that will require the designer/layouter to know get the needed TypoScript written.

Please comment on the example below

<f:breadcrumb separator="-" linkToCurrent="true/false" linkToPrevious="true/false" />
  • separator = Used to separate the links
  • linkToCurrent = Should the text for the current page link to the current page
  • linkToPrevious = Should the text for previous pages link to the pages

Should it use another name than breadcrumb?

History

#1 Updated by Christian Zenker about 9 years ago

How do you style this? And why would you need TypoScript for that?

I would use the body of the tag for rendering each item - so the BreadcrumbViewHelper is much like the ForViewHelper. But it could add some usefull templateVariables, like the level of the page, if it is the first/last page in the breadcrumb and so on. And it could add the data the cObject would hold in a variable. This way you have access to the title, the navigation title, uid and whatever else is stored in the database for that page - like colors, descriptions, authors, etc.

An example could look like this:


<ul class="breadcrumb">
  <f:breadcrumb alias="breadcrumb">
    <f:if condition="{breadcrumb.count == 0}>
      <f:then><!-- do something special with the home screen - like displaying an icon or do nothing at all --></f:then>
      <f:else>
        <f:if condition="{breadcrumb.countFromEnd} == 0">
          <f:then><!-- on current page --><li>{breadcrumb.page.nav_title}</li></f:then>
          <f:else><li><f:link.page pageUid="{breadcrumb.page.uid}">{breadcrumb.page.nav_title}</f:link.page></li></f:else>
      </f:else>
    </f:if>
  </f:breadcrumb>
  <!-- you could add "pseudo"-pages the extension adds here -->
</ul>

#2 Updated by Soren Malling about 9 years ago

Christian Zenker wrote:

How do you style this? And why would you need TypoScript for that?

Sorry for being unclear in my description. The reason for the viewhelper is to avoid the use of TypoScript. It was meant as before the time of viewhelpers we used to map a area for a breadcrumb and write the TypoScript for it. But this viewhelper should replace that totally!

Regarding the styling it should be either able to wrap the items or let it be a ul/li list by default and let people style that.

An example could look like this:

[...]

I like your example, it gives great flexibility. But I think we might need a "standard layout".

#3 Updated by Christian Zenker about 9 years ago

Søren Malling wrote:

Christian Zenker wrote:

How do you style this? And why would you need TypoScript for that?

Sorry for being unclear in my description.

I could have tried to read more carefully.

I like your example, it gives great flexibility. But I think we might need a "standard layout".

But what should be that standard? Right today using uls for this is accepted. But with HTML5, maybe in one year using navs will be common sense - in two years everyone would complain that the ViewHelper does not wrap its content in a nav by default, and only god knows how menus should look like in five years (might be tables again ;) ).

What I'm trying to say is: Standards change, and even today different people accept different approaches as best practice. Looking at the projects we did lately the ViewHelper you proposed would not have been of any use to us. For instance we needed to add classes to li and a (even depending on their position) and the home button should have an icon and not a text. Some prefer titles to the links, others don't. This could not be done with your proposition. But a default ViewHelper for Fluid should be capable of doing such rather simple things.

Maybe we could include the standard configuration at the first example in the doc. This way it could be easily changed over time without breaking compatibility.

#4 Updated by Bastian Waidelich over 8 years ago

  • Tracker changed from Feature to Suggestion

Also available in: Atom PDF