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

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

问题描述

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

我正在使用Joomla 2.5和Ajax调用单个文章,但是当我在<div>标签中呈现文章时,我再次呈现了页眉,页脚和所有页面,但是我只想要内容. /p>

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

解决方案

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

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');

加载页面片段

how do I only show content in a single article?

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?

解决方案

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

Or you can try like this-

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

Loading Page Fragments

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

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