I’m trying to create a custom Magento page for my module that is completely blank with only one string in the output. The page cannot have HTML tags like <html>
, <body>
and <head>
.
I need this to make a API integration with Facebook, which scrap the page content to check if a string is valid, so I can’t have any HTML code, only pure plain text.
Code so far:
Controller:
public function facebookAction()
{
$this->loadLayout();
$this->renderLayout();
}
View:
<?php
$action = $this->getRequest()->getActionName();
echo Mage::getModel('chatbot/chatdata')->requestHandler($action);
?>
Now it’s showing the string I want, but with HTML tags. If I remove the loadLayout and renderLayout, then it shows nothing.
How can I accomplish that?
2
Answers
you can remove diffrent section from your custom page using xml like this.
Then you can add your custom code in your phtml file.
You can call a different template from your controller action using
This overwrites the “root” node from your layout XML and replaces it with your own template.