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

Using a shortcode block inside a Group block - Using alignment to make the shortcode block wider. #33886

Open
3 tasks done
paaljoachim opened this issue Aug 4, 2021 · 2 comments
Labels
[Feature] Shortcodes Related to shortcode functionality [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Bug An existing feature does not function as intended

Comments

@paaljoachim
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Have you tried deactivating all plugins except Gutenberg?

  • I have tested with all plugins deactivated.

Have you tried replicating the bug using a default theme e.g. Twenty Twenty?

  • I have tested with a default theme.

Description

Using this plugin: https://wordpress.org/plugins/my-calendar/ and Twenty Twenty One.
Going to the My Calendar page made by the plugin..

The default backend looks like this:

Screen Shot 2021-08-04 at 19 08 48

The frontend with Chrome Elements open.

Screen Shot 2021-08-04 at 19 12 23

The calendar shows width 100% inside the default Shortcode container a little further down and not seen in the above screenshot.

.mc-main.calendar, .mc-main table {
    width: 100% !important;
}

Adding the shortcode block into a Group.

Changing the Group block alignment to
Wide width.

Backend.
Screen Shot 2021-08-04 at 19 19 22

Frontend:
Screen Shot 2021-08-04 at 19 23 46

Changing the Group block alignment to
Full width.

Backend.
Screen Shot 2021-08-04 at 19 19 38

Frontend.
Screen Shot 2021-08-04 at 19 25 07

In theory the shortcode block should always show 100% width in the container it is in. It does not do so in this case.

Step-by-step reproduction instructions

  1. Download https://wordpress.org/plugins/my-calendar/ and install and activate. A My Calendar page should be created. If not then add this code into a shortcode block. [my_calendar id="my-calendar"]
  2. Test out the default width.
  3. Test out adding the shortcode block into a Group block.
  4. Test with Wide width and Full width alignments, and notice what happens in the backend and frontend.
  5. The shortcode is not following the block widths.

I do not know if this is because of missing code in the plugin or if this is an error in Twenty Twenty One. I also tested TT1 and the results where a little different. There I was able to get a wide width showing calendar in the frontend.

Associated issue:
Adding the My Calendar shortcode to a Group block
joedolson/my-calendar#167

Expected Behavior

As the plugin has code to go 100% of the container it is in. I expected it to follow the width of the alignment in the Group block.

Current Behavior

Shortcode does not follow the alignment width of the Group block.

Screenshots or screen recording (optional)

Included above.

Code snippet (optional)

No response

WordPress Information

WordPress 5.8

Gutenberg Information

Gutenberg 11.2.0

I am also using the Theme Twenty Twenty One, and https://wordpress.org/plugins/my-calendar/

What browsers are you seeing the problem on?

Chrome

Device Information

Desktop

Operating System Information

OSX 11.5.1

@paaljoachim paaljoachim added [Feature] Shortcodes Related to shortcode functionality [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended labels Aug 5, 2021
@paaljoachim
Copy link
Contributor Author

paaljoachim commented Aug 16, 2021

@getdave and @youknowriad

Adding a shortcode block into Twenty Twenty One and TT1 shows different alignment results when placed inside a Group block.

Gutenberg plugin 11.2.1
Chrome

Example using Twenty Twenty One theme.
Shortcode block inside a Group block. Wide width alignment.
Backend

Shortcode-block-inside-Group-using-TwentyTwentyOne

Frontend

Screen Shot 2021-08-16 at 15 11 43

Example using TT1 theme.
Shortcode block inside a Group block. Wide width alignment.
Backend

Screen Shot 2021-08-16 at 15 17 02

Full width alignment.
Screen Shot 2021-08-16 at 15 19 05

Frontend
Shortcode block inside a Group block.
Wide width alignment.

Screen Shot 2021-08-16 at 15 22 04

Full width alignment.

Screen Shot 2021-08-16 at 15 21 43

I assume the difference in alignment between TT1 and Twenty Twenty One has to do with the Layout controls seen in the Side Editor.

An extra thought....
I believe that we now need to figure out a good method (I assume there is one) to have percentage/px control over the width of the wide block, so that we can define how wide Wide width should be for all blocks.

@Thelmachido
Copy link

It looks like the shortcode inside the group block becomes the same width as the one outside the group block if you make the group block full width.

Screen.Recording.2022-08-24.at.15.17.02.mov

WordPress 6.0.1

Gutenberg 13.9.0

@Thelmachido Thelmachido added the [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Shortcodes Related to shortcode functionality [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants