From 4e3583ab4563028309db7d75b350782b05a22b9b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 18 May 2015 22:18:01 +0200 Subject: allow block title to contain $content title --- include/comanche.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/comanche.php b/include/comanche.php index fc4e4004b..1c9fad8f1 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -167,12 +167,21 @@ function comanche_block($s, $class = '') { dbesc($name) ); + //print_r($r); killme(); + if($r) { $o .= (($var['wrap'] == 'none') ? '' : '
'); - if($r[0]['title']) + + if($r[0]['title'] && trim($r[0]['title']) != '$content') { $o .= '

' . $r[0]['title'] . '

'; + } + + if($r[0]['title'] && trim($r[0]['title']) === '$content') { + $o .= '

' . get_app()->data['webpage'][0]['title'] . '

'; + } + - if($r[0]['body'] === '$content') { + if(trim($r[0]['body']) === '$content') { $o .= prepare_text(get_app()->data['webpage'][0]['body'], get_app()->data['webpage'][0]['mimetype']); } else { -- cgit v1.2.3 From 9b64301e0c4af9f7b94b31e48b499d749f91c705 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 18 May 2015 22:19:08 +0200 Subject: remove dbg code --- include/comanche.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/comanche.php b/include/comanche.php index 1c9fad8f1..cca7cb0f6 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -167,8 +167,6 @@ function comanche_block($s, $class = '') { dbesc($name) ); - //print_r($r); killme(); - if($r) { $o .= (($var['wrap'] == 'none') ? '' : '
'); -- cgit v1.2.3 From 9b1e54088051cd2d913aba49dff76acc454e1579 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 18 May 2015 22:29:13 +0200 Subject: if block title contains $content but $content title is empty do not show an empty

tag --- include/comanche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/comanche.php b/include/comanche.php index cca7cb0f6..93cbd8b12 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -174,7 +174,7 @@ function comanche_block($s, $class = '') { $o .= '

' . $r[0]['title'] . '

'; } - if($r[0]['title'] && trim($r[0]['title']) === '$content') { + if($r[0]['title'] && trim($r[0]['title']) === '$content' && get_app()->data['webpage'][0]['title']) { $o .= '

' . get_app()->data['webpage'][0]['title'] . '

'; } -- cgit v1.2.3