[SOLVED] Differentiate between Element and Hotlink Group?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-03-07
08:18 AM
- last edited on
2023-07-13
02:30 PM
by
Doreena Deng
2016-03-07
08:18 AM
How do you tell if the element is grouped by the user or is merely just inside a hotlink module? What I use is if there is a groupGuid value present although hotlinked elems also have a groupGuid and are being considered by ACAPI_ElementGroup_GetGroupedElems as a legit group even if they weren't grouped by the user and are just part of a hotlink.
UsingACAPI_ElementGroup_GetGroupedElems(groupGuid):
- Grouped elems (hotlinked or not) returns their immediate elems => this is what I need
- Non-grouped non-hotlinked elems have no groupGuid thus ignored => also ok
- Non-grouped hotlinked elems have a groupGuid and will return immediate elems (all fellow hotlinked elems) => not ok, I don't need this
Basically what I need are elements that are grouped only by the user regardless if its in a hotlink module or not, and any non-grouped elems (hotlinked and otherwise) should be ignored. Any Ideas?
Using
- Grouped elems (hotlinked or not) returns their immediate elems => this is what I need
- Non-grouped non-hotlinked elems have no groupGuid thus ignored => also ok
- Non-grouped hotlinked elems have a groupGuid and will return immediate elems (all fellow hotlinked elems) => not ok, I don't need this
Basically what I need are elements that are grouped only by the user regardless if its in a hotlink module or not, and any non-grouped elems (hotlinked and otherwise) should be ignored. Any Ideas?
Labels:
- Labels:
-
Add-On (C++)
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-03-18 06:45 PM
2016-03-18
06:45 PM
Erenford wrote:Hotlinked elements also have the hotlinkGuid member set in their element header, whereas user-grouped elements don't.
How do you tell if the element is grouped by the user or is merely just inside a hotlink module? What I use is if there is agroupGuidvalue present although hotlinked elems also have a groupGuidand are being considered by ACAPI_ElementGroup_GetGroupedElemsas a legit group even if they weren't grouped by the user and are just part of a hotlink.
UsingACAPI_ElementGroup_GetGroupedElems(groupGuid):
- Grouped elems (hotlinked or not) returns their immediate elems => this is what I need
- Non-grouped non-hotlinked elems have no groupGuid thus ignored => also ok
- Non-grouped hotlinked elems have a groupGuid and will return immediate elems (all fellow hotlinked elems) => not ok, I don't need this
Basically what I need are elements that are grouped only by the user regardless if its in a hotlink module or not, and any non-grouped elems (hotlinked and otherwise) should be ignored. Any Ideas?
Best, Ákos
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-03-29 08:53 AM
2016-03-29
08:53 AM
Akos wrote:Yes, but what I'm having problems with is when it is BOTH grouped and hotlinked. For example:
Hotlinked elements also have the hotlinkGuid member set in their element header, whereas user-grouped elements don't.
Best, Ákos
1) Elems were user-grouped on its original project (lets say its P1)
2) On another project, P2, the project P1 is then hotlinked
3) On P2, elems will now have both valid hotlinkGuid and groupGuid in their headers.
Anyway, I've managed to get a workaround for this issue by comparing the number of levels of the group tree (using
If they're equal, then its a normal hotlinked elem. If group level is greater, means the elem is user-grouped (if the difference is 1 then it's user-grouped only once, greater than 1 means it's user-grouped multiple times).