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

Feature request: Check if there is a visible Paragraphs item before displaying a Paragraphs field #100

Closed
Retsell opened this issue Oct 22, 2021 · 7 comments
Labels
enhancement New feature or request
Milestone

Comments

@Retsell
Copy link

Retsell commented Oct 22, 2021

If the paragraph title is set to be displayed for a paragraph, the title remains displayed after the paragraph is unpublished. The title should disappear too. (Using 1.x-1.2.0-alpha1)

@laryn
Copy link
Member

laryn commented Oct 22, 2021

@Retsell Can you add a screenshot or slightly more detail? This also may depend on how we handle unpublished Paragraphs items on the front end -- @klonos suggests keeping them visible for admins but with a background that makes it clear they are unpublished (which would allow re-publishing from the front end as well).

@Retsell
Copy link
Author

Retsell commented Oct 22, 2021

@klonos Here's what I tried: (I'm new to paragraphs, so maybe it's not supposed to be used like this?) I thought it would be great for making a paragraph available on my site that is dedicated to vintage motor yachts, that would contain for-sale information for those boats that are available. I would also like to turn the paragraph off once sold, but retain the information for later use if needed. Unpublishing a paragraph titled "For Sale Information" would do the trick nicely. Except that when I turn off the paragraph, it still displays the title on the page, i.e. it shows "For Sale Information" and then no for-sale information. If the paragraph is unpublished. why have the title of the paragraph still displayed?

@laryn
Copy link
Member

laryn commented Oct 22, 2021

Is "For Sale Information" the label/name of the entire Paragraphs field? (If so, is it accurate to say your request is to remove/unpublish the entire field if there are no published Paragraphs items within it?)

Showing unpublished Paragraphs items would be only for those with administrative access, not the general public.

@Retsell
Copy link
Author

Retsell commented Oct 22, 2021

In the image below, on the left the For Sale Info paragraph is published. On the right I have Unpublished it, so the text and photo no longer appear, but the title still does. The paragraph is gone, shouldn't the title be hidden as well?

paragraphs

@laryn
Copy link
Member

laryn commented Oct 26, 2021

@Retsell The issue is that the field label is for the entire field, and the unpublishing option is for the individual Paragraphs items within the field (of which there may be more than one on a multivalue field).

I'll leave this open to explore at some point if it's possible to have a check to make sure a Paragraphs field has at least one visible item before displaying the field at all. In the meantime you can hide the Paragraphs field label in the content type "Manage display" screen, and show the field title in the Paragraphs type as a workaround.

@laryn laryn changed the title Unpublish Paragraph title when rest of paragraph is UnPublished Feature request: Check if there is a visible Paragraphs item before displaying a Paragraphs field Oct 26, 2021
@laryn laryn added the enhancement New feature or request label Oct 26, 2021
@Retsell
Copy link
Author

Retsell commented Oct 26, 2021

@laryn Thanks for looking into it. I hadn’t thought about the multivalue field aspect. The work around is easy enough in my case.

@laryn laryn added this to the 1.x-1.2.0 milestone Jan 6, 2022
@laryn laryn closed this as completed in 595fe38 Aug 30, 2024
@laryn
Copy link
Member

laryn commented Aug 30, 2024

@Retsell This should be fixed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants