dongrong9053 2016-08-14 20:53
浏览 34
已采纳

检测Concrete5中Block是否处于活动状态

Concrete5 Blocks do not get deleted when they are "removed" because of consistency reasons in the history.

Now I have the following situation: I have a custom block with the database table called btMyCustomBlock.

It looks like this:

 |---bID---|---cID---|---someParam---|

Now, when such a block is "removed" and the Page is saved, the database will still maintain the block - which is ok.

BUT: I need a way to detect if my block is used on this page right now. I am looking for something like:

Select a random entry from btMyCustomBlock WHERE entry is used as a block on the page right now.

How can I do that? I found out that the table Blocks has the field bIsActive but it seems that this does not correlate with what I am looking for, does it?

  • 写回答

1条回答 默认 最新

  • dougu2006 2016-08-16 14:19
    关注

    I believe what you are looking for is this

    SELECT b.*
    FROM btMyCustomBlock b
    INNER JOIN CollectionVersionBlocks cvb ON b.bID = cvb.bID
    INNER JOIN CollectionVersions cv ON cvb.cvID = cv.cvID
    WHERE cv.cvIsApproved = 1
    

    Get all the records that are connected to the currently approved page version.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度