GetSimple Support Forum
page parent selector - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: page parent selector (/showthread.php?tid=4535)



page parent selector - scorche - 2013-03-27

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


RE: page parent selector - shawn_a - 2013-03-27

What exactly are you trying to do? You can grab the parents details from $pagesArray


RE: page parent selector - scorche - 2013-03-27

(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.


RE: page parent selector - shawn_a - 2013-03-27

Which function would that be? You can loop the page cache fairly quickly


RE: page parent selector - scorche - 2013-03-28

(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


RE: page parent selector - scorche - 2013-03-28

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++;
                            }
                        } 



RE: page parent selector - shawn_a - 2013-03-28

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.