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

Fix Poetry's missing single post template #142

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

sandroschutt
Copy link
Contributor

I've created the template and patter files for single posts.

Copy link
Collaborator

@iamsam2e iamsam2e left a comment

Choose a reason for hiding this comment

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

Header and footer templates don't initialize on first render of the page, but removing & reincerting the component shows they works - looks to be due to working out of a subdirectory; cloning into /themes does make those components render on first page load in FSE editor

@MaggieCabrera
Copy link
Collaborator

Header and footer templates don't initialize on first render of the page, but removing & reincerting the component shows they works - looks to be due to working out of a subdirectory; cloning into /themes does make those components render on first page load in FSE editor

Themes in a subdirectory is a valid usecase, so we need to account for that. Good catch!

@MaggieCabrera
Copy link
Collaborator

@samtoohey93 are you sure that you have the latest version installed? looking at the code, the template parts should be loading correctly

@iamsam2e
Copy link
Collaborator

iamsam2e commented Mar 7, 2024

Issue was template component was not rendering on first page load initially.

image

Upon investigation @sandroschutt it looks like removing the theme slug resolves the issue and allows the component to render correctly.

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

Hope this helps!

@thetwopct
Copy link
Collaborator

Related issue - #128

@sandroschutt
Copy link
Contributor Author

Header and footer templates don't initialize on first render of the page, but removing & reincerting the component shows they works - looks to be due to working out of a subdirectory; cloning into /themes does make those components render on first page load in FSE editor

Not sure if we're in the same issue here. I tested it in my dev stage and just created a dedicated test stage for replicating the problem you mentioned, but it didn't show.

@MaggieCabrera MaggieCabrera linked an issue Apr 5, 2024 that may be closed by this pull request
@iamsam2e iamsam2e self-assigned this May 16, 2024
@MaggieCabrera MaggieCabrera force-pushed the fix/poetry/single-post-template branch from b96260e to dc0d7a9 Compare May 21, 2024 14:02
@iamsam2e iamsam2e added question Further information is requested Theme: Poetry labels Jun 9, 2024
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:group {"style":{"spacing":{"padding":{"top":"96px","right":"0","bottom":"96px","left":"0"},"blockGap":"40px"}},"layout":{"type":"flex","flexWrap":"nowrap","orientation":"horizontal","verticalAlignment":"top","justifyContent":"center"}} -->
<div class="wp-block-group" style="padding-top:96px;padding-right:0;padding-bottom:96px;padding-left:0"><!-- wp:group {"style":{"spacing":{"padding":{"top":"96px"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group" style="padding-top:96px"><!-- wp:post-date /--></div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's use presets instead of hardcoded values for spacing


<!-- wp:group {"style":{"spacing":{"padding":{"right":"56px","left":"56px"},"blockGap":"32px"},"border":{"left":{"width":"2px"}}},"layout":{"type":"flex","orientation":"vertical","flexWrap":"nowrap"}} -->
<div class="wp-block-group" style="border-left-width:2px;padding-right:56px;padding-left:56px"><!-- wp:image {"id":15,"width":"56px","height":"56px","sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full is-resized"><img src="<?php echo esc_url( get_stylesheet_directory_uri() ); ?>/assets/images/feather-small.png" alt="" class="wp-image-15" style="width:56px;height:56px"/></figure>
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's use get_template_directory_uri instead

<!-- wp:post-author {"showAvatar":false,"showBio":false,"textColor":"custom-contrast"} /--></div>
<!-- /wp:group -->

<!-- wp:post-content /--></div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add the comments block or is it ok not to have it for this theme?

@MaggieCabrera
Copy link
Collaborator

We have similar work done in #146 how can we conflate the two?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Theme: Poetry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poetry: Single posts template
4 participants