UDT: finding page with a given value in "extra"-property? Topic is solved

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
emgaron
Forum Members
Forum Members
Posts: 25
Joined: Tue Jul 10, 2012 6:52 am

UDT: finding page with a given value in "extra"-property?

Post by emgaron »

I'm currently trying to find out if/how it is possible - within an UDT - to search for pages in the hierarchy that have one of the extra-properties (extra1-3) set to a certain value. Unfortunately, I'm struggling with the documentation at https://apidoc.cmsmadesimple.org and have not been able to find this yet... There is "find_by_tag()" from the HierarchyManager, but that does not seem to work for something like "extra3" as tag (where do I find the list of valid tags for that method? ??? ). Hence, I assume I will somehow have to loop through all pages and check the "extra3"-property explicitly, but really no idea where/how to start. Pointers to documentation are most welcome!
emgaron
Forum Members
Forum Members
Posts: 25
Joined: Tue Jul 10, 2012 6:52 am

Re: UDT: finding page with a given value in "extra"-property?

Post by emgaron »

I should have asked this question earlier, 'cause shortly after hitting "Submit", I had a brainwave... ;) Maybe I'm thinking too complicated here - it may well be that Navigator with a suitable template is fully capable of solving the problem I'm trying to solve, so I'll try that first...
emgaron
Forum Members
Forum Members
Posts: 25
Joined: Tue Jul 10, 2012 6:52 am

Re: UDT: finding page with a given value in "extra"-property?

Post by emgaron »

Ok, I can definitely solve my original problem (creating a language selector on a multilingual site based on "UIDs" in the extra3-property of the pages) by simply using Navigator - good thing I finally realised that a language selector in the end is also a sort of navigation... ;D
I'm planning to do a write-up in a separate post in the next couple of days, where I want to outline several solutions for this problem that I have tried over the past period.

As the original problem is solved, I'll mark this thread as solved. However, if somebody feels inclined to outline how searching properties throughout the page tree can be done within a UDT and without Navigator, I'd still be curious - and grateful!
Post Reply

Return to “CMSMS Core”