简体   繁体   English

Joomla文章中的动态内容

[英]Dynamic content in Joomla Articles

I have some joomla articles. 我有一些joomla文章。 some values in that article has to be updated by data obtained through a soap call to other site. 该文章中的某些值必须通过通过肥皂呼叫其他站点获得的数据来更新。 Is there any plugin available for joomla by which i can embed custom php inside articles?? 是否有任何可用于joomla的插件,通过它我可以将自定义php嵌入文章中? How can i do this.?? 我怎样才能做到这一点。??

To me, the ideal way is to create a traditional component that gets all the data. 对我而言,理想的方法是创建一个获取所有数据的传统组件。 This component inserts these values in specified article ids. 该组件将这些值插入指定的商品ID。 These articles act as "data containers". 这些文章充当“数据容器”。

Why create a traditional component? 为什么要创建传统组件? Because you'll be going to use libraries, error corrections and such and a component solution can be more robust. 因为您将要使用库,所以纠错等组件解决方案可能会更可靠。 IMHO it's a good idea to avoid php logic in your editor panel. 恕我直言,在编辑器面板中避免php逻辑是个好主意。

Then, in the articles that are shown to users in the frontend, using Include Content Item Joomla Plugin , you add {include_content_item 123} , being 123 the id of the article you inserted data you want to show in your component. 然后,在前端显示给用户的文章中,使用Include Content Item Joomla插件 ,添加{include_content_item 123} ,即123作为您插入要在组件中显示的数据的文章的ID。 Doing the {} call outputs the article which id is "123". 进行{}调用将输出ID为“ 123”的文章。

There are a lot of such component, they are more or less the same. 有很多这样的组件,它们或多或少都是相同的。 I use Sourcerer, but pay attention as version of php is crucial sometimes. 我使用Sourcerer,但请注意,因为php版本有时非常重要。 http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-content/5051 http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-content/5051

Allows to insert php/js/css code to articles and modules. 允许将php / js / css代码插入文章和模块。

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

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