We’re currently experiencing a high volume of inquiries and our response time could be up to 2 days. We apologize for the delay, and thank you for your patience. Our available time: 2 AM - 1 PM (Monday - Friday) (UTC+0 Timezone).

Okay
  Public Ticket #2479834
about seo module
Closed

Comments

  •  1
    SS started the conversation

    hi,

    how can I set meta tag for pages and posts?

    thanks.

  •  2,562
    Support replied

    Hi,

    The easiest way to add new meta tags to page/post:

    Add to platform/themes/[your-theme]/views/page.blade.php or platform/themes/[your-theme]/views/post.blade.php

    @php
        SeoHelper::meta()->addMeta('robots', 'index, follow'); // SeoHelper::meta()->addMeta('[tag name]', '[tag content]')
    @endphp


    You can add many meta tags as you want.

    Ex:

    @php    
        SeoHelper::meta()->addMeta('...', '...')
            ->addMeta('...', '...')
            ->addMeta('...', '...');
    @endphp


  •  2,562
    Support replied

    Or you can hook to action BASE_ACTION_PUBLIC_RENDER_SINGLE.

    Ex: Add to platform/themes/[your-theme]/functions/functions.php.

    add_action(BASE_ACTION_PUBLIC_RENDER_SINGLE, function ($screen, $data) {    
        if (in_array($screen, [PAGE_MODULE_SCREEN_NAME, POST_MODULE_SCREEN_NAME])) {        
            SeoHelper::meta()->addMeta('robots', 'index, follow');        
            SeoHelper::openGraph()
                ->addProperty('image:width', '600')            
                ->addProperty('image:height', '300');
            if ($data->image) {            
                SeoHelper::twitter()->addImage(get_image_url($data->image));        
            }    
        }
    }, 120, 2);


    You can find all available methods for SeoHelper in platform/packages/seo-helper/src/SeoHelper.php.


  •  1
    SS replied

    hi,

    there is another problem about seraching and pagination.

    let's say I searched "av" it shows results and pagination like this:

    http://prntscr.com/ttt0lu

    If I click, pagination second page (2 page button), search query is null. See: http://prntscr.com/ttt180




  •  2,562
    Support replied

    Hi,

    It's an issue with pagination, please change

    {!! $posts->links() !!}

    to

    {!! $posts->appends(request()->input())->links() !!}


    Thanks for your feedback!

  •  1
    SS replied

    Hi,

    I changed it but nothing is changed?

    I faced this issue on category page like: http://prntscr.com/tubsoq

    I should change on which file?

    Thank you!

  •  2,562
    Support replied

    Hi,

    You need to change in platform/themes/ripple/views/search.blade.php 

    It's working fine on our demo site: https://cms.botble.com/search?q=a

  •  1
    SS replied

    Hi,

    Search results and pagination are okay now.

    There is another problem on category page. Let's say,

    • you are on SEO category page,
    • SEO cat has some posts,
    • Pagination shows 9 pages but,
    • 8. and 9. page says: "There is no data to display!"

    #1:http://prntscr.com/tue1gp

    #2:http://prntscr.com/tue1nb

  •  2,562
    Support replied

    Hi,

    We can reproduce this issue. It doesn't happen on our demo sites.

    Can you give me your site to check?

  •  1
    SS replied

    Sure but,

    This is a public site. How can I send you my site link as P.M message?

  •  2,562
    Support replied

    You can add a private reply.

    7451181954.png


  •   SS replied privately
  •  2,562
    Support replied

    Can you show me your code? It's not my source code so I'm not sure what's wrong.

  •   SS replied privately
  •  2,562
    Support replied

    Hi,

    It's so weird. It is default Laravel pagination so it should works as normal.

    You can see that we don't modify Laravel pagination.

    Please remove 

    ->appends(request()->input())

    in /home/bitnami/htdocs/platform/themes/myTheme/views/category.blade.php then try again.

    We just need to append it in search.blade.php

  •  1
    SS replied

    yesterday you said this: http://prntscr.com/tux9ru

    Anyway I changed as

    {!! $posts->links() !!}

    but nothing is changed? I also cleared cache.

  •  2,562
    Support replied

    Hi,

    You need to change in platform/themes/ripple/views/search.blade.php 

    Just change it in search.blade.php.

    Actually, I don't know what's wrong with pagination so we need to try it.

  •  1
    SS replied

    "Actually, I don't know what's wrong with pagination so we need to try it."

    Yes, please. 

    I could not find the reason.

  •  2,562
    Support replied

    You can see that it is the default Laravel pagination so we need to debug to find the issue.

    I can't access to your hosting to debug it so I can't help. I can't reproduce that issue on my side.

  •  1
    SS replied

    hi,

    • this error is not exist on your side?
    • on backend side, to find issue and solution I need to look on which folder/file?


  •  2,562
    Support replied

    Yes,

    It's fine in my side, you can check our demo site too.

    Source code for category page is in platform/plugins/blog/src/Providers/HookServiceProvider.php line 217