只显示文章内容 [英] show only the content of article

查看:18
本文介绍了只显示文章内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何只显示一篇文章中的内容?

how do I only show content in a single article?

我使用 Joomla 2.5 和 Ajax 来调用单个文章,但是当我在 <div> 标记中渲染文章时,我再次渲染页眉、页脚和所有页面,但我只想要内容.

I am using Joomla 2.5 and Ajax to call a single article, but when I render the article in a <div> tag, I render again the header, the footer and all the page , but I only want the content.

如何将页面或文章配置为仅显示内容?

How do I configure the page or the article to show only the content?

推荐答案

如果您只想获取组件,您可以在 url 后附加 tmpl=component 参数.您的文章网址将是这样的-

If you only want to get component you can append tmpl=component parameter with the url. Your article url will be like this-

index.php?option=com_content&view=article&id=1&tmpl=component

或者你可以这样尝试-

$('#result').load('index.php?option=com_content&view=article&id=1&tmpl=component #container');

加载页面片段

这篇关于只显示文章内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆