dongling4383 2015-05-26 18:13 采纳率: 100%
浏览 39

Joomla:将文章文本移到另一个位置

I am changing a little bit protostar template and I would like to show article text no at content possition but on sidebar.

I have found that text is shown by this components\com_content\views\article\tmpl\default.php line 111:

<?php echo $this->item->text; ?>

but when I put this somewhere in templates\protostar\index.php it does not work (as expected :))

Could you please advice how to move this?

Thanks!

  • 写回答

1条回答 默认 最新

  • douyan2680 2015-05-27 08:58
    关注

    You need to do changes in your templates\protostar\index.php file where :

    Cut

    <jdoc:include type="message" />
    <jdoc:include type="component" />
    

    from this code :

        <div class="row-fluid">
        <?php if ($this->countModules('position-8')) : ?>
        <!-- Begin Sidebar -->
             <div id="sidebar" class="span3">
                <div class="sidebar-nav">
                    <jdoc:include type="modules" name="position-8" style="xhtml" />
                </div>
            </div>
        <!-- End Sidebar -->
       <?php endif; ?>
       <main id="content" role="main" class="<?php echo $span; ?>">
        <!-- Begin Content -->
            <jdoc:include type="modules" name="position-3" style="xhtml" />
    
                <jdoc:include type="message" />
                <jdoc:include type="component" />
    
                <jdoc:include type="modules" name="position-2" style="none" />
                            <!-- End Content -->
        </main>
        <?php if ($this->countModules('position-7')) : ?>
            <div id="aside" class="span3">
            <!-- Begin Right Sidebar -->
                <jdoc:include type="modules" name="position-7" style="well" />
            <!-- End Right Sidebar -->
            </div>
        <?php endif; ?>
      </div>
    

    and paste it after position-7 or before postion-3, whichever side you need to show your content, i.e.

    <div class="row-fluid">
       <?php if ($this->countModules('position-8')) : ?>
         <!-- Begin Sidebar -->
         <div id="sidebar" class="span3">
           <div class="sidebar-nav">
              <jdoc:include type="modules" name="position-8" style="xhtml" />
           </div>
         </div>
         <!-- End Sidebar -->
       <?php endif; ?>
       <main id="content" role="main" class="<?php echo $span; ?>">
        <!-- Begin Content -->
           <jdoc:include type="modules" name="position-3" style="xhtml" />
           <jdoc:include type="modules" name="position-2" style="none" />
        <!-- End Content -->
       </main>
       <?php if ($this->countModules('position-7')) : ?>
          <div id="aside" class="span3">
            <!-- Begin Right Sidebar -->
    
              <jdoc:include type="message" />
              <jdoc:include type="component" />
    
              <jdoc:include type="modules" name="position-7" style="well" />
             <!-- End Right Sidebar -->
           </div>
          <?php endif; ?>
       </div>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP