Keyword modifer string

Hey guys


I am trying to use keyword modifiers to make a more link only appear if a group has 4 or more children. I have put the following together that is almost there.



%group_immed_child_group_count^gte:4^replace:1:<li><a href={parent_href} title={group_name}>More…</a></li>%



If the immediate children count is greater than 4 it then outputs the link code. If it is three or less it doesn't.



However it doesn't resolve the parent_href and group_name keywords. Using % causes the keyword to end prematuraly.



Does anyone have any ideas or am I trying to do something impossible?



Thanks

Matthew

[quote]
Hey guys



I am trying to use keyword modifiers to make a more link only appear if a group has 4 or more children. I have put the following together that is almost there.



%group_immed_child_group_count^gte:4^replace:1:<li><a href={parent_href} title={group_name}>More…</a></li>%



If the immediate children count is greater than 4 it then outputs the link code. If it is three or less it doesn't.



However it doesn't resolve the parent_href and group_name keywords. Using % causes the keyword to end prematuraly.



Does anyone have any ideas or am I trying to do something impossible?



Thanks

Matthew

[/quote]



You can't put a keyword inside a keyword like that. What you can do is something like %group_immed_child_group_count^lte:3:<!–:%<li><a href="%parent_href%" title="%group_name%">More…</a></li>%group_immed_child_group_count^lte:3:–>:%



Which will place a comment block around the link if you have 3 or less. Bit of a kludge though.

I figured as much. Thanks for that.

Wouldn't the Keyword Replacement modifier work in this situation? http://manuals.matrix.squizsuite.net/keyword-replacements/chapters/keyword-modifiers#Using-Keyword-Replacements-as-Argument-Values

[quote]
Wouldn't the Keyword Replacement modifier work in this situation? http://manuals.matrix.squizsuite.net/keyword-replacements/chapters/keyword-modifiers#Using-Keyword-Replacements-as-Argument-Values

[/quote]



Yup I think this keyword modifier should address this situation. However this functionality is available from 4.10.0 RC1 version onwards only though:



http://bugs.matrix.squiz.net/view_bug.php?bug_id=5646



Chiran

[quote]
Yup I think this keyword modifier should address this situation. However this functionality is available from 4.10.0 RC1 version onwards only though:



http://bugs.matrix.squiz.net/view_bug.php?bug_id=5646



Chiran

[/quote]



mm, that's a much tidier solution.



That is one gripe I have with the new manuals pages though - they're only correct for the current version of matrix, and unless you dig through the changelogs you can't tell when a feature was introduced/if it's in your version. As much as I hate to speak in favour of pdfs, at least the old pdf manuals were versioned, which made it a lot easier to tell what you can & can't do. Unless I'm missing something (If I am, please tell! Would make my life easier).

We are currently running 4.4.2 so that would explain why replace_keywords didn't work. I guess I will have to use keywords to output comment tags then.