by
KK » Tue Jul 03, 2018 4:24 pm
In the docs on Couch v2.0 (
viewtopic.php?f=5&t=10241), under the section "Customizing the Form screen", you'll find a sample that 'mimics' the publish-date region using custom inputs.
Following is a slightly modified version of the sample (with check for a new page (i.e. with id='-1')) -
- Code: Select all
<cms:config_form_view>
<cms:persist
k_publish_date="<cms:if frm_my_publish_status='0'>0000-00-00 00:00:00<cms:else/><cms:show frm_my_publish_date /></cms:if>"
_auto_title='1'
/>
<cms:field 'my_publish_date' label='Publish Date' order='101' group='_advanced_settings_'>
<cms:input type='radio'
name='my_publish_status'
opt_selected="<cms:if k_page_date='0000-00-00 00:00:00' || k_page_id='-1'>0<cms:else />1</cms:if>"
opt_values='Published=1 | Unpublished=0'
/>
<div id="my-date-dropdown" style="<cms:if k_page_date='0000-00-00 00:00:00' || k_page_id='-1'>display:none;</cms:if>">
<cms:input
name=k_field_input_name
type='datetime'
format='mdy'
fields_separator=','
default_time="<cms:if k_cur_form_mode='edit' && k_page_date!='0000-00-00 00:00:00'><cms:show k_page_date /><cms:else />@current</cms:if>"
allow_time='1'
minute_steps='1'
required='1'
/>
</div>
</cms:field>
<cms:field 'k_publish_date' hide='1' />
<cms:script>
$( function(){
$('#my_publish_status0').on('click', function(e){
$('#my-date-dropdown').css('display', 'block')
});
$('#my_publish_status1').on('click', function(e){
$('#my-date-dropdown').css('display', 'none')
});
});
</cms:script>
</cms:config_form_view>
Please try using it on the relevant template.
Hope it helps. Do let me know.