Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hi I am trying to use more than one editable field under a conditional field but it seems not to be working. I did this:
Code: Select all
<cms:editable 
    type='radio'
    name='post_type'
    label='Choose post format'
    opt_values='Standard | Video | Audio | Link | Quote'
/>

    <cms:func _into='my_cond' post_type=''>
        <cms:if post_type='Standard'>show<cms:else />hide</cms:if>
    </cms:func>
    <cms:editable name='image' label='Image' desc='Recommended image width 2880px' type='image' show_preview='1' preview_width='150' not_active=my_cond/>
    <cms:editable name='text' label='Slide Text' type='textarea' not_active=my_cond />

    <cms:func _into='my_cond' post_type=''>
        <cms:if post_type='Video'>show<cms:else />hide</cms:if>
    </cms:func>
    <cms:editable name='video' label='Video Embed Code' type='text' not_active=my_cond/>
    <cms:editable name='video_featured_content' label='Post Content' desc='Write all your post content here' type='richtext'/>

    <cms:func _into='my_cond' post_type=''>
        <cms:if post_type='Audio'>show<cms:else />hide</cms:if>
    </cms:func>
    <cms:editable name='video' label='Video Embed Code' type='text' not_active=my_cond/>
    <cms:editable name='audio_featured_content' label='Audio Post Content' desc='Write all your post content here' type='richtext'/>


However on the the editable field closest to the function is what seems to be working. Any editable field that follows appears under any of the options I choose. Any help here. Thanks
Hi,

It seems you have missed adding not_active=my_cond to those regions that appear to be misbehaving.
Following amended code should work -
Code: Select all
<cms:editable 
    type='radio'
    name='post_type'
    label='Choose post format'
    opt_values='Standard | Video | Audio | Link | Quote'
/>

    <cms:func _into='my_cond' post_type=''>
        <cms:if post_type='Standard'>show<cms:else />hide</cms:if>
    </cms:func>
    <cms:editable name='image' label='Image' desc='Recommended image width 2880px' type='image' show_preview='1' preview_width='150' not_active=my_cond/>
    <cms:editable name='text' label='Slide Text' type='textarea' not_active=my_cond />

    <cms:func _into='my_cond' post_type=''>
        <cms:if post_type='Video'>show<cms:else />hide</cms:if>
    </cms:func>
    <cms:editable name='video' label='Video Embed Code' type='text' not_active=my_cond/>
    <cms:editable name='video_featured_content' label='Post Content' desc='Write all your post content here' type='richtext' not_active=my_cond />

    <cms:func _into='my_cond' post_type=''>
        <cms:if post_type='Audio'>show<cms:else />hide</cms:if>
    </cms:func>
    <cms:editable name='video' label='Video Embed Code' type='text' not_active=my_cond/>
    <cms:editable name='audio_featured_content' label='Audio Post Content' desc='Write all your post content here' type='richtext' not_active=my_cond />

Hope this helps.
Hi KK, thanks very much for the heads up. Now I want to be able to do this: I am using the script below to move to the next and previous posts.
Code: Select all
<cms:php>
                                  global $CTX;
                                  $page_ids = explode( ",", "<cms:pages ids_only='1' />" );
                                  $cur_page_id = "<cms:show k_page_id />";
                                 $pos = array_search( $cur_page_id, $page_ids );
                                  if( $pos!==FALSE ){
                                  if( $pos>0 ){
                                     // Prev page id
                                     $prev_page_id = $page_ids[$pos-1];
                                     $CTX->set( 'prev_page_id', $prev_page_id, 'global' );
                                  }
                                  if( $pos<count($page_ids)-1 ){
                                     // Next page id
                                     $next_page_id = $page_ids[$pos+1];
                                    $CTX->set( 'next_page_id', $next_page_id, 'global' );
                                  }
                                  }
                                </cms:php>
                               
                                <div class="inteco-single-nav-area clearfix">
                                    <span class="inteco-single-nav inteco-single-nav-left">
                                        <span class="inteco-text inteco-title-font" >Previous Post</span>

                                        <cms:if prev_page_id >
                                        <cms:pages id=prev_page_id>
                                        <a href="<cms:show k_page_link />" rel="prev">
                                            <span class="inteco-single-nav-title inteco-title-font" ><cms:show k_page_title /></span>
                                        </a>
                                        </cms:pages>
                                        </cms:if>

                                    </span>
                                    <span class="inteco-single-nav inteco-single-nav-right">
                                        <span class="inteco-text inteco-title-font" >Next Post</span>

                                        <cms:if next_page_id >
                                        <cms:pages id=next_page_id>
                                        <a href="<cms:show k_page_link />" rel="next">
                                            <span class="inteco-single-nav-title inteco-title-font" ><cms:show k_page_title /></span>
                                        </a>
                                        </cms:pages>
                                        </cms:if>

                                    </span>
                                    <div class="inteco-single-nav-area-divider"></div>
                                </div>


I would want the pages tag to skip next or previous posts that contain custom fields that contain Quote, Link or Video

NB: the custom field in question is
Code: Select all
<cms:editable 
    type='radio'
    name='post_type'
    label='Choose post format'
    opt_values='Standard | Video | Audio | Link | Quote'
/>
And another issue again. I'm very sorry to bother you. Is it possible to do something like this:
Code: Select all
<cms:set my_user="<cms:gpc 'user' method='get' />" />
<cms:if my_user >
<cms:set my_filter="author=<cms:show my_user />" 'global' />
</cms:if>

<cms:set post_format="<cms:gpc 'postformat' method='get' />" />
<cms:if post_format >
<cms:set my_post_type="post_type=<cms:show post_format />" 'global' />
</cms:if>

<cms:pages masterpage="press-post.php" folder=k_folder_name start_on=k_archive_date stop_before=k_next_archive_date custom_field=my_filter  custom_field=my_post_type>


This --> custom_field=my_filter is ignored by the filter and only this --> custom_field=my_post_type works. Help needed. Thank you
4 posts Page 1 of 1

Who is online

In total there are 11 users online :: 1 registered, 0 hidden and 10 guests
(based on users active over the past 5 minutes)

Users browsing this forum: Exabot [Bot] and 10 guests