Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
I think I know what to do here, but is there a better way?

I'm using a clonable template for meeting records. The meetings may relate to different groups, and will obviously have a date and time, so they will always be listed as (say) the Nottingham group meeting on 21 July. There's thus no need for an actual page title - and it's just an annoyance for the admin user to have to replicate the group and date into the title field.

But I can't just hide the title and name fields in the admin panel because the name field has to either have direct input or be populated from the title.

So I'm intending to hide the fields but set k_page_title using something like this:
Code: Select all
<cms:config_form_view>
      <cms:persist
        k_page_title="<cms:show frm_meeting_group />-<cms:show frm_date/>";
    />
</cms:config_form_view>


Two questions:
  • is there a better way of approaching this situation, and
  • will this set the 'name' field as well, or do I need to do that explicitly too/instead?
Using <cms:config_form_view> is the preferred way of tweaking field values. You may also hide the title and name fields in the same block -
Code: Select all
<cms:config_form_view>
    <cms:persist
        k_page_title = "<cms:show frm_meeting_group />-<cms:show frm_date />"
    />

    <cms:field 'k_page_name' hide='1'/>
    <cms:field 'k_page_title' hide='1'/>
</cms:config_form_view>
Setting title is sufficient as the empty name field would be automatically filled by Couch using the title.
Excellent! Thanks, KK.
3 posts Page 1 of 1
cron