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

Placement is not applied for the label of the named part #17058

Open
barthamark opened this issue Nov 25, 2024 · 3 comments
Open

Placement is not applied for the label of the named part #17058

barthamark opened this issue Nov 25, 2024 · 3 comments

Comments

@barthamark
Copy link
Contributor

Describe the bug

I have a content type with a named BagPart. I want to put the BagPart editor to a separate tab. I can do it with the following placement:

"BagPart_Edit": [
      {
        "place": "Parts:3#My Tab",
        "differentiator": "Items"
      }
]

It successfully creates the tab and puts the "Add My Type" to the "My Tab", but it leaves the "Items Provides a collection behavior for your content item where you can place other content items." text on the "Content" tab.

I see that this text is generic and implemented in the ContentPart.Edit.cshtml but I have no idea on how to address this shape from the placement, nothing seem to target it.

Orchard Core version

2.0.2

To Reproduce

  1. Create two content types: Inner (doesn't matter what parts), Outer (add a named BagPart containing Inner content items, the name should be Items)
  2. Go to Design > Placements and create a Placement with shape type BagPart_Edit and the rule should be
[
      {
        "place": "Parts:3#My Tab",
        "differentiator": "Items"
      }
]
  1. Create a new Outer item
  2. See that the Content tab has the generic "Items ..." text and the "My Tab" has the actual editor.

Expected behavior

Somehow move the generic text to the "My Tab" tab.

Logs and screenshots

image
image

@ns8482e
Copy link
Contributor

ns8482e commented Nov 27, 2024

I recall this! For namedpart don't use BagPart_Edit in placement, it will only move the Part and not the label. To move both label and the Part use ContentPart_Edit in placement with differentiator.

Try something like

{
  "ContentPart_Edit": [
    {
      "place": "Parts#HTML Attributes",
      "differentiator": "Container-BackgroundColor",
      "contentType": ["Container"],
      "contentPart": ["BootstrapColor"]
    }
  ]
}

@sebastienros
Copy link
Member

Convert this to a documentation issue?

Copy link
Contributor

It seems that this issue didn't really move for quite a while despite us asking the author for further feedback. Is this something you'd like to revisit any time soon or should we close? Please reply.

@github-actions github-actions bot added the stale label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants