我怎样才能拥有“当前用户”portlet?

时间:2011-11-09 14:21:22

标签: liferay portlet

我已经从演示安装中关闭了“当前用户”portlet,现在无法将其打开 - 列表中没有这样的portlet。

如何将它重新载入页面?

感谢。

1 个答案:

答案 0 :(得分:2)

“当前用户”portlet实际上只是一个已重命名的“Web内容显示”portlet。因此,如果您将“Web内容显示”portlet添加到您的页面并设置,然后找到名为“欢迎登录”的Web内容(它的ID是10232,但这可能与您不同)并将其设置为要显示的内容你会得到它。或者您可以使用以下代码添加新的Web内容:

    <p><style type="text/css"> .loginuser { margin-top:5px; width:100%; display:block; text-decoration:none; padding: 2px; padding-bottom: 10px; } .loginuser h2 { margin:0; font-size:14px; /*text-align:center;*/ } .loginuser a { display:block; padding-left: 20px; margin-left: 95px; margin-top: 2px; } .loginuser img { padding:2px; margin-right: 5px; } .loginuser:hover { background-color: #CED9E2; /*cursor:pointer;*/ } .express_login { background: url("/html/icons/login.png") no-repeat; } .public_pages { background: url("/html/themes/classic/images/common/view_tasks.png") no-repeat; } </style></p>
<form name="loginadmin" method="post" action="/web/guest/home">
    <input type="hidden" value="58" name="p_p_id" /> <input type="hidden" value="1" name="p_p_lifecycle" /> <input type="hidden" value="view" name="p_p_mode" /> <input type="hidden" value="maximized" name="p_p_state" /> <input type="hidden" value="/login/login" name="_58_struts_action" /> <input type="hidden" value="bruno@7cogs.com" name="_58_login" /> <input type="hidden" value="bruno" name="_58_password" />
    <div title="Login: bruno@7cogs.com, Password: bruno" class="loginuser">
    <div style="float: left; padding-right: 4px;" class="user-profile-image"><img width="80" class="avatar" alt="" src="/image/user_portrait?screenName=bruno&amp;companyId=10112&amp;t=1228845375900" /></div>
    <h2>Bruno (Admin)</h2>
    <div>The admin has full control over the entire portal, allowing modification and creation of users, communitities, and roles. <a class="public_pages" href="/web/bruno">View bruno's public page</a> <a onclick="document.loginadmin.submit();return false;" class="express_login" href="#">Login as bruno</a></div>
    </div>
</form>
<form name="loginrich" method="post" action="/web/guest/home">
    <input type="hidden" value="58" name="p_p_id" /> <input type="hidden" value="1" name="p_p_lifecycle" /> <input type="hidden" value="view" name="p_p_mode" /> <input type="hidden" value="maximized" name="p_p_state" /> <input type="hidden" value="/login/login" name="_58_struts_action" /> <input type="hidden" value="richard@7cogs.com" name="_58_login" /> <input type="hidden" value="richard" name="_58_password" />
    <div title="Login: richard@7cogs.com, Password: richard" class="loginuser">
    <div style="float: left; padding-right: 4px;" class="user-profile-image"><img width="80" class="avatar" alt="" src="/image/user_portrait?screenName=richard&amp;companyId=10112&amp;t=1228845375871" /></div>
    <h2>Richard Publisher</h2>
    <div>Richard has article submission rights for the content management system. <a class="public_pages" href="/web/richard">View richard's public page</a> <a onclick="document.loginrich.submit();return false;" class="express_login" href="#">Login as richard</a></div>
    </div>
</form>
<form name="loginmichelle" method="post" action="/web/guest/home">
    <input type="hidden" value="58" name="p_p_id" /> <input type="hidden" value="1" name="p_p_lifecycle" /> <input type="hidden" value="view" name="p_p_mode" /> <input type="hidden" value="maximized" name="p_p_state" /> <input type="hidden" value="/login/login" name="_58_struts_action" /> <input type="hidden" value="michelle@7cogs.com" name="_58_login" /> <input type="hidden" value="michelle" name="_58_password" />
    <div title="Login: michelle@7cogs.com, Password: michelle" class="loginuser">
    <div style="float: left; padding-right: 4px;" class="user-profile-image"><img width="80" class="avatar" alt="" src="/image/user_portrait?screenName=michelle&amp;companyId=10112&amp;t=1228845375823" /></div>
    <h2>Michelle Editor</h2>
    <div>Michelle has control over the staging and layout of all articles as well as publishing rights for workflow and the content management system. <a class="public_pages" href="/web/michelle">View michelle's public page</a> <a onclick="document.loginmichelle.submit();return false;" class="express_login" href="#">Login as michelle</a></div>
    </div>
</form>
<form name="loginjohn" method="post" action="/web/guest/home">
    <input type="hidden" value="58" name="p_p_id" /> <input type="hidden" value="1" name="p_p_lifecycle" /> <input type="hidden" value="view" name="p_p_mode" /> <input type="hidden" value="maximized" name="p_p_state" /> <input type="hidden" value="/login/login" name="_58_struts_action" /> <input type="hidden" value="john@7cogs.com" name="_58_login" /> <input type="hidden" value="john" name="_58_password" />
    <div title="Login: john@7cogs.com, Password: john" class="loginuser">
    <div style="float: left; padding-right: 4px;" class="user-profile-image"><img width="80" class="avatar" alt="" src="/image/user_portrait?screenName=john&amp;companyId=10112&amp;t=1228845375887" /></div>
    <h2>John Regular User</h2>
    <div>John is a user with minimum rights within the portal.
    <div><a class="public_pages" href="/web/john">View john's public page</a> <a onclick="document.loginjohn.submit();return false;" class="express_login" href="#">Login as john</a></div>
    </div>
    </div>
</form>

希望这有帮助!