Jump to content

Changing parent of page - wrong order


vxda
 Share

Recommended Posts

Hi, on my website i have upcoming posts/pages added by users.
When i choose to show it on homepage i change page parent to different one.
When im doing it from the page level so :
page_i_want_to_move -> edit -> settings -> Parent

Page is changing parent but it never goes at the top of the site, but somewehere in the middle, mby couple positions form the top.
Parent is set to manual drag-and-drop.
 

I need to adjust the page in new parent by manual drag and dropping in the page tree.

Any idea why this happends ?
Thanks.

Link to comment
Share on other sites

Hi, on my website i have upcoming posts/pages added by users.

When i choose to show it on homepage i change page parent to different one......

Not an answer to your question but curious why you are doing it this way (manually changing parent)...This sounds like a 'featured page' scenario. Why not use a checkbox instead? Or a page field?  :undecided:

Link to comment
Share on other sites

I think he is moving pages in the backend, so that articles are featured on the homepage. But the moved page is not sorted to the top, but somewhere a few pages below. 

Yes this is the case.

Not an answer to your question but curious why you are doing it this way (manually changing parent)...This sounds like a 'featured page' scenario. Why not use a checkbox instead? Or a page field?  :undecided:

There is a bag of "send by users" pages, when article is good im moving it to designed destination ie,:

Post is about sport so i move it to

pages -> categories -> sport

On homepage im displaying all new posts that have been moved from bag of "send by users" pages.

example: http://hejtuje.com/hejty/technologie/

the post with facebook app on iphone, as u see in this list its like 3rd in a row

here one homepage  http://hejtuje.com/ is first ( dont count top hejt cause its allways first).

Link to comment
Share on other sites

for a home page its a bit complicated, dunno if it tells you anything. Problem is not with home page but category pages wich have :
$hejts = $page->children('template=hejt, sort=-sort, limit=25');

$allText = $pages->find("template=hejt, text_yes=1, sort=-created");
$text = "";
if ($page->id == 1) {
	$textModulo = 5;
	if ($pages->get(1)->nr_f) $textModulo = $pages->get(1)->nr_f;

	$hejts = $pages->find('has_parent=1020, template=hejt, sort=-modified, text_yes=0');
	$count=1;
	$afterArr = new pageArray();
	foreach ($hejts as $item) {
		if ($count % $textModulo == 0) {
			$afterArr->push($item);
		}
		$count++;
	}
	$i = 0;
	foreach ($allText as $textPage) {
		if ($i < count($afterArr)) {
			$hejts = $hejts->insertAfter($textPage, $afterArr[$i]);
			$i++;
		}
	}
	$limit = 25;
	$start = ($input->pageNum - 1) * $limit;
	$total = $hejts->count();
	$topHejt = $pages->get(1)->page_f_2;
	if($topHejt->id != 1561) {
		$hejts->prepend($topHejt);
		$hejts->unique();
	}

	$hejts = $hejts->find("start=$start, limit=$limit");
}else if($page->id == 1286) {
	$hejts = $page->children('template=hejt, sort=-created, limit=25');
	// $pagerMarkup = $hejts->renderPager();
}else{
//THIS IS LIST THAT IS DISPLAYED IN WRONG ORDER
	$hejts = $page->children('template=hejt, sort=-sort, limit=25');
}
if($page->id == 1562) {
	$hejts = $pages->find('has_parent=1020, template=hejt, sort=-created, text_yes=0, top_hejt=1');
}
Link to comment
Share on other sites

Yes, they all have same template, template="hejt".I will check if there is some pattern in this chaos when il get home.
Another thing is that i have also a possibility of changing parent thru small module iwht lazyCron i made. Its simple:
Choose date and parent on wich this page will me moved. When its moved by lazycron it all seam to work oO. Tho i will test it again to be sure.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...