Joomla 文章中的动态内容
我有一些 joomla 文章。该文章中的某些值必须通过对其他站点的肥皂调用获得的数据进行更新。 joomla 有没有可用的插件,我可以通过它在文章中嵌入自定义 php?我该怎么办?
I have some joomla articles. 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?? How can i do this.??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对我来说,理想的方法是创建一个获取所有数据的传统组件。该组件将这些值插入指定的文章 ID 中。这些文章充当“数据容器”。
为什么要创建传统组件?因为您将使用库、纠错等,并且组件解决方案可以更加健壮。恕我直言,最好避免在编辑器面板中使用 php 逻辑。
然后,在前端向用户显示的文章中,使用 包含内容项 Joomla 插件,您添加
{include_content_item 123}
,其中 123 是您插入要在组件中显示的数据的文章的 ID。执行 {} 调用会输出 id 为“123”的文章。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. 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.
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. Doing the {} call outputs the article which id is "123".查看Joomla 插件存储库中的“内容中的自定义代码”
祝你好运!
Check out the Joomla plugin repository for "custom code in content"
Good luck!
这样的组件有很多,它们或多或少是相同的。
我使用 Sourcerer,但要注意 php 的版本有时很重要。
http://extensions .joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-content/5051
允许将 php/js/css 代码插入文章和模块。
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.
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.