[Typo3] Show some text if login is required?

JoH info at cybercraft.de
Wed Aug 17 16:06:48 CEST 2005


>> How do I present the fe_user with a text like "You must be
>> logged in to see this page, click here to login"?
>>
>> I can control content if the user is logged in or not
>> ([loginUser *]), but this does not help me.
>>
>> The problem typically occours if the user logs in, and
>> bookmarks a password protected page. If the bookmark later on
>> is followed, I just get a blank page (no content).
>>
>> Hi Rene. Have you tried inserting a standard text
>> contentelement on that page, and then in the "Access" field
>> set it to "Hide at any login"
>>
>> When a user who ISN'T logged in, sees the page, the text
>> element is shown, but if the user IS logged in, the text
>> element will be hidden.
>>
> Great idea, but then I have to do this on every page I create! This
> is too inconvenient.

Why? - You can insert it as a TypoScript Element that will only show up when
the user is not logged in _and_ there is content on the page that has some
value greater than 0 in the fe_groups field.

marks.CONTENT = COA
marks.CONTENT {
    10 < styles.content.get
    20 = TEXT
    20.value = Login required to see all content elements!
    20.if.isTrue.numRows {
        table = tt_content
        select {
            where = fe_groups > 0
        }
    }
}

[usergroup = *]
marks.CONTENT.20 >
[global]

Not tested but should be working.

Joey





More information about the TYPO3-english mailing list