duanmu2941 2012-04-10 17:44
浏览 27
已采纳

Opencart&vqmod - 搜索多行 - 似乎找不到我要找的东西,是因为标签/空白?

I am trying to use vqmod to implement a new custom field called 'Additional Description' to opencart.

In my vqmod xml file, I am trying to add an extra row to

admin/view/template/catalog/product_form.tpl

I would like this field to appear below the existing 'Description' field, so I am using the following code:

    <file name="admin/view/template/catalog/product_form.tpl">
        <operation error="skip">
            <search position="after"><![CDATA[
            <tr>
                <td><?php echo $entry_description; ?></td>
                <td><textarea name="product_description[<?php echo $language['language_id']; ?>][description]" id="description<?php echo $language['language_id']; ?>"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['description'] : ''; ?></textarea></td>
            </tr>
            ]]></search>
            <add><![CDATA[
            <tr>
                <td><?php echo $entry_description_additional; ?></td>
                <td><textarea name="product_description_additional[<?php echo $language['language_id']; ?>][description_additional]" id="description_additional<?php echo $language['language_id']; ?>"><?php echo isset($product_description_additional[$language['language_id']]) ? $product_description_additional[$language['language_id']]['description_additional'] : ''; ?></textarea></td>
              </tr>
            ]]></add>
        </operation>
    </file>

However, it doesn't seem to find the position to insert the new code. When I put in a single line of code, it finds and inserts it correctly, but not when searching for the block. Is it an issue with whitespace/tabs etc? I am pasting the code directly from the product_form.tpl so I'm not sure what is going on.

  • 写回答

1条回答 默认 最新

  • doujiao2443 2012-04-10 19:13
    关注

    Vqmod will not be able to match Ll of that. It is restricted to single lines only

    Try using this instead to match it

    <search position="after" offset="2"><![CDATA[echo $entry_description;]]></search>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有人能看一下我宿舍管理系统的报修功能该怎么改啊?链表那里总是越界
  • ¥15 cs loadimage运行不了,easyx也下了,没有用
  • ¥15 r包runway详细安装教程
  • ¥15 Html中读取Json文件中数据并制作表格
  • ¥15 谁有RH342练习环境
  • ¥15 STM32F407 DMA中断问题
  • ¥15 uniapp连接阿里云无法发布消息和订阅
  • ¥25 麦当劳点餐系统代码纠错
  • ¥15 轮班监督委员会问题。
  • ¥20 关于变压器的具体案例分析