Hey!
I would like to have the "album actions" and "item actions" menu's only to be shown when you are logged in as a user. I've been trying to change the albumbody.tpl but I don't now what I should change to make this work...
Any idea why it won't work? I'm on a April 17 snapshot.
mindless
Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-04-19 18:42
I have made a standard template variable so user info is available to every view. You can reference these in any tpl: $user.userName, $user.fullName, $user.isGuest, $user.isRegisteredUser, $user.isAdmin
Update from cvs in a few hours or get tomorrow's nightly snapshot to try this out. If you have any references to $layout.user in your local tpl files you'll need to change these to just $user.
Kirill
Joined: 2004-12-22
Posts: 53
Posted: Tue, 2005-04-19 23:48
Very helpful mindless, thanks.
stoffer
Joined: 2005-02-10
Posts: 75
Posted: Wed, 2005-04-20 08:15
Simple yet great addition. Thanks Mindless! 8)
This is just an idea I got, but it might be worthwhile to consider adding since some like to cut down on the number of items in the albumbody view.
Maybe the admin should have a simple option to set when the Item Action Menu is viewable? Like:
• Everybody
• Users & Admin only
• Admin only
• Nobody (disabled)
stoffer
Joined: 2005-02-10
Posts: 75
Posted: Thu, 2005-06-09 07:51
Okay, I had couple of people asking me how to remove the Item Action drop-down menu for guests, so I might as well update this thread.
Make a copy of the albumBody.tpl in the layout you
currently use (like Matrix) and put it in a /local/ dir.
Posts: 7994
This is a quick hack, but it should work. Edit albumBody.tpl and on line 106 change:
to:
Then edit templates/sidebar.tpl and on line 58 change:
to:
That should do it for you. We'll make it easier to control this in the future.
Posts: 32
thnx!
Posts: 75
FYI: After the recent change to albumBody.tpl the code is now at line 98 - or just above the javascript in case things change again.
Posts: 75
This trick doesn't work for me anymore:
Any idea why it won't work? I'm on a April 17 snapshot.
Posts: 8601
I have made a standard template variable so user info is available to every view. You can reference these in any tpl: $user.userName, $user.fullName, $user.isGuest, $user.isRegisteredUser, $user.isAdmin
Update from cvs in a few hours or get tomorrow's nightly snapshot to try this out. If you have any references to $layout.user in your local tpl files you'll need to change these to just $user.
Posts: 53
Very helpful mindless, thanks.
Posts: 75
Simple yet great addition. Thanks Mindless! 8)
This is just an idea I got, but it might be worthwhile to consider adding since some like to cut down on the number of items in the albumbody view.
Maybe the admin should have a simple option to set when the Item Action Menu is viewable? Like:
• Everybody
• Users & Admin only
• Admin only
• Nobody (disabled)
Posts: 75
Okay, I had couple of people asking me how to remove the Item Action drop-down menu for guests, so I might as well update this thread.
Make a copy of the albumBody.tpl in the layout you
currently use (like Matrix) and put it in a /local/ dir.
Go to line 98 where you have this code:
{if !empty($child.itemLinks)}
and change it to:
{if !empty($child.itemLinks) && $user.isRegisteredUser}
...in order to have the item action menu show for all login users
or...
{if !empty($child.itemLinks) && $user.isAdmin}
...in order to have the item action menu show only for the admin.
Posts: 167
Wow! Makes G2 look SO much cleaner.
Thanks.
Posts: 31
Eh, this is probably a stupid question, but here we go:
I can't seem to find the albumBody.tpl file.
Searched the whole gallery2 site, and no match!
I'm using Gallery2, so why is this file missing on my server?
Posts: 8601
because this topic is 10 months old.. the file is album.tpl now
Posts: 225
The closest thing I see in album.tpl is:
{g->block type="core.ItemLinks" item=$child links=$child.itemLinks}
I'd like to make my sidebar only visible for logged in users as well
Posts: 225
OK so I did this in album.tpl
Changed:
{if !empty($theme.params.sidebarBlocks)}
To:
{if !empty($theme.params.sidebarBlocks) && $user.isRegisteredUser}
Posts: 43
Another way is to change the album's permissions.
[ KORPDATA ] Innovando Soluciones Empresariales