• Resolved gaudiweb

    (@gaudiweb)


    Hi there,

    I am using pods with the Auto Template function to replace the theme’s default as I need to add pods fields before and after the post content. It works like a charm, except that the themes pagination isn’t working when the post content has a page break included. How can I make the auto template show the “current page” of the post only?

    Thanks,
    JJ

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter gaudiweb

    (@gaudiweb)

    just reboosting this as I’m afraid it might have gotten lost in the Holidays…

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @gaudiweb
    I think this might be a theme feature that isn’t working again since you replaced the content.
    Could you show us an example of a page where it works and where it isn’t working?
    Cheers, Jory

    Thread Starter gaudiweb

    (@gaudiweb)

    Hi @keraweb
    the site isn’t public, yet, but I can add the code I am using for the auto-template:

    <div class="mytip excerpt">
    	{@post_excerpt}
    </div>
    [if website_specific_intro]
    <div class="mytipp intro">
    	{@website_specific_intro}
    </div>
    [/if]
    [if ingredients]
    <div class="mytipp-incredients">
    	<h3>INcredients for {@post_title}</h3>
    	{@incredients}
    </div>
    [/if]
    <div class="mytipp-content">
    	<h3>How to do {@post_title}</h3>
    	{@post_content}
    </div>
    [if website_specific_extro]
    <div class="mytipp-extro">
    	{@website_specific_extro}
    </div>
    [/if]
    

    I am using the mh-magazin theme that also takes care of the pagination.

    So, without the custom auto-template above, the pagination works just fine, but with the auto-template, post_content is all put out at once.

    Thanks,
    JJ

    Thread Starter gaudiweb

    (@gaudiweb)

    So, I’ve been experimenting a bit more, but with no avail…

    The issue seems to be indeed that I am replacing the theme’s content with the pods generated auto template. What I am not getting is, why the content tag isn’t observing the pagination?! I am at a loss at this point and any idea how to do this would be much appreciated. The only other option I see is to create a new content template file, but since I am using a number of different pods, that would be a bit cumbersome – plus I reall like an appreciate the PODS auto template feature, except for this one issue…

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hello @gaudiweb

    Auto-templates should not influence the pagination of your theme. Just tested locally and can confirm this works fine.
    Could you share your auto-template options for that pod?

    Cheers, Jory

    Thread Starter gaudiweb

    (@gaudiweb)

    @keraweb

    Ho Jory,

    that’s what I thought, too, so I am guessing I am doing something wrong…

    The pod is an extension of regular posts and the auto-template options are set as following:

    Enable Automatic Pods Templates for this Pod? CHECKED
    Execute Auto Template outside of the WordPress loop? (advanced) NOT CHECKED
    Single item view template NAME OF TEMPLATE (SEE BELOW)
    Single Template Location REPLACE
    Single Template Filter THE_CONTENT
    Archive view template NO ARCHIVE VIEW TEMPLATE
    Archive Template Location AFTER
    Archive Template Filter THE_CONTENT

    Below is the auto-template code that is used

    <div class="mytip excerpt">
    	{@post_excerpt}
    </div>
    [if website_specific_intro]
    <div class="mytip intro">
    	{@website_specific_intro}
    </div>
    [/if]
    [if ingredients]
    <div class="mytip-incredients">
    	<h3>Ingredients for {@post_title}</h3>
    	{@incredients}
    </div>
    [/if]
    <div class="mytip-content">
    	<h3>How to do {@post_title}</h3>
    	{@post_content}
    </div>
    [if website_specific_extro]
    <div class="mytip-extro">
    	{@website_specific_extro}
    </div>
    [/if]

    hope that helps?!

    Thanks again for your time and support!

    Best, Jan

    Plugin Author Jory Hogeveen

    (@keraweb)

    I see you’ve only added a template for the single pages. These are not archive related.
    To enable your template for archives please select the template in the Archive view template option.

    Still, this should not influence pagination in any way so I’m inclined to think this is an issue with the theme.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Re-read the whole topic and I think I’ve misread before.

    Page breaks add’s a pagination within the post content (didn’t know that actually haha).

    Indeed, this is probably not supported within Pods Templates since it fully overwrites any content handling.
    If you need functionality like this you should probably modify your theme templates and add any Pods fiels there (using get_post_meta() for example).

    Cheers, Jory

    Thread Starter gaudiweb

    (@gaudiweb)

    ah, ok… well, I was hoping I could avoid doing that as I have a number of different pods and I guess that now means I will have to create a template for each one of them…. πŸ™ I had really hoped the cool auto-template feature would save me from doing that πŸ˜‰

    Plugin Author Jory Hogeveen

    (@keraweb)

    I’m looking into this now but it will pose some weird errors by implementing this.

    For example, your code:

    Before...
    <div class="mytip-content">
    	<h3>How to do {@post_title}</h3>
    	{@post_content}
    </div>
    After...

    When we would implement a page break that is added within the post content you would get HTML errors:

    Page 1:

    Before...
    <div class="mytip-content">
    	<h3>How to do {@post_title}</h3>
    	{@post_content} (UNTIL PAGEBREAK)
    

    Page 2:

    
    {@post_content} (STARTING AT PAGEBREAK)
    </div>
    After...

    As you see on page 1 the <div> element isn’t closed and on page 2 the <div> element isn’t opened.

    Cheers, Jory

    Thread Starter gaudiweb

    (@gaudiweb)

    are you saying that without the <div> it could go through without an html error? I think, that would probably be an acceptable work-around. Not sure about others with this setup, but I don not have to use that div!

    Plugin Author Jory Hogeveen

    (@keraweb)

    I did some more digging and found a possible solution with Pods Templates.

    {@post_content} always returns the raw content from the object. This isn’t parsed by any filters or functions.

    However, the function get_the_content() properly filters and parsed the content of an object and only required an object ID as the parameter.

    So instead of {@post_content} you could do this: {@ID,get_the_content}. This will get the post ID and then runs it through get_the_content().
    Tested locally and it works.

    Keep in mind that all HTML you’ve added around it in the template will always be shown.

    Hope this helps!

    Cheers, Jory

    Thread Starter gaudiweb

    (@gaudiweb)

    o.k., cool, that’s the best progress I made on this! With your approach, the pagebreak works and I can manually (via URL) select individual pages of the post. However now the pagination buttons and a post rating widget that normally shows under the post are gone. I am assuming that’s an artefact of the theme…

    Plugin Author Jory Hogeveen

    (@keraweb)

    However now the pagination buttons and a post rating widget that normally shows under the post are gone. I am assuming that’s an artefact of the theme…

    I’m not sure, it worked on my tests (default WP theme).

    Thread Starter gaudiweb

    (@gaudiweb)

    o.k., quick update…

    So I got the pagination to work with the approach you suggested – THANKS
    I had to add wp_link_pages() right behind the_content() in my theme’s content-single.ph, but that’s a minor modification!

    Now for some reason, this still scrambles a few other things up that I assume are hooked to the end of the_content, but I am pretty sure that’s a theme issue and I will find a work around. For now, this made serious progress already, so thanks for your time and effort!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘pods page with auto template – how to add pagination’ is closed to new replies.