ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How can i display page numbers in template title?

June 11, 2012 8:15am

Subscribe [2]
  • #1 / Jun 11, 2012 8:15am

    andrei12_34

    6 posts

    <?php $urlpagination = substr(’{segment_1}’, 0, 1);?>
      {if segment_1 == '' OR "<?php echo $urlpagination; ?>" == "P"}
      {exp:nsm_better_meta:template title="News"}

    This is the code i have there… can somebody help me?

    Currently, i have duplicate titles for all the pages.

  • #2 / Jun 11, 2012 8:49am

    Rob Allen

    3108 posts

    It’s quite straightforward with a Channel entries tag:

    <title>
    {exp:channel:entries channel="blog" orderby="date" sort="desc" limit="10" disable="category_fields|member_data"}{paginate}Page {current_page} - {/paginate}{/exp:channel:entries}
    Blog - My site</title>

    That will output “Page 1 - Blog My site”, “Page 2 - Blog - My site” etc.

    All you need to remember is keep the paramaters the same as the content on page, suhc as orderby/sort/limit.

  • #3 / Jun 11, 2012 9:07am

    andrei12_34

    6 posts

    Thanks for your quick response. The only problem is that i am using NSM Better Meta module. Is there a way to paste a code there and simply get the page number next to the title?

    I mean here: {exp:nsm_better_meta:template title=“News”}

    Thanks!

  • #4 / Jun 11, 2012 9:15am

    Rob Allen

    3108 posts

    I would suggest outputting the {exp:nsm_better_meta:template} tag twice (once for title and again for other meta data) but I don’t think you can with that addon. You’d probably need to contact EE garage to see what options there are.

  • #5 / Jun 12, 2012 5:17pm

    Shane Eckert

    7174 posts

    Hey andrei12_34,

    I see that Rob was able to help you out here. That’s awesome.

    Is there anything else you need help with?

    Cheers,

  • #6 / Jun 12, 2012 5:27pm

    andrei12_34

    6 posts

    Didn’t solve anything… maybe you can take a look and give me a solution

    http://www.4wheelsnews.com/P25/

     

  • #7 / Jun 12, 2012 5:31pm

    Shane Eckert

    7174 posts

    Hello andrei12_34,

    Did you contact the devs at NSM?

    I am going to bump this over to the Community Help Forum as this is a bit outside of support.

    Thanks again to Rob for the assist!

    Cheers,

  • #8 / Jun 12, 2012 5:38pm

    andrei12_34

    6 posts

    Shane,

    I sent them an email on Sunday, but i didn’t get any response…

    Thank you very much for helping me!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases