简体   繁体   English

joomla在程序控制下发布菜单项

[英]joomla publish menu item under program control

I need to control the publication of a menu or a menu item under program control. 我需要在程序控制下控制菜单或菜单项的发布。 I plan to write a ChronoForms form that will allow a user to nominate a date on which a menu or item is published and then another date on which it is unpublished. 我计划编写一个ChronoForms表单,该表单将允许用户指定菜单或项目的发布日期,然后指定其未发布的日期。 Then use php code to set those dates into the menu module definitions. 然后使用php代码将这些日期设置到菜单模块定义中。

Reading some answers here I suspect that I can do that by changing a database record but that that is not the best/preferred way - I should use the API. 在这里阅读一些答案,我怀疑可以通过更改数据库记录来做到这一点,但这不是最好/首选的方式-我应该使用API​​。

Can anyone get me started on that, please? 有人可以让我开始吗?

Regards Nick 问候尼克

As far as i know there isn't a publish start/end date for a joomla menu item. 据我所知,没有一个joomla菜单项的发布开始/结束日期。 So there is no api to do what you want. 因此,没有api可以执行您想要的操作。

The way i would do it is to store the start/end date in a separate table then create a schedule in mysql to check every day if a menu item should be published or not. 我要做的方式是将开始/结束日期存储在一个单独的表中,然后在mysql中创建一个计划,以检查每天是否应该发布菜单项。 And update the "published" field in table _menu accordingly. 并相应地更新表_menu中的“已发布”字段。

Sorry if this is not the answer you were looking for. 抱歉,这不是您想要的答案。

There is a extension called Article anywhere that let you import an article into another article. 在任何地方都有一个名为Article的扩展名,使您可以将一篇文章导入另一篇文章。 You can then set start/end publish date for these articles. 然后,您可以设置这些文章的开始/结束发布日期。

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

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