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

Allow an empty content field in a CMS Block and Page #3691

Closed
wants to merge 3 commits into from

Conversation

loekvangool
Copy link
Contributor

Currently, there needs to be some content in a CMS block. I propose that this restriction is removed. A HTML block can be a placeholder for future content.

Currently, there needs to be some content in a CMS block. I propose that this restriction is removed. A HTML block can be a placeholder for future content.
@loekvangool loekvangool changed the title Allow an empty content field in a CMS block form Allow an empty content field in a CMS Block and Page Dec 5, 2023
Copy link
Contributor

@luigifab luigifab left a comment

Choose a reason for hiding this comment

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

When using an empty static bloc in a cms page with:
{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="2"}}
we have:
... <div class="widget widget-static-block"></div> ...
but ok.

@loekvangool
Copy link
Contributor Author

I would totally zap that empty block, which I actually do in my templates, but I'm worried about breaking some custom code if we just decide to not output anything.

@sreichel
Copy link
Contributor

Why not add a html comment?

@loekvangool
Copy link
Contributor Author

Add a HTML comment to workaround the rule that the block cannot be empty?

What does the rule add?

@sreichel
Copy link
Contributor

What's the benefit of empty content?

Should title be optional too? Do we need URL for pages?

Why to change this for all? You can rewrite that class to fit your custom workflow?

@pquerner
Copy link
Contributor

I vote to decline as well. I do not see any benefit.

@loekvangool
Copy link
Contributor Author

I'm emptying HTML blocks for promotions until the next promotion.

But whatever.

@pquerner
Copy link
Contributor

so create a block for it which changes the output if a promotion is currently available. I wouldnt touch the whole cms system for that and make a crucial field optional. for one, and only your usecase. many roads lead to rome.

@loekvangool
Copy link
Contributor Author

What exactly justifies the term "touch the whole CMS system"? It works just fine without any content.

@Flyingmana
Copy link
Contributor

The strength of OpenMage is the ability to do a lot without needing a developer.

Having fields required is usually a protective and usability focused measurement, when not filling something would lead to errors or extra effort (by repeating filling everything)

In a CMS block, which is very easy to edit again, and which has no visible potential for errors regarding the content field, the need to make or keep it required seems not to be given for me.

One could also work with non-space characters, or special html classes to imitate the empty content. But thats not sounding much like a best practice approach and prone to errors.

@pquerner
Copy link
Contributor

Whats next? Text fields only make sense for 500 characters, so the field should truncate.
Theres only so many things that should be changed.

Like I said, by building a observer or custom block or whatever else comes to mind, its better documented of WHY this is wanted behaviour without removing the wheels from cars and saying, I could want to live in that car and not want to move, so it works fine without the wheels.

@sreichel
Copy link
Contributor

I'm emptying HTML blocks for promotions until the next promotion.

Disable block until next promotion?

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.

5 participants