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

LMP on category archive page uses different partial than category.php #868

Closed
1 task
benlk opened this issue Aug 25, 2015 · 5 comments
Closed
1 task

LMP on category archive page uses different partial than category.php #868

benlk opened this issue Aug 25, 2015 · 5 comments

Comments

@benlk
Copy link
Collaborator

benlk commented Aug 25, 2015

In category.php:

        while ( have_posts() ) {
            the_post();
            //$shown_ids[] = get_the_ID();
            get_template_part( 'partials/content', 'archive' );
        }

In inc/ajax-functions.php, in largo_load_more_posts:

        while ( $query->have_posts() ) : $query->the_post();
            $partial = 'home';
            if($_POST['is_series_landing'] === true || $_POST['is_series_landing'] === 1) {
                $partial = 'series';
                $opt = $_POST['opt'];
            }
            $partial = ( get_post_type() == 'argolinks' ) ? 'argolinks' : $partial;
            get_template_part( 'partials/content', $partial );
        endwhile;

The category archive page uses partials/content-archive.php and LMP uses partials/content-home.php on category pages. This is okay in Largo because neither partial exists in Largo, and so it falls back to partials/content.php in both cases.

But if a child theme defines either of those, then there will be markup mismatch between the posts included in the initial page load and in the posts loaded with the LMP button.

  • change LMP to check for category, use 'category' as $partial.
@benlk benlk added this to the 0.5.8 - Archive Pages milestone Aug 25, 2015
@benlk
Copy link
Collaborator Author

benlk commented Aug 25, 2015

Rough code, to be inserted before the is_series_landing check:

 $query = (array) json_decode(stripslashes($_POST['query']));
 if ( isset($query['guest_column']) && $query['guest_column'] != '' ) {
      $partial = 'category';
 }

(Because of Catalyst Chicago and HELPDESK-337)

@benlk
Copy link
Collaborator Author

benlk commented Aug 25, 2015

Any fix here should also check tag, search, date, author, and non-landing-page series archives.

@benlk
Copy link
Collaborator Author

benlk commented Oct 15, 2015

Note to travelers from the Future: This is only current to December 15, 2015. Your child themes may have changed.


Here's a list of partials slugs used in Largo and in child themes, based on the files present in the themes.

One column is reserved for if the partial needs to be considered in this issue.

partial largo child this ticket comment
'' x 8 chicago-reporter cpipr ctmverticals gijn-impact jjie lensnola oklahomawatch youth-today
not-found x
page x 2 jjie lensnola
single x 4 cpipr ctmirror gijn-impact lensnola
single-classic x 3 catalystchicago ctmverticals midwestenergynews
tiny x 1 ctmirror, largo only uses for Largo Series Posts widget
archive 2 x catalystchicago chicago-reporter
argolinks 1 x lensnola
category 1 x lensnola
category-no-title x lensnola
fathom-list x nmindepth
fathom-load-more x nmindepth
fathom-main x nmindepth
fathom-rail x nmindepth
home x 4 catalystchicago chicago-reporter jjie youth-today
home-2 x current
home-left x lensnola
home-right x lensnola
member x gijn
no-title x lensnola
product x lensnola
school x lensnola
search 3 x catalystchicago lensnola aspen
search-other x lensnola
series x x x chicago-reporter nmindepth
squandered-heritage x lensnola
video x gijn-impact
whoyakidding x maine
widget x catalystchicago

@aschweigert
Copy link

minor note: the argolinks partial should no longer be needed

@benlk
Copy link
Collaborator Author

benlk commented Dec 15, 2015

Continued in #1021 for #1020.

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

2 participants