drsl90685154 2014-06-11 22:11
浏览 21
已采纳

QuickApps CMS和主题菜单更改

I'm trying to make a new theme for QuickApps CMS. When I try to echo:

<?php echo $this->Block->region('user-menu'); ?>

To render the user-menu in the new theme layout, it do two things:

  1. Print out a title for the menu named "User Menu" while in the Default theme it does not print this title.

  2. In addition it prints different HTML as follows

My New Theme output

<div id="qa-block-5" class="qa-block qa-block-unique qa-block-menu">

  <div id="block_5" class="block block-Menu delta-user-menu ">

       <h2> User Menu </h2>

         <div class="content">
            <ul>
            <li id="menu-item-22" class="first-item menu-item-22"><a href="/4test/quick-apps/user/my_account" target="_self"><span>My account</span></a>    </li>
            <li id="menu-item-23" class="last-item menu-item-23"><a href="/4test/quick-apps/user/logout" target="_self"><span>Logout</span></a> </li>
        </ul>
            </div>
            </div>
</div>

The Default Theme ouput

<div id="user-menu">
                    <div id="qa-block-5" class="qa-block qa-block-unique qa-block-menu">
<ul>
    <li id="menu-item-22" class="first-item menu-item-22"><a href="/4test/quick-apps/user/my_account" target="_self"><span>My account</span></a>    </li>
    <li id="menu-item-23" class="last-item menu-item-23"><a href="/4test/quick-apps/user/logout" target="_self"><span>Logout</span></a> </li>
</ul>
</div>              </div>

I tried to find any elements that handles this HTML but I could not find. What I need to know is how to change the output of the menu according to my new theme? i.e change its HTML structure including styles class names.

  • 写回答

1条回答 默认 最新

  • dongwei1895 2014-08-19 17:46
    关注

    If you need to customize the output, your theme can implement the "theme_block" view element, it will be used when rendering each block.

    Here you can see "Default Theme" implementation:

    https://github.com/QuickAppsCMS/QuickApps-CMS/blob/1.1/QuickApps/View/Themed/Default/Elements/theme_block.ctp

    QuickApps uses a series of view elements for when rendering, if your theme do not implement any of this core's element are used by default. Here you can see a list of elements your theme may implement:

    https://github.com/QuickAppsCMS/QuickApps-CMS-Docs/blob/1.x/eng/designers/themes.md#rendering-elements

    Best regards! /Chris


    PS: BTW, there are big changes coming in v2.0 so stay tuned. For example blocks & regions are now objects, you can now do nifty things, for instance:

    $this->region('main-menu')
        ->merge($this->region('other-region'))
        ->blockLimit(5);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类