Skip to:
Content
Pages
Categories
Search
Top
Bottom

accessing the item_id with bpcontents


  • Roger Coathup
    Participant

    @rogercoathup

    Does anyone know how to the access the item_id using Burt Adsit’s bpcontents plugin?

    Burt provides a useful set of template functions to get the link, title, description of an item (e.g. oci_the_item_title() ), but I can’t see any simple way to access the item_id field. Am I missing something obvious?

    I’ve ‘hacked’ two new functions into bpc-items-templatetags to solve the problem, but feel there must be a better way.

    Any suggestions?

    p.s. does anyone know if Burt is still around, his profile seems inactive and his website is down?

Viewing 1 replies (of 1 total)

  • dpolant
    Participant

    @dpolant

    I don’t think there is a bpcontents template tag that outputs an item id in the loop.

    I assume you’re trying to access this value in a place where $oci_items_template has been defined, and so I think the fastest way to get it is to call global $oci_items_template and then get $oci_items_template->item->id.

    If on the off chance you have a group_id or user_id to feed in, oci_get_member_item_id() and oci_get_group_item_id() will return (not output) an item id from a group or user id. That’s about the best I can do but I bet that’s not what you’re looking for.

    So like you said, you’re probably going to want to write your own template tag to do this.

    I tried to contact Burt about a month ago and haven’t heard back yet – I heard he might be working on a new version of bpcontents but I don’t know anything definite.

    One word of warning – at least in my case, the 1.1 upgrade totally broke down bpcontents. It wasn’t too hard to get it working again but required about half a day of debugging. If you’ve got bpcontents running in 1.1 + without hacks I’d be very interested to hear how you did it.

Viewing 1 replies (of 1 total)
  • The topic ‘accessing the item_id with bpcontents’ is closed to new replies.
Skip to toolbar