• Priority: 0
  • Status: Closed
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 13.12.19, 16:39
  • Opened by: ric nov
  • Closed by: Fred
  • Closed on: 24.12.19, 11:30
  • Reason: Closed
  • Comment: Glad to help!

Ticket #16451 - Disable AMP for certain CMS page

How can i disable AMP for CMS page? I’m using the new elementor module for design CMS page, but is not compatible with amp, the content disappear on AMP version, i asking you how can disable amp for cms page, thanks.

Comments

Fred 14 Dec 2019, 18:38

There is no way to disable it in back office

ric nov 14 Dec 2019, 18:46

i need to edit some file? you can explain to me, thanks

Fred 14 Dec 2019, 19:28
ric nov 15 Dec 2019, 09:48

with this line when visit by AMP that page, redirect to home

i put that code, where 8 is the id of the page i want to not make amp:

if ($cms_id == 8) break;
Fred 16 Dec 2019, 12:01

We have too much customer tickets now, and don’t have tome for customisation, sorry

ric nov 16 Dec 2019, 12:26

I can’t disable for all cms page simply for now?

ric nov 16 Dec 2019, 12:30

i have delete that part of code, for disable all cms page:

          case 'cms':

                $cms_id = (int)Tools::getValue('id_cms');
                
                $cms_title = $ampClass->getCMSTitle($cms_id);

                $cacheId = 'amp_header|cms|'.$cms_id;
                $ampLink = $link->getModuleLink($this->name, 'cms', array('id_cms' => $cms_id, 'link_rewrite' => $cms_title), true, $lang_id, $shop_id, false);

                break;

is right?

ric nov 17 Dec 2019, 13:59

Hi Fred, this is temporary solution, when you’re more “tickets free”, i need solution for that, thanks!

Fred 17 Dec 2019, 14:09

Yes, that could be a solution. We will check out what could be done here

ric nov 20 Dec 2019, 17:03

Ok, you need to give me a solution for disable only a certain cms page, thanks Fred.

Fred 23 Dec 2019, 16:26

Try this:

if (Tools::getValue('id_cms') == 1) {
            $redirect = false;
}

https://take.ms/VwJio

ric nov 23 Dec 2019, 19:37

Yes this work, if i need to esclude more cms page i need to repeat this, right? thanks

Fred 24 Dec 2019, 11:29

Great!