[MAGNOLIA-1651] Add a different class to the active page in the breadcrumb Created: 01/Aug/07  Updated: 01/Aug/07  Resolved: 01/Aug/07

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 3.1 M2

Type: Improvement Priority: Major
Reporter: maria elena milani Assignee: Fabrizio Giustina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

I'd like that in the breadcrumb the current selection will look different.

I did this adding to breadcrumb.java:
/**

  • Name for the class of selected page
    */
    private String cssActPage;
    .....
    if (this.link)
    {
    out.print("<a href=\""); //$NON-NLS-1$
    out.print(request.getContextPath());
    out.print(page.getHandle() + "." + Server.getDefaultExtension());
    if (actpage.getHandle().equals(page.getHandle())) { out.print("\""); out.print(" class=\""); //$NON-NLS-1$ out.print(cssActPage); out.print("\""); out.print(">"); //$NON-NLS-1$ }

    else

    { out.print("\">"); //$NON-NLS-1$ }

}
.....

I added first an attribute to the tld:
....
<attribute>
<name>cssActPage</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>Class for active page</description>
</attribute>
.....



 Comments   
Comment by Fabrizio Giustina [ 01/Aug/07 ]

committed to trunk with few modifications:

  • the tag attribute is called activeCss
  • by default the active page has a css class "active"

thanks

Generated at Mon Feb 12 03:28:59 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.