简体   繁体   English

覆盖Joomla组件模板

[英]Override Joomla Component Template

I am using this URL to access the raw HTML of a component: 我正在使用此URL访问组件的原始HTML:

/index.php?option=com_downloadform&tmpl=component

However it also returns the document type, title tags, head tags etc. 但是,它还会返回文档类型,标题标签,头标签等。

Is there a way to return only the content between <body> and </body> ? 有没有办法只返回<body></body>之间的内容?

Thanks, 谢谢,

Ian 伊恩

Inside your template folder, create a file (eg raw.php) and inside that file place only: 在模板文件夹中,创建一个文件(例如raw.php),并且仅在该文件中放置:

<jdoc:include type="component" />

Then, you can use /index.php?option=com_downloadform&tmpl=raw to access the raw output of the component. 然后,您可以使用/index.php?option=com_downloadform&tmpl=raw访问该组件的原始输出。 The tmpl parameter in your link must be the name of the file without the extension. 链接中的tmpl参数必须是不带扩展名的文件名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM