1. <legend id='4cNjS'><style id='4cNjS'><dir id='4cNjS'><q id='4cNjS'></q></dir></style></legend>
    <i id='4cNjS'><tr id='4cNjS'><dt id='4cNjS'><q id='4cNjS'><span id='4cNjS'><b id='4cNjS'><form id='4cNjS'><ins id='4cNjS'></ins><ul id='4cNjS'></ul><sub id='4cNjS'></sub></form><legend id='4cNjS'></legend><bdo id='4cNjS'><pre id='4cNjS'><center id='4cNjS'></center></pre></bdo></b><th id='4cNjS'></th></span></q></dt></tr></i><div id='4cNjS'><tfoot id='4cNjS'></tfoot><dl id='4cNjS'><fieldset id='4cNjS'></fieldset></dl></div>
      <bdo id='4cNjS'></bdo><ul id='4cNjS'></ul>

    <small id='4cNjS'></small><noframes id='4cNjS'>

      <tfoot id='4cNjS'></tfoot>
    1. 仅向注册用户显示 joomla 文章,如果未登录则显示登录屏幕是

      时间:2023-10-11

      <small id='0cnoY'></small><noframes id='0cnoY'>

        • <tfoot id='0cnoY'></tfoot>
            <bdo id='0cnoY'></bdo><ul id='0cnoY'></ul>

              <legend id='0cnoY'><style id='0cnoY'><dir id='0cnoY'><q id='0cnoY'></q></dir></style></legend>
              1. <i id='0cnoY'><tr id='0cnoY'><dt id='0cnoY'><q id='0cnoY'><span id='0cnoY'><b id='0cnoY'><form id='0cnoY'><ins id='0cnoY'></ins><ul id='0cnoY'></ul><sub id='0cnoY'></sub></form><legend id='0cnoY'></legend><bdo id='0cnoY'><pre id='0cnoY'><center id='0cnoY'></center></pre></bdo></b><th id='0cnoY'></th></span></q></dt></tr></i><div id='0cnoY'><tfoot id='0cnoY'></tfoot><dl id='0cnoY'><fieldset id='0cnoY'></fieldset></dl></div>

                  <tbody id='0cnoY'></tbody>
                本文介绍了仅向注册用户显示 joomla 文章,如果未登录则显示登录屏幕是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                在 1.6 之前的 Joomla 中,我可以将菜单项设置为公开,以及它的内容:例如一篇注册的文章.

                In Joomla prior to 1.6 i could set a menu-item to public, and its contents: an article for example to registered.

                这会导致人们在未登录时可以在菜单中看到文章链接,但只要点击它就会获得登录组件.之后他们看到了这篇文章.

                This lead to a situation where people could see the link to an article in the menu when not logged in, but got a login component whenever they clicked it. And after that they saw the article.

                在 1.7 中,这些相同的操作会导致当我单击链接时组件屏幕保持空白的情况.

                In 1.7 these same actions lead to a situation where when I click the link the component screen just stays empty.

                当前端用户没有以足够的权限登录时,如何让注册的文章显示登录屏幕? 以前很容易,但我似乎无法让它工作现在.

                How do I get registered articles to show a login screen when the front end user is not logged in with sufficient rights? It was soo easy before and I can't seem to get it to work now.

                推荐答案

                我要回答我自己的问题,因为我相信将来人们会需要这个,而我的解决方案只涉及一些额外代码的规则,然后你就可以将每篇文章等...设置为已注册,当用户未登录时,您将看到一个登录字段.

                Im gonna answer my own question, because Im sure people will need this in the future, and my solution only involves a few rules of extra code and then you can set every article etc... to Registered and you'll see a login field when a user is not logged in.

                在你的模板 index.php 中,将它放在靠近顶部的位置,它可以获得你文章的访问级别.

                In your templates index.php place this near the top, it gets your article's access level.

                $article =& JTable::getInstance("content");
                $article->load(JRequest::getVar('id'));
                $cAccLevel = $article->get("access");
                

                然后在您的组件上方添加一个模块位置,并且仅在您需要的访问级别> 1 时才显示它

                Then add a module position above your component, and only show it when your needed access level is > 1

                <?php if($cAccLevel > 1): ?>
                    <jdoc:include type="modules" name="LOGIN_MODULE_POSITION" />
                <?php endif; ?>
                

                然后在模块管理器中将登录模块添加到 LOGIN_MODULE_POSITION.

                Then add a login module in your module manager to LOGIN_MODULE_POSITION.

                瞧...不需要路由等等...一切都是开箱即用的,我选择像这样设置注销框和操作字段的样式:

                Voila... no routing needed etc... everything works out of the box, I chose to style away the logout box and action field like this:

                .logout-button,
                .actions{
                    display:none;
                }
                

                祝你好运!

                这篇关于仅向注册用户显示 joomla 文章,如果未登录则显示登录屏幕是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Joomla 3.2.1 密码加密 下一篇:如何向现有的 joomla 2.5 组件添加新视图(以及新的菜单项类型)?

                相关文章

              2. <tfoot id='S2Qp4'></tfoot>

                  <i id='S2Qp4'><tr id='S2Qp4'><dt id='S2Qp4'><q id='S2Qp4'><span id='S2Qp4'><b id='S2Qp4'><form id='S2Qp4'><ins id='S2Qp4'></ins><ul id='S2Qp4'></ul><sub id='S2Qp4'></sub></form><legend id='S2Qp4'></legend><bdo id='S2Qp4'><pre id='S2Qp4'><center id='S2Qp4'></center></pre></bdo></b><th id='S2Qp4'></th></span></q></dt></tr></i><div id='S2Qp4'><tfoot id='S2Qp4'></tfoot><dl id='S2Qp4'><fieldset id='S2Qp4'></fieldset></dl></div>

                  <small id='S2Qp4'></small><noframes id='S2Qp4'>

                  1. <legend id='S2Qp4'><style id='S2Qp4'><dir id='S2Qp4'><q id='S2Qp4'></q></dir></style></legend>
                      <bdo id='S2Qp4'></bdo><ul id='S2Qp4'></ul>