Skip to content
Permalink
Browse files

NAV_LIST_UL replacer must be wrapped by `[% %]` instead of `{ }`

  • Loading branch information...
slackero committed May 29, 2014
1 parent 03b4c1b commit e8b39f83ce103a63b54b9b660a6574cc1dbfbebe
Showing with 3 additions and 3 deletions.
  1. +2 −2 include/inc_front/front.func.inc.php
  2. +1 −1 include/inc_lib/revision/revision.php
@@ -2765,7 +2765,7 @@ class_active_li|class_active_a,
'crop' => 0,
'textlength' => 0,
'position' => 'outside',
'template' => '<span class="amenu-extended">[IMAGE]<img src="{IMAGE}" alt="{IMAGE_NAME}" />[/IMAGE][TEXT]<span class="p">{TEXT}</span>[/TEXT]</span>'
'template' => '<span class="amenu-extended">[IMAGE]<img src="[%IMAGE%]" alt="[%IMAGE_NAME%]" />[/IMAGE][TEXT]<span class="p">[%TEXT%]</span>[/TEXT]</span>'
);
if($path_class) {
$path_class = explode('|', $path_class);
@@ -2823,7 +2823,7 @@ class_active_li|class_active_a,
$amenu_options['position'] = 'inside';
}
if($amenu_options['enable'] && !empty($parameter[8][4])) { // template
$amenu_options['template'] = $parameter[8][4];
$amenu_options['template'] = str_replace(array('[%', '%]'), array('{', '}'), $parameter[8][4]);
}
}
@@ -9,7 +9,7 @@
*
**/
define('PHPWCMS_VERSION', '1.7.3');
define('PHPWCMS_RELEASE_DATE', '2014/05/28');
define('PHPWCMS_RELEASE_DATE', '2014/05/29');
define('PHPWCMS_REVISION', '537');
?>

7 comments on commit e8b39f8

@marcus-at-localhost

This comment has been minimized.

Copy link
Contributor

replied May 29, 2014

just curious,what is the reason for this change?

@q23

This comment has been minimized.

Copy link
Contributor

replied May 29, 2014

the regular expression is going wild with {.

@slackero

This comment has been minimized.

Copy link
Owner Author

replied May 29, 2014

The default template has no problem but custom template defined as option in {NAV_LIST_UL:…|<tag>{…}</tag>}. The part after the first closing } (here }</tag>) gets lost and rendering fails. So it is necessary to write [IMAGE][%IMAGE%][%IMAGE_NAME%][/IMAGE][/IMAGE][TEXT][%TEXT%][/TEXT].

@robinsherwood

This comment has been minimized.

Copy link

replied May 30, 2014

Would be cool to have a complete example for the forum and or the wiki, wouldn't it? Otherwise there is no chance for the extensions to get used widely :(

@slackero

This comment has been minimized.

Copy link
Owner Author

replied May 30, 2014

Here is a basic example. Unstyled:

{NAV_LIST_UL:BA,0,,,active,,,,0|100x100x1|teaser:10|outside|<div class="dropdown-menu">[IMAGE]<img src="[%IMAGE%]" alt="[%IMAGE_NAME%]" class="dropdown-image" />[/IMAGE][TEXT]<div class="dropdown-text">[%TEXT%]</div>[/TEXT]</div>}

or if you prefer background images and text from article description without word limitation:

{NAV_LIST_UL:BA,0,,,active,,,,0|100x100x1|description|outside|<div class="dropdown-menu"[IMAGE] style="background-image:url([%IMAGE%]);"[/IMAGE]>[TEXT]<p>[%TEXT%]</p>[/TEXT]</div>}
@robinsherwood

This comment has been minimized.

Copy link

replied May 30, 2014

Thank you!
Just curious what the rendering would be looking like ;)

@slackero

This comment has been minimized.

Copy link
Owner Author

replied May 30, 2014

Where is the problem? Try it!

Please sign in to comment.
You can’t perform that action at this time.