Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hello KK,

I'm trying to display "k_tile_name" of mosaic in list_view of backend.

I know the way to use,

Code: Select all
<cms:config_list_view>
    <cms:field 'k_content'>
        <div class="mosaic-list">
            <div class="row">
                <div class="cell cell-label col-md-2">
                    <label>Tile Name</label>
                </div>
                <div class="cell cell-content col-md-10">
                    <div class="field-content">
                    <cms:show k_tile_name />
                    </div>
                </div>
            </div>
        </div>
    </cms:field>
</cms:config_list_view>


But in this case, I have to re-define all other fields in "<cms:config_list_view>".
Are there any another easy ways or tips?

Thank you in advance.
Hi,

The easiest way would be to override the default snippet that is used by mosaic to render each row.

That snippet is 'couch/addons/mosaic/theme/content_row_mosaic.html'.
Place a copy of it in 'couch/theme/sample' and now this copied snippet would be used by mosaic (if you are unclear about the overriding mechanism, please see "Themeing" in viewtopic.php?f=5&t=10241).

Edit this snippet to add your new row i.e. make the snippet as follows -
Code: Select all
<div class="mosaic-list">
    <div class="row">
        <div class="cell cell-label col-md-2">
            <label>Tile Name</label>
        </div>
        <div class="cell cell-content col-md-10">
            <div class="field-content">
            <cms:show k_tile_name />
            </div>
        </div>
    </div>
           
    <cms:db_fields bound='1' render_display='1' types='NOT thumbnail, jcropthumb, reverse_relation, message, password, hidden'>
        <cms:if type='group'>
            <div class="group-heading">
                <cms:show k_caption />
            </div>
        <cms:else />
            <div class="row k_element_<cms:show name /> k_<cms:show type />">
                <div class="cell cell-label col-md-2">
                    <label><cms:show k_caption /></label>
                </div>
                <div class="cell cell-content col-md-10">
                    <div class="field-content">
                        <cms:show k_display_html />
                    </div>
                </div>
            </div>
        </cms:if>
    </cms:db_fields>
</div> 

And that should be it.

Hope this helps.
Hello, KK.

Thank you very much for your reply.
This works like a charm.

I didn't know even addons could use theme function.
(I thought I needed to fix mosaic.php.)

Thank you again KK.
CouchCMS is a really great product!!
You are welcome :)
4 posts Page 1 of 1