Solved Default by XF option missing or not obvious

pavelandreev

Licensed
Licensed
SEO Optimization
Joined
Sep 9, 2022
Messages
8
Reaction score
2
Hello, I`m trying to set a proper default option for threads, resources and media items, but I cant find the option at all:

1665648795288.png

Where is this Default by XF defined?
As it is right now, when its set to Default by XF, no actual meta tag for robots is added:

1665648848630.png

The tag is just missing from the HTML.
Can anyone help with this?
 
Solution
Indeed there is a problem for resources and media, it should not have empty content :(

For the media, here is the template modification: xs_seo_xfmg_media_view_mt
In the "replace" field you paste this :
HTML:
<xf:title>{{ change_title($mediaItem)|raw }}</xf:title>
<xf:if is="{$mediaItem.xs_seo.meta_robots} == ''">
    <xf:head option="metaNoindex">
        <meta name="robots" content="index,follow" />
    </xf:head>
<xf:else />
    <xf:head option="metaNoindex">
        <meta name="robots" content="{$mediaItem.xs_seo.meta_robots}" />
    </xf:head>
</xf:if>
For the resources here is the template modification to modify: xs_seo_resource_view_mt
In the "replace" field you paste this :
HTML:
<xf:title>{{ change_title($resource)|raw...
Hello,
Hello, I`m trying to set a proper default option for threads, resources and media items, but I cant find the option at all:

View attachment 1500

Where is this Default by XF defined?
As it is right now, when its set to Default by XF, no actual meta tag for robots is added:

View attachment 1501

The tag is just missing from the HTML.
Can anyone help with this?
Basically xenforo does not define any. If it is by default there is no tag that defines it

Regards, CRUEL-MODZ
 
Hello,

Basically xenforo does not define any. If it is by default there is no tag that defines it

Regards, CRUEL-MODZ
Aha, understood.
So basically I need to edit the template where the robots tag is shown and set a default there?
If yes, which template should I edit?
 
Aha, understood.
So basically I need to edit the template where the robots tag is shown and set a default there?
If yes, which template should I edit?
Hello, you don't need to change the template. This option allows you to change the settings for Meta-Tag ;)

Regards, SyTry
 
Hello, you don't need to change the template. This option allows you to change the settings for Meta-Tag ;)

Regards, SyTry
I understand the option, however I need a way for the default not to be empty string.
So if no option chosen (Default by XF) I need it to be index,follow (the default)
As it stands now, the robots tag is shown like this: <meta name="robots" content="" />

This default meta tag is coming from somewhere, I`m assuming in a template somewhere, so my idea is to change the default to be: <meta name="robots" content="index,follow" /> instead of <meta name="robots" content="" />
Is there a way to do this?
 
Last edited:
I understand the option, however I need a way for the default not to be empty string.
So if no option chosen (Default by XF) I need it to be index,follow (the default)
As it stands now, the robots tag is shown like this: <meta name="robots" content="" />

This default meta tag is coming from somewhere, I`m assuming in a template somewhere, so my idea is to change the default to be: <meta name="robots" content="index,follow" /> instead of <meta name="robots" content="" />
Is there a way to do this?
I don't understand all :(
Can you give me a URL where the meta robot and like this : <meta name="robots" content="" />
You can modify the template modification: thread_view_xs_seo
And in the "replace" area you paste this:
HTML:
<xf:if is="{$thread.xs_seo.meta_robots} == ''">
    <xf:if is="!$thread.isSearchEngineIndexable()">
        <xf:head option="metaNoindex">
            <meta name="robots" content="noindex" />
        </xf:head>
    <xf:else />
        <xf:head option="metaNoindex">
            <meta name="robots" content="index,follow" />
        </xf:head>
    </xf:if>
<xf:else />
    <xf:head option="metaNoindex">
        <meta name="robots" content="{$thread.xs_seo.meta_robots}" />
    </xf:head>
</xf:if>
 
You can modify the template modification: thread_view_xs_seo
And in the "replace" area you paste this:
I`ve done the modification. Should I rebuild the addon or just leave it as is?

Can you give me a URL where the meta robot and like this : <meta name="robots" content="" />
Thread: Ин витро - моя опит, мнение и препоръки
Showing: <meta name="robots" content="index,follow" />

Media: КАКВО Е ТЕСТОСТЕРОНОВА ТЕРАПИЯ(TRT)? - Здравен форум & дарителска общност
Showing: <meta name="robots" content="" />

Resource: Алергия - причини, симптоми, лечение и превенция
Showing: <meta name="robots" content="" />
 
Indeed there is a problem for resources and media, it should not have empty content :(

For the media, here is the template modification: xs_seo_xfmg_media_view_mt
In the "replace" field you paste this :
HTML:
<xf:title>{{ change_title($mediaItem)|raw }}</xf:title>
<xf:if is="{$mediaItem.xs_seo.meta_robots} == ''">
    <xf:head option="metaNoindex">
        <meta name="robots" content="index,follow" />
    </xf:head>
<xf:else />
    <xf:head option="metaNoindex">
        <meta name="robots" content="{$mediaItem.xs_seo.meta_robots}" />
    </xf:head>
</xf:if>
For the resources here is the template modification to modify: xs_seo_resource_view_mt
In the "replace" field you paste this :
HTML:
<xf:title>{{ change_title($resource)|raw }}</xf:title>
<xf:if is="{$resource.xs_seo.meta_robots} == ''">
    <xf:head option="metaNoindex">
        <meta name="robots" content="index,follow" />
    </xf:head>
<xf:else />
    <xf:head option="metaNoindex">
        <meta name="robots" content="{$resource.xs_seo.meta_robots}" />
    </xf:head>
</xf:if>
 
Solution
Indeed there is a problem for resources and media, it should not have empty content :(

For the media, here is the template modification: xs_seo_xfmg_media_view_mt
In the "replace" field you paste this :
HTML:
<xf:title>{{ change_title($mediaItem)|raw }}</xf:title>
<xf:if is="{$mediaItem.xs_seo.meta_robots} == ''">
    <xf:head option="metaNoindex">
        <meta name="robots" content="index,follow" />
    </xf:head>
<xf:else />
    <xf:head option="metaNoindex">
        <meta name="robots" content="{$mediaItem.xs_seo.meta_robots}" />
    </xf:head>
</xf:if>
For the resources here is the template modification to modify: xs_seo_resource_view_mt
In the "replace" field you paste this :
HTML:
<xf:title>{{ change_title($resource)|raw }}</xf:title>
<xf:if is="{$resource.xs_seo.meta_robots} == ''">
    <xf:head option="metaNoindex">
        <meta name="robots" content="index,follow" />
    </xf:head>
<xf:else />
    <xf:head option="metaNoindex">
        <meta name="robots" content="{$resource.xs_seo.meta_robots}" />
    </xf:head>
</xf:if>
The changes fixed the issue, thank you!
Now both the resource and media items are showing proper default meta tags.
 
Hello, this is fixed in the 2.6.2 version, thank your for reporting this ! ;)

Regards, SyTry
 
Top Bottom