Posts: 10
Threads: 3
Joined: Mar 2013
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
Posts: 6,266
Threads: 181
Joined: Sep 2011
What exactly are you trying to do? You can grab the parents details from $pagesArray
Posts: 10
Threads: 3
Joined: Mar 2013
(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.
Posts: 6,266
Threads: 181
Joined: Sep 2011
Which function would that be? You can loop the page cache fairly quickly
Posts: 10
Threads: 3
Joined: Mar 2013
2013-03-28, 02:22:33
(This post was last modified: 2013-03-28, 02:22:50 by scorche.)
(2013-03-27, 09:41:13)shawn_a Wrote: Which function would that be? You can loop the page cache fairly quickly
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
Posts: 10
Threads: 3
Joined: Mar 2013
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++;
}
}
Posts: 6,266
Threads: 181
Joined: Sep 2011
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.