简体   繁体   中英

How to disable the menu item after specific time in joomla 2.5?

可以说我有一个菜单项“航空公司预订”,它应该在4点后不活动,那么在joomla 2.5中应该怎么做?

You don't need to do any thing on joomla.

The right thing you need to do on this case is what function you need to close after your end time. click the menu - >in that page check the time and block the things. This is best practise.

Other way is :

You can achieve this by using Javascript. But this is not at all a good practice. Get the local time of the user and compare its with your disable time(4 o'clock). This has some complication with time zones to but you can do it with js. Then use jquery to remove the link of that menu and . like:

jQuery("#menu_id").attr('href','javascript:;');

There is no concept of menu item expiry based on time you can give some access level for menus like registered,public etc..

Hope this will help you ...

菜单没有publish_up publish_down,但是如果每天在同一时间始终关闭菜单,则可以运行cron作业以取消发布该菜单。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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