AMPXF - AMP for Xenforo 2

AMPXF - AMP for Xenforo 2 [Paid] 1.4.9

No permission to buy (€50.00)
Heads up... wile trying to grab the update from your server.

Whenever I log in I get the following error from your server.

Forbidden (403)​

CSRF verification failed. Request aborted.
 
Heads up... wile trying to grab the update from your server.

Whenever I log in I get the following error from your server.

Forbidden (403)​

CSRF verification failed. Request aborted.

Yeah been happening to me for about 8 months, logout/in again and it should work.
 
Heads up... wile trying to grab the update from your server.

Whenever I log in I get the following error from your server.

Forbidden (403)​

CSRF verification failed. Request aborted.
That usually means that the csrf token from the login page has expired.. Try reloading the login page before logging in and it should be fine 😊👍
 
Hello,

I am using the latest versions of AMPXF and Siropu Ads Manager.
I also use Google ad manager codes in Siropu Ads manager. I need to add the main category Id to the targeting json section in the GAM code.
Sample :

JSON:
json='{"targeting":{"site_div":["AMP"],"categoryId":["xxx"]}}'

Normally, I can pull the main category ID from the $breadcumb variable (inside the PAGE_CONTAINER template)

HTML:
<xf:if is="$breadcrumbs">
    <xf:foreach loop="$breadcrumbs" value="$catarray" i="$i">
        <xf:if is="$catarray.attributes.node_id">
            <xf:set var="{$cat_id_ads.{$i}}" value="{$catarray.attributes.node_id}" />
            <xf:set var="{$cat_name.{$i}}" value="{$catarray.value}" />
        </xf:if>
    </xf:foreach>
</xf:if>
I can't use $breadcrumbs variable in AMP_CONTAINER template.

My question is: is there any variable which I can get the main category id of the thread? If not, how do we access a variable ourselves from within the amp templates? For example to the $breadcrumbs variable.

thank you.
 
Hello,

I am using the latest versions of AMPXF and Siropu Ads Manager.
I also use Google ad manager codes in Siropu Ads manager. I need to add the main category Id to the targeting json section in the GAM code.
Sample :

JSON:
json='{"targeting":{"site_div":["AMP"],"categoryId":["xxx"]}}'

Normally, I can pull the main category ID from the $breadcumb variable (inside the PAGE_CONTAINER template)

HTML:
<xf:if is="$breadcrumbs">
    <xf:foreach loop="$breadcrumbs" value="$catarray" i="$i">
        <xf:if is="$catarray.attributes.node_id">
            <xf:set var="{$cat_id_ads.{$i}}" value="{$catarray.attributes.node_id}" />
            <xf:set var="{$cat_name.{$i}}" value="{$catarray.value}" />
        </xf:if>
    </xf:foreach>
</xf:if>
I can't use $breadcrumbs variable in AMP_CONTAINER template.

My question is: is there any variable which I can get the main category id of the thread? If not, how do we access a variable ourselves from within the amp templates? For example to the $breadcrumbs variable.

thank you.
With "main category id", does that mean the first/leftmost id in breadcrumbs list? i.e. not the current form id?

I'll have to look a bit further into this, but it should be possible for you to add the same "breadcrumbs"-snippet from PAGE_CONTAINER to AMP_CONTAINER and it should likely work the same..

If you only need access to the current forum node (i.e. rightmost in breadcrumbs) then you should be able to use e.g. $__globals.forum.node_id
 
Hello,

With "main category id", does that mean the first/leftmost id in breadcrumbs list? i.e. not the current form id?

yes i want exactly that

I'll have to look a bit further into this, but it should be possible for you to add the same "breadcrumbs"-snippet from PAGE_CONTAINER to AMP_CONTAINER and it should likely work the same..
Actually, i have already tried this. But it didn't work. Maybe I did something wrong. I will try again today
If you only need access to the current forum node (i.e. rightmost in breadcrumbs) then you should be able to use e.g. $__globals.forum.node_id
I need to target the main category that you have explained above, or an array with all the category / forum node ids. The code I normally use in the PAGE CONTAINER template assigns the entire hierarchy of the category node ID to an array variable. But I have never needed such a detailed targeting.
 
Actually, i have already tried this. But it didn't work. Maybe I did something wrong. I will try again today
I had to open the AMP_CONTAINER to check and the breadcrumbs code and macros are the same in both AMP_CONTAINER and PAGE_CONTAINER..

I also tried opening a random AMP page on your forum, and the breadcrumbs render, so the $breadcrumbs is at least available in the AMP_CONTAINER-template context :)

I'm wondering if there is something (maybe Siropu addon?) that doesn't pass on all needed things to the ad-rendering context? 🤔
- You said this same thing works fine on the normal pages with Siropu addon?
 
I had to open the AMP_CONTAINER to check and the breadcrumbs code and macros are the same in both AMP_CONTAINER and PAGE_CONTAINER..

I also tried opening a random AMP page on your forum, and the breadcrumbs render, so the $breadcrumbs is at least available in the AMP_CONTAINER-template context :)

I'm wondering if there is something (maybe Siropu addon?) that doesn't pass on all needed things to the ad-rendering context? 🤔
- You said this same thing works fine on the normal pages with Siropu addon?
Hi @mazzly ,
You are right. I have just tried below code in AMP_CONTAINER and render. And it works great.
Code:
        <xf:if is="$breadcrumbs">
            <xf:foreach loop="$breadcrumbs" value="$catarray"  i="$i">
                <xf:if is="$catarray.attributes.node_id">
                    <xf:set var="{$cat_id_ads.{$i}}" value="{$catarray.attributes.node_id}" />
                </xf:if>
            </xf:foreach>
            <xf:set var="$mainCategory" value="{$cat_id_ads|first}" />
        </xf:if>

And yes I can't
yes, you are right. Problem I can't access the variable I defined in the amp_container template from the ad rendering code in the siropu addon.

I need to research this problem a bit in the sirop addon discussion group. Thank you for your help.
 
@mazzly any way to increase the speed of checks on my site on your end?
Not at the moment no.. Is there some specific reason for this?
Google Search Console will also find AMP page issues in bulk but takes much longer to verify when they have been actually fixed.. Wondering if we could enable/allow uploading of the CSVs that can be exported from Search Console to get those same pages directly into the AMPXF problem page list for faster checking of fixed problems with the AMPBot? 🤔
 
Hi @mazzly
I don't know if you've already fixed this, but when a forum is set as a "question" forum, the amp layout isn't working properly (you can check it out here)

View attachment 268956
If you are talking about the answers/posts not having spacing between each, the difference between AMP and canonical is that the `samAlignCenter"-class has margin: 10px auto;, while the b-container-ad-class doesn't have that..

The fix for that should be to edit your amp_extra.less to have the following:
Code:
.b-container.b-container-ad {
    text-align: center;
    background: transparent;
    border: none;
    margin: 10px auto;
}

Hope that helps. 👍

Cheers
//Jonathan
 
Top Bottom