How to cut inside bp_current_action switch ?
-
I’ve got this problem where I would like to alter the layout of the messages pages.
My mission is to have the inbox and sendbox loop always active on each page inside the sidebar of the messages pages. This isn’t really a real WP sidebar but I just spilled the messages template into two parts and called the left side sidebar. So everything stays together inside one template but I’ve got a problem understanding the switch( bp_current_action() ) tag.
How can I break this into pieces, because I would like to have compose, single + notices always show up on the right side of the content and the inbox + sendbox on the left side + always active.
Only problem is if I use the switch bp_current_action tag twice on the same template it will break the code for some reason.
<?php switch ( bp_current_action() ) : // Inbox/Sentbox case 'inbox' : case 'sentbox' : do_action( 'bp_before_member_messages_content' ); ?> <div class="messages" role="main"> <?php bp_get_template_part( 'members/single/messages/messages-loop' ); ?> </div><!-- .messages --> <?php do_action( 'bp_after_member_messages_content' ); break; // Single Message View case 'view' : bp_get_template_part( 'members/single/messages/single' ); break; // Compose case 'compose' : bp_get_template_part( 'members/single/messages/compose' ); break; // Sitewide Notices case 'notices' : do_action( 'bp_before_member_messages_content' ); ?> <div class="messages" role="main"> <?php bp_get_template_part( 'members/single/messages/notices-loop' ); ?> </div><!-- .messages --> <?php do_action( 'bp_after_member_messages_content' ); break; // Any other default : bp_get_template_part( 'members/single/plugins' ); break; endswitch;
- The topic ‘How to cut inside bp_current_action switch ?’ is closed to new replies.