Version: 4.0.7 Reporter: Rick Lecoat —
I have a fluid field containing a rich text field. Inside a channel:entries tag I have a conditional of the simple if/else variety, checking against the channel’s short name. The fluid field appears in both the IF and the ELSE block, but of course if should only output its content once (if the channel name matches). What happens, however, is that the fluid field outputs both times, even though other content in the ELSE block (correctly) does not. Here’s the code:
{exp:channel:entries channel="knowledge" disable="categories|category_fields|member_data|pagination|relationships"}
{if channel_short_name == "knowledge"}
<h1>{title}</h1>
{fluid_content}
{fluid_content:rich_text}
{content}
{/fluid_content:rich_text}
{/fluid_content}
{if:else}
<h2>This should NOT show up</h2>
{fluid_content}
{fluid_content:rich_text}
{content:limit characters="100"}
{/fluid_content:rich_text}
{/fluid_content}
{/if}
{/exp:channel:entries}
What gets output is the H1, the fluid content in full, then the fluid content truncated to 100 chars. The H2 does not get output, which is expected behaviour. If I include other fields in the Fluid field (I’ve tested with text input fields) they are also duplicated, so it is not just Rich Text that has this issue.
Replace system/ee/legacy/libraries/Fluid_field_parser.php with the file in the attached zip.
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); } ```