Version: 4.2.1 Reporter: Rick Lecoat —
I am seeing different behaviour regarding the output of fluid field variables when used inside a sub-field, depending upon whether that sub-field has a single ‘content’ tag or whether it uses a tag pair. Eg, in the following:
{my_fluid_field}
{my_fluid_field:sub_field}
{my_fluid_field:current_field_name}
{content}
{/my_fluid_field:sub_field}
{/my_fluid_field}
The current_field_name variable correctly outputs the name of the subfield that it is in. But in this:
{my_fluid_field}
{my_fluid_field:sub_field}
{my_fluid_field:current_field_name}
{content}{/content}
{/my_fluid_field:sub_field}
{/my_fluid_field}
It does not.
Is this a bug? I guess I might be using the variable tags in the wrong way — to be honest the docs are bit thin in this area and knowing quite how to structure the syntax is not entirely obvious — but the above issue does seem like it might be a bug. (If it’s not, though, could somebody maybe bulk-up the documentation to make it a little clearer how those variables should be used? I received various pieces of helpful of advice on that from the Slack channel, but it often contradicted other people’s advice or the docs themselves, and nobody seemed to be 100% certain).
On line 140 of system/ee/EllisLab/Addons/fluid_field/Service/Tag.php
change:
$tagdata = $this->parsePairs($field);
to:
$tagdata = $this->parsePairs($field, $tagdata);
On line 152 update the parsePairs
method signature and remove the first line of code:
protected function parsePairs(FieldFacade $field)
{
$tagdata = $this->getTagdata();
like so:
protected function parsePairs(FieldFacade $field, $tagdata)
{
ExpressionEngine implements Markdown Extra and BBCode. Please see the Markdown Extra docs and the BBCode Wikipedia article for a full reference.
**bold**
, __bold__
, *italics*
, _italics_
, ~strike/del~
, `code()`
bold, italics, strike/del, code()
Link: [link title](https://example.com)
Image: ![alt text](https://example.com/image.jpg)
[blockquote]...[/blockquote]
, [quote]...[/quote]
, and Markdown style:
> Some quoted text. > > This is all one quote.
[code]...[/code]
, and you can also specify the language for syntax highlighting, [code=php]...[/code]
GitHub flavored Markdown code fences are also supported:
``` public function decoderRing($str) { return str_rot13($str); } ```