MarkupExpressionsExtensions-Talk

Summary: Talk page for MarkupExpressionsExtensions.
Maintainer: (unsupported since 2008)
Users: (View? / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.

Comments

Questions by HansB:
Responses by Caveman:

The count markup gives different results than Pm's pagelist fmt=count (PagelistCount). It may be because this recipe uses a hardcoded exclusion list, and so will not reflect custom exclusion lists as PmWiki allows. In any case Pagelistcount is more flexible and more accurate, so i am not sure why {(count)} is needed.

  • It may be more flexible, but this markup is much easier. Can be done on the fly for simple uses. Also within pagelist templates. Plus, it is not hardcoded. It's built on a SDV variable which can be reset as desired.

I am not sure what "Thread" means. Last page in a group of pages with numeric page names?

  • Yes, except it automatically adds +1, to give you the next thread.

Why is the {(pagelist group=Group)} markup needed, if all it does is to translate the normal syntax?

  • It can be stored in a hidden text variable and retrieved.

For some of these markups I wonder why the normal pmwiki pagevariable syntax {$VarName} is not used, as they are providing page variables.

  • Mostly so you don't have to mess with config files. Or to give more options.
  • On second thought you are right. Several have now been switched to page variables.

Here's another useful one:

 ##(str_replace) markup expression
 SDV($MarkupExpr['str_replace'], 'str_replace(explode(",",$args[0]), explode(",",$args[1]), $args[2])');

So given the page text variable

 (:text: You can't chew pizza all day.:)

The markup expression

 {(str_replace "pizza" "ooba" "{$:text}")}

returns the string

 You can't chew ooba all day.

And the more complex expression

 {(str_replace "chew","pizza","day" "eat","ooba","night" "{$:text}")}

performs multiple replacements and produces

 You can't eat ooba all night.

You can also replace an array with a string, allowing you to strip various unwanted characters (or words) from a variable:

 (:myname: Mary O'Meara-Malloy:)
 {(str_replace " ","'","-" "" {$:myname})}

produces

 MaryOMearaMalloy

Ben Stallings May 28, 2007, at 10:47 AM

I like the functionality this recipe offers. Unfortunately for me it caused action=attr to show incorrect settings (the worst case: one page's read authorizations appeared for other pages to which they did not apply). When I removed the recipe, the authorizations appeared correctly again.

- RandyB January 27, 2008 at 7:22 PM

as function ereg is deprecated in php 5.3.0 .
modify line 100
if (! ereg("^[0-9]+$", $n)) continue; to if (! preg_match("/^[0-9]+$/", $n)) continue;
might work.

- KPX? April 26, 2011, at 09:53 PM

Talk page for the MarkupExpressionsExtensions recipe (users?).