English 中文(简体)
Joomla 组件: 输出没有 html
原标题:Joomla component: Output without html

我正在为Joomla 2.5 开发一个 Joomla 组件。 由于它应该输出 XML, 我最不情愿的不想显示周围的模板 。

我试着附着在骨灰盒上:

  • ?tmpl=component
  • ?format=raw
  • ?tmpl=raw

但第一个会围绕内容输出产生一些 HTML, 第二个会给我500 个错误。 第三个会完全没有输出。 我想它正在寻找一个名为“ raw ” 的模板, 因为在那里我加到的任何其他胡言乱语的模板名称都给了我同样的结果 。

我怎样才能从部件中输出 XML? 没有附加的 Joomla + 模板 HTML?

最佳回答

在 Joomla! 1. 5 中, 您只需要添加 < code>? tmpl= 构件 & amp; format= raw , 但要实现原始显示, 您只需要添加 < code>? tmpl= 构件 & amp; format= raw

在 Joomla! 2.5 中, 您需要制作与您现有的 < code> view. html.php 相同但取决于您需要的文件 。 在控制器中, 您也需要手动手动抓取原始视图, 因为默认类型是 html 。

您可以在文件 Administator/ parties/com_banners/ controllers/ tracks.raw.php 中找到一个非常好的范例, 默认组件与Joomla一起发运。

问题回答

暂无回答




相关问题
cross platform issues in webpages

I am developing some basic html pages, i am setting colors of text usimg color code #e7eddf it seems fine in windows but seems different in mac. Can you explain me why its happening and also ...

How to create breadcumb for custom component in Joomla?

I have a custom component in which I want to have a breadcumb to help the user navigate the previous page visits. The basic feature in my component is to show our product releases. The workflow is: ...

Preloading images

i ve a navigation bar like the one below..for each it changes the background color on mouseover and mouseout and there is a lag to load those images which looks awful :( i wanna know how to preload ...

Joomla conditional menu item

I d like to create a menu item in Joomla that points to one article when the user is logged out, and a different article when the user is logged in. I tried creating two menu items, and make them ...

unable to connect to database on AWS

actually I have my website build with Joomla hosted on hostmonster but all Joomla website need a database support to run this database is on AWS configuration files need to be updated for that I ...

How can you test if you re on the homepage in Joomla?

I m working on a Joomla site, and I need the front page to look slightly different from the rest of the pages, but not enough to warrant the use of two themes (it s a pain to have to update two ...

How to get the current Joomla username?

I m trying to get the current Joomla username. I was able to get it by using $user =& JFactory::getUser(); echo $user->username; But now I ve installed Joomla on my local server and it doesn ...

热门标签