CMS Development

remiwebs
Member | Elite Partner
Member | Elite Partner

Custom module / Hubl in Global group

Hi,

 

Why is it impossible to put a custom module / hubl in a global group in the COS template builder?

 

I need some custom coding in an global group.

hubl.jpg

 

 

 

 

 

 

 

 

 

Code in the Hubl:

 

{% set repeat_amount = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] %}
{% choice "uspblocks_amount" label='Number of USP blocks', value='0', choices='{{ repeat_amount }}' export_to_template_context=True %}

<div class="row-fluid-wrapper">
    <div class="row-fluid">
        {% for options in repeat_amount %}
            {% if loop.index <= widget_data.uspblocks_amount.value %}
                
                <div class="span4 widget-span overflow-hidden">
        
                    {% widget_block rich_text "right_column" overrideable=True, label='USP block', unique_in_loop=True  %}
                        {% widget_attribute "html" %}
                            <p>UPS block</p>
                        {% end_widget_attribute %}
                    {% end_widget_block %}
                </div>
                
               {% if  loop.index % 3 == 0 %}
                        </div>
                   </div>
                   <div class="row-fluid-wrapper">
                        <div class="row-fluid">
               {% endif %}
        
            {% endif %}
        {% endfor %}
    
    </div>
</div>

Im getting an error when I try to make a global group of the complete component.

 

I want to put the complete 'content container' element in a global group to use it in different templates. What is the best way to achieve this in an efficient way?

 

0 Upvotes
2 Replies 2
Jsum
Key Advisor

Custom module / Hubl in Global group

@remiwebs,

 

I've had this same issue. Oddly enough it appears that the custom hubl and the custom html modules are interchangeable meaning that you can use hubl in the custom html module. Also, while the custom hubl module was never available in the (now removed) list for adding a global module, the custom html module is available. 

 

Short version: just use a custom html module for your hubl code and it can be made global.

0 Upvotes
remiwebs
Member | Elite Partner
Member | Elite Partner

Custom module / Hubl in Global group

Also tried to put the following in a custom module:

 

<div class="row-fluid-wrapper row-depth-1 row-number-7 ">
<div class="row-fluid ">
<div class="span12 widget-span widget-type-cell padding-top-large padding-bottom-large" style="" data-widget-type="cell" data-x="0" data-w="12">

<div class="row-fluid-wrapper row-depth-1 row-number-8 ">
<div class="row-fluid ">
<div class="span12 widget-span widget-type-cell row-max-width-large" style="" data-widget-type="cell" data-x="0" data-w="12">

<div class="row-fluid-wrapper row-depth-1 row-number-9 ">
<div class="row-fluid ">
<div class="span12 widget-span widget-type-rich_text text-center" style="" data-widget-type="rich_text" data-x="0" data-w="12">
<div class="cell-wrapper layout-widget-wrapper">
{% widget_block rich_text "module_149855682756573" overrideable=true, ending_html='', starting_html='', label='Text' %}
{% widget_attribute "html" %}<h2>Title</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vel consectetur ipsum, in hendrerit nunc. Etiam euismod ut ligula nec vulputate. Suspendisse potenti.</p>{% end_widget_attribute %}
  {% end_widget_block %}
</div><!--end layout-widget-wrapper -->
</div><!--end widget-span -->
</div><!--end row-->
</div><!--end row-wrapper -->

<div class="row-fluid-wrapper row-depth-1 row-number-10 ">
<div class="row-fluid ">
<div class="span12 widget-span widget-type-raw_jinja " style="" data-widget-type="raw_jinja" data-x="0" data-w="12">
{% set repeat_amount = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] %}
{% choice "uspblocks_amount" label='Number of USP blocks', value='0', choices='{{ repeat_amount }}' export_to_template_context=True %}

<div class="row-fluid-wrapper">
    <div class="row-fluid">
        {% for options in repeat_amount %}
            {% if loop.index <= widget_data.uspblocks_amount.value %}
                
                <div class="span4 widget-span overflow-hidden">
        
                    {% widget_block rich_text "right_column" overrideable=True, label='USP block', unique_in_loop=True  %}
                        {% widget_attribute "html" %}
                            <p>UPS block</p>
                        {% end_widget_attribute %}
                    {% end_widget_block %}
                </div>
                
               {% if  loop.index % 3 == 0 %}
                        </div>
                   </div>
                   <div class="row-fluid-wrapper">
                        <div class="row-fluid">
               {% endif %}
        
            {% endif %}
        {% endfor %}
    
    </div>
</div></div><!--end widget-span -->

</div><!--end row-->
</div><!--end row-wrapper -->

</div><!--end widget-span -->
</div><!--end row-->
</div><!--end row-wrapper -->

</div><!--end widget-span -->
</div><!--end row-->
</div><!--end row-wrapper -->

This is not working, when i create the field with hubl in stead of the automatic field creator in the custom module editor on the left the editorfields on the left are not displayed in the page editor itself.

 

I dont want to add 18 rich text editors in the custom module and want to have a repeater.

 

hubl2.jpg

 

 

 

 

 

 

 

 

 

 

 

This is working with custom hubl code from the image in the previous post but i can't make a global group of this.

 

I need to work with the COS template builder because other people without HTML knowledge need to be able to work with it.

0 Upvotes