Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOOSE-52] Filter Post Terms Block by Classes #66

Closed
wants to merge 5 commits into from

Conversation

GeoffDusome
Copy link
Contributor

@GeoffDusome GeoffDusome commented Jul 20, 2023

What does this do/fix?

NOTE: I am fully aware this code sucks. I wanted to take a stab at using the block content filter we have built into Moose (we used on M12, but haven't since then) in order to create a system for this block where we can create different version of the block via classes set on the block. I would probably want BE to take a pass at the function to see if they can clean it up.

  • filter-remove-links removes the links and replaces them with span tags
  • filter-remove-separators removes the separator elements from the block
  • filter-display-one-term limits the output to one term
  • any combination of the above 3 filter options can be set on block
  • this solves all custom blocks we wanted to create for this issue, without needing the custom blocks. Obviously, the custom blocks would be much cleaner than this, but it does the job without needing them. It does however, force users to know that those classes exist.
  • The filter doesn't work in the editor. The filter only works on the FE view of the block (this might be the biggest negative).
  • The filter doesn't work with the prefix / suffix options available, I believe they just get removed.

QA

Links to relevant issues

Screenshots/video:

* previews from disappearing in the editor. Although, they don't appear to
* currently be breaking, maybe something to keep an eye on.
* @see https://github.com/wpcomvip/careforth/pull/14
*/
iframe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this isn't part of your edits, but are we missing a comma after iframe? All the other CSS properties are listed single line with a comma after, and this one isn't...

Base automatically changed from s3/MOOSE-46/post-type-name-custom-block to main July 27, 2023 20:16
@GeoffDusome GeoffDusome mentioned this pull request Aug 6, 2023
@GeoffDusome
Copy link
Contributor Author

Closing in favor of PR #81. Much more the direction I wanted to go with this, I just wanted to see if something like this could be done.

@GeoffDusome GeoffDusome closed this Aug 8, 2023
@GeoffDusome GeoffDusome deleted the s3/MOOSE-52/tag-category-custom-blocks branch August 8, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants