GetSimple Support Forum

Full Version: page parent selector
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
is it possible to do any of these fairly easily with the parent selector?

- use the name in dropdown, not the slug
- restrict available items
- only if the item is in menu
- or using custom field
What exactly are you trying to do? You can grab the parents details from $pagesArray
(2013-03-27, 04:22:20)shawn_a Wrote: [ -> ]What exactly are you trying to do? You can grab the parents details from $pagesArray

I'm planing on having a lot of pages, most of which will be assigned to one of 5 parent items. Using the default function, I get a huge list of items, making it cumbersome to go through and select

Using the page title instead of the slug (while I know there are compelling reasons for using slugs) would look a little frendlier.
Which function would that be? You can loop the page cache fairly quickly
(2013-03-27, 09:41:13)shawn_a Wrote: [ -> ]Which function would that be? You can loop the page cache fairly quickly

[attachment=149]

I'm not sure if we're talking about the same thing, I'd just like to select which pages can have items assigned as children. The pages that have children use a different template, so I might be able to sort them based on the template, but I don't want to hack the core if I don't have to
I ended up just editing the edit.php page

added
Code:
if ($page['template'] == 'links.php'){
at 169 and the closing tag at 180[/quote]

PHP Code:
                        foreach ($pagesArray as $page) {
                            if (
$page['template'] == 'links.php'){
                                if (
$page['parent'] != '') { 
                                    
$parentdata getXML(GSDATAPAGESPATH $page['parent'] .'.xml');
                                    
$parentTitle $parentdata->title;
                                    
$sort $parentTitle .' '$page['title'];
                                } else {
                                    
$sort $page['title'];
                                }
                                
$page array_merge($page, array('sort' => $sort));
                                
$pagesArray_tmp[$count] = $page;
                                
$count++;
                            }
                        } 
There is no function you have to loop the pagesArray yourself and check for parents. Of course if you are trying to do this bottom up it might be complicated and we have not added anything to easily do adjacency lists.