0

I want to display the article content without template (header, footer, sidebars etc). I just want to display content. I fetching the content using ajax so dont want to display in template.

vishal
  • 3,993
  • 14
  • 59
  • 102
  • like `example.com/yourlink?tmpl=component`? – Marko D Mar 05 '13 at 12:19
  • yes, can we create and assign any template to menu item to avoid displaying header, footer etc – vishal Mar 05 '13 at 12:28
  • Can you add the code that you are using to fetch the content? "Fetching the content using ajax" can mean a few different things and this is where you would need to add the `tmpl=component` piece. – David Fritsch Mar 05 '13 at 18:06

2 Answers2

0

Since your users may be using some custom extensions to handle SEF, it's best when you make ajax calls NOT to go through JRoute to generate the link, this will leave all the parameters clear.

If this is not an option, and you don't want your template to render, you can issue an exit command at the end of your view's display method, this will stop template processing and obtain a similar result as tmpl=component, it just won't include headers most likely.

Riccardo Zorn
  • 5,590
  • 1
  • 20
  • 36
0

Passing tmpl=component in url renders page without template (header, footer etc) but it still renders

I created custom component_ajax.php compoment file in root of template and passed tmpl=component_ajax in ajax request. In component_ajax.php removed all parts which are not needed and kept only . Removed all other html tags. So what i get in ajax response is the content only.

vishal
  • 3,993
  • 14
  • 59
  • 102