E107: Wrapper is also applied to parametized shortcodes

Created on 9 Jan 2017  路  5Comments  路  Source: e107inc/e107

I've got this shortcodes:
{TEST}{TEST:type=text}{TEST:type=number}{TEST:format=long}
If in template, i define this wrappers:

$TEMPLATE_WRAPPER['TEST']="Wrapping ORIGINAL {---}";
$TEMPLATE_WRAPPER['TEST:type=text']="Wrapping TEXT {---}";
$TEMPLATE_WRAPPER['TEST:type=number']="Wrapping NUMBER {---}";
$TEMPLATE_WRAPPER['TEST:format=long']="Wrapping LONG {---}";

I always end up with $TEMPLATE_WRAPPER['TEST']="Wrapping ORIGINAL {---}" wrapping all four shortcodes...
If i remove $TEMPLATE_WRAPPER['TEST']="Wrapping ORIGINAL {---}" from template, i do get the final three shortcodes wrapped with the indicated ones, but got no wrapping possible on the first one...
What am i doing wrong here?

question

Most helpful comment

Add a fake query to the first one: TEST:bla=bla and the problem is solved - you can style each one.
This is not a bug but a feature, See line 83 of the default news_template.php for usage example.

All 5 comments

_Not into this i admit_, but looking through files should it not be $TEST_WRAPPER['TEST'] = sc style........ ?
or like around line 907 of handlers/shortcode handler php

Add a fake query to the first one: TEST:bla=bla and the problem is solved - you can style each one.
This is not a bug but a feature, See line 83 of the default news_template.php for usage example.

@CaMer0n Humm, thanks, i'll give it a try and test...

@CaMer0n Just tested, the TEST:bla=bla doesn't work, it is not even applied to any shortcode starting with TEST.....

It only works if i define wrappers this way:

$SC_WRAPPER['TEST']="Wrapping ORIGINAL {---}";
$TEMPLATE_WRAPPER['TEST:type=text']="Wrapping TEXT {---}";
$TEMPLATE_WRAPPER['TEST:type=number']="Wrapping NUMBER {---}";
$TEMPLATE_WRAPPER['TEST:format=long']="Wrapping LONG {---}";

Weird....

@CaMer0n Your tip works. Sorry, it was my fault. Thanks...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alex-e107nl picture Alex-e107nl  路  5Comments

Jimmi08 picture Jimmi08  路  5Comments

Jimmi08 picture Jimmi08  路  5Comments

simplythomasjay picture simplythomasjay  路  5Comments

Norwayman picture Norwayman  路  3Comments