[TYPO3-english] Making access status visible in the Frontend

Walrick lists at globalhealingcircle.net
Wed Apr 22 18:30:42 CEST 2009


To make this thread complete for other people who may need this.

I have added and edited my TS a bit more to make it possible to create
containers around the content depending on the access status.

Combined with come css styling the following puts a red box around all
the content is the entire page is members-only, and a yellow box if the
entire page is CT-only (a kind of management team). It also adds some
text above the boxes.

If the page is public but contains members-only or CT-only content the
individual content element gets the border and the text above it.

If the page is members-only but contains CT-only elements. The entire
content gets a red border and the ct element a yellow one.

Note that the div container around the whole thing is closed in my html
template. So the final </div> is missing in this code. The texts have
yet to be replaced by constants to allow for translation.

The TS:

--
temp.PageAccess = TEXT
temp.PageAccess.value = <div class="publicpage">

temp.MainContent < styles.content.get
temp.MainContent.renderObj.stdWrap.wrap = <div
class="content-unit">|</div></div>
temp.MainContent.renderObj.stdWrap.stdWrap.preCObject = TEXT
temp.MainContent.renderObj.stdWrap.stdWrap.preCObject.value = <div
class="public">

[globalVar = TSFE:page|fe_group = -2,TSFE:page|fe_group = 1] &&
[usergroup = 1,2]
temp.PageAccess = TEXT
temp.PageAccess.value = <div class="membersonlytext">Members
Only</div><div class="membersonlypage">

temp.MainContent.renderObj.stdWrap.stdWrap.stdWrap.preCObject = TEXT
temp.MainContent.renderObj.stdWrap.stdWrap.stdWrap.preCObject.value =
<div class="ctonlytext">CT Only</div><div class="ctonly">
temp.MainContent.renderObj.stdWrap.stdWrap.stdWrap.preCObject.if {
				value = 2
				equals.field = fe_group
				}
[END]

[globalVar = TSFE:page|fe_group = 2] && [usergroup = 2]
temp.PageAccess = TEXT
temp.PageAccess.value = <div class="ctonlytext">CT Only</div><div
class="ctonlypage">
[END]

[globalVar = TSFE:page|fe_group = ,TSFE:page|fe_group =
0,TSFE:page|fe_group = -1]
temp.MainContent.renderObj.stdWrap.stdWrap.preCObject.if {
				value = -2,1,2
				isInList.field = fe_group
				negate = 1
				}
temp.MainContent.renderObj.stdWrap.stdWrap.stdWrap.preCObject = TEXT
temp.MainContent.renderObj.stdWrap.stdWrap.stdWrap.preCObject.value =
<div class="membersonlytext">Members Only</div><div class="membersonly">
temp.MainContent.renderObj.stdWrap.stdWrap.stdWrap.preCObject.if {
				value = -2,1
				isInList.field = fe_group
				}
temp.MainContent.renderObj.stdWrap.stdWrap.stdWrap.stdWrap.preCObject = TEXT
temp.MainContent.renderObj.stdWrap.stdWrap.stdWrap.stdWrap.preCObject.value
= <div class="ctonlytext">CT Only</div><div class="ctonly">
temp.MainContent.renderObj.stdWrap.stdWrap.stdWrap.stdWrap.preCObject.if {
				value = 2
				equals.field = fe_group
				}
[END]

--

Regards

Walrick


-- 
webmaster Global Healing Circle
www.globalhealingcircle.net


More information about the TYPO3-english mailing list