Skip to content

sebastienros/fluid#578 Implement tag names - #579

Open
knightmeister wants to merge 2 commits into
sebastienros:mainfrom
knightmeister:KeepTagNameWithStatement
Open

sebastienros/fluid#578 Implement tag names#579
knightmeister wants to merge 2 commits into
sebastienros:mainfrom
knightmeister:KeepTagNameWithStatement

Conversation

@knightmeister

@knightmeister knightmeister commented Jun 14, 2023

Copy link
Copy Markdown

I've implemented support to retrieve tag names from the statement list as discussed in #578.

ExtensibilityTests have been amended; let me know if I've missed anything obvious.

In terms of design, I opted to add another interface IHasTagName for a few reasons:

  1. It means that the various statement types (EmptyBlockStatement, EmptyTagStatement, ParserBlockStatement, ParserTagStatement) now have a shared interface type
  2. The above types were all internal and this hasn't changed visibility
  3. The root class Statement is used throughout the codebase and wasn't an appropriate change point.

The change means that I can do what I needed to do quite simply, basically

template.Statements.Where(x => x.GetType() == typeof(IHasTagName)).First(y => y.TagName == "what i'm looking for")

I've also added an interface IHasValue for retrieving the interface value from a statement. This Value will hold an individual value passed in, or in the case of using ArgumentsList you'll get an List of FilterArgument.

If you need any amendments let me know.

@knightmeister

Copy link
Copy Markdown
Author

@sebastienros any feedback on this PR or plans to incorporate it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant