2013-06-12 4 views
0

Magento로 위젯을 개발하고 있습니다. 나는 성공적으로 지시 HERE을 따라 갔다. 이제 백엔드 위젯 삽입 동작을 변경하고 싶습니다. 특히 나는 실제 다중 선택에서 다른 것 (파일 업로드를 원한다)에 이르기까지 입력의 유형을 변경하고 싶습니다.Magento 위젯 사용 가능 유형

이것이 수행하는 코드 :

<parameters> 
    <enabled_services> 
    <label>Enabled Services</label> 
    <visible>1</visible> 
    <required>1</required> 
    <type>multiselect</type> 
    <source_model>widgettwo/services</source_model> 
    </enabled_services> 
</parameters> 

그래서, 대신 다중 선택, 나는 다른 뭔가를하고 싶습니다. 사용 가능한 모든 유형의 목록을 어디서 찾을 수 있습니까? 어딘가에 가이드가 있습니까?

답변

2

위에서 설명한 튜토리얼에서 유형을 알려줍니다.

에서 : http://www.magentocommerce.com/knowledge-base/entry/tutorial-creating-a-magento-widget-part-2

  <!-- Option type --> 
      <type>select</type> 
      <!-- 
       It can be either one of the simple form element types, e.g.: 
        <type>text</type> 
        <type>select</type> 
        <type>multiselect</type> 
        <type>label</type> 
       ... 

       or it can define a renderer which will be used to create 
       this configuration field in the edit form. 
       Renderer is supposed to be a block reference 
       in 'block_group/block_path' format, e.g.: 
        <type>mymodule/some_custom_block</type> 
      --> 

      <!-- Source values for drop-downs and multiselects --> 

      <!-- 
       There are two possible ways to define a set of available values. 
       The first way is to specify the list of available values right here: 
      --> 
      <values> 
       <value_one translate="label"> 
        <value>1</value> 
        <label>One</label> 
       </none> 
       <two translate="label"> 
        <value>2</value> 
        <label>Two</label> 
       </two> 
       <three translate="label"> 
        <value>3</value> 
        <label>Three</label> 
       </three> 
      </values> 

      <!-- 
       The second way is to specify the source model, 
       which must have toOptionArray() public method available. 
       The method should return an array of values and labels 
       in the following format: 
        array(
         array('value' => 'value1', 'label' => 'Label 1'), 
         array('value' => 'value2', 'label' => 'Label 2'), 
         array('value' => 'value2', 'label' => 'Label 3'), 
        ); 
       Source model name is specified in usual 
       'model_group/model_path' format, e.g.: 
      --> 
      <source_model>adminhtml/system_config_source_yesno</source_model> 

      <!-- Additional helper block to be created on the edit form page, optional --> 
      <helper_block> 
       <!-- Helper block reference in regular 'block_group/block_path' format --> 
       <type>module/block_type</type> 

       <!-- Arguments for the block constructor, optional --> 
       <data> 
        <value1>Value1</value1> 
        <value2>Value1</value2> 
        <value3> 
         <one>One</one> 
         <two>Two</two> 
        </value3> 
       </data> 
      </helper_block> 

      <!-- 
       Here is the full example of helper block definition 
       from catalog module widgets: 

       <helper_block> 
        <type>adminhtml/catalog_product_widget_chooser</type> 
        <data> 
         <button translate="open"> 
          <open>Select Product...</open> 
         </button> 
        </data> 
       </helper_block> 

      --> 
     </first_option> 

이 StackExchange 질문은 질문의 업로드 부분에 대답 할 수 있습니다 Images in Magento widgets

+0

이 더 많은 종류가 있습니다. 모든 HTML 입력이 있습니다. –