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

Add twig function to get assigned element tags #16882

Open
wants to merge 2 commits into
base: 11.x
Choose a base branch
from

Conversation

skoch98
Copy link
Contributor

@skoch98 skoch98 commented Apr 1, 2024

I've implemented a blog on my website and desiceded to tag a blog post via pimcore tags.

When I tried to output the tags in my tempalte I was faced with a small problem. I didn't know any way to access them on twig side. Neither the documentation as well as the core code provided me with any existing solution.

In the Pimcore demo the "Event" object using a multiselect as tag-solution - but that's not an option for me...

I was wondering why there is no getTags method in Pimcore\Model\Element\AbstractElement. Is there a reason for this? The data can easily be loaded asynchronously, only when the getter is called, so there is no disadvantage. WDYT?

Because this is unclear to me, and I already implemented a solution that works without core editing - I decided to write a new Twig function and I want to share it here for discussion.

Personally, I prefer it if there would be a getTags method.

Copy link

github-actions bot commented Apr 1, 2024

Review Checklist

  • Target branch (11.2 for bug fixes, others 11.x)
  • Tests (if it's testable code, there should be a test for it - get help)
  • Docs (every functionality needs to be documented, see here)
  • Migration incl. install.sql (e.g. if the database schema changes, ...)
  • Upgrade notes (deprecations, important information, migration hints, ...)
  • Label
  • Milestone

Copy link

sonarcloud bot commented Apr 1, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

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.

None yet

2 participants