01/31/2017 at 12:56 pm
#409363
Keymaster
@ Michelle
The only this could be done is thru PHP code. You would have to hook into the cn_entry_action_back_atts filter and change the text option based on the category that is being viewed. Something like this:
function my_custom_cn_back_link( $atts ) {
if ( cnQuery::getVar( 'cn-cat-slug' ) ) {
// If the category slug is a descendant, use the last slug from the URL for the query.
$categorySlug = explode( '/' , cnQuery::getVar( 'cn-cat-slug' ) );
if ( isset( $categorySlug[ count( $categorySlug ) - 1 ] ) ) $categorySlug = $categorySlug[ count( $categorySlug ) - 1 ];
$term = cnTerm::getBy( 'slug', $categorySlug, 'category' );
$category = new cnCategory( $term );
switch ( $category->getID() ) {
case x:
$atts['text'] = 'Back to all Shops';
break;
case y:
$atts['text'] = 'Back to Our Sponsors';
break;
}
}
return $atts;
}
You would change x and y in the code above to the correct category ID. To add more you would add additional case statements.
Hope this helps!
