[TYPO3-core] RFC #6853: item state CUR for pages of type "shortcut" missing in menus

Franz Koch typo.removeformessage at fx-graefix.de
Sun May 31 19:07:01 CEST 2009


Hi,

this is a SVN patch request.

BT reference:
   http://bugs.typo3.org/view.php?id=6853

Type:
   Bugfix

Branches:
   trunk (maybe also 4.2)

Problem:
   Pages of type "shortcut" never have the proper item state CUR, even if
   their "target" page is the currently displayed one. So if you have a
   sysfolder with some shortcut pages in it that you f.e. you for a menu
   (so that editors can change it), the items in that menu will never
   indicate any other state than normal.

Solution:
   Resolve the uid of the "target" pages by using a already available
   method in TSFE and use these for all related checks on 'isCurrent'
   in tslib_menu.php


Notes:
-----------
This patch does not change the ACT behavior as the author of the BT 
entry asked for, because a shortcut page can only have the state ACT if 
it itself is in the rootline and not it's "target" page. But the 
described issues in this BT entry is fixed with this patch - you only 
need to use CUR in the menu (which is more correct anyway).

Although technically the pages of type "shortcut" themselfs are never 
the 'current' page-uid, this is not true for the URL they are pointing 
to. Their URL is the same as their "target" page, and thus for visitors 
the same. It's also vital for good usability to indicate the currently 
selected/active page.


How to test:
------------
Assume a page structure like this:
root
  |- page 1
  |- page 2
  |- page 3 (currently displayed)
    |- page 4 (shortcut to page3)
    |- page 5


example TS:
page = PAGE
page.typeNum = 0
page.20 = HMENU
page.20 {
	entryLevel = 0
	1 = TMENU
	1 {
		wrap = <ul>|</ul>
		NO = 1
		NO.wrapItemAndSub = <li>|</li>
		ACT > .NO
		ACT = 1
		ACT.ATagParams = style="color:red";
		CUR < .NO
		CUR = 1
		CUR.doNotLinkIt = 1
		CUR.linkWrap = <strong>|</strong>
	}
	2 < .1
}

By clicking on page 3, you'll notice that page 4 (which is a shortcut to 
page 3) will not indicate the CUR status. After the patch it does quite 
well. If you flip the shortcut (making page 3 a shortcut to page 4), 
you'll notice that page 3 will never have the itemstate CUR or CURIFSUB 
- with the patch it does.

If this example is looking odd to you - the usecase of this particular 
example might be for situations where you have a two level navigation 
and you would like to add at least a second submenu record to have the 
submenu not look so empty. Whereas it would be possible to flip the 
shortcut (page 3 pointing to page 4) this would in some cases create 
really ugly URLs (if both pages have almost identical names) - so the 
pages are linked the other way around.

-- 
kind regards,
Franz Koch

---------------------------------------------------
PayPal-Account: 'paypal _at_ elements-net _dot_ de'
---------------------------------------------------


More information about the TYPO3-team-core mailing list