I want to show petition in page but using template file. Is it possible?
I have used below shortcode in template file but it not worked.
<?php echo do_shortcode('[civicrm component="petition" id="1" hijack="0"]');?>
Also I want to show another petition in popup but also there shortcode not working
See I want to default petition show in sidebar so i get default petition Id using custom query but i can't get petition with profile form using shortcode. Any other method to get petition using id. See below query for get default petition id.
$petition = civicrm_api3( 'Survey', 'getsingle', array(
'sequential' => 1,
'is_active' => 1,
'is_public' => 1,
'is_template' => 0,
'options' => array(
'limit' => 1,
'sort' => 'id ASC',
'offset' => CRM_Utils_Array::value( 'offset', $instance, 0 ),
),
'is_default' => array( '1'),
) );
$petition_id= $petition['id']
Thanks In advance