Jump to content

Recommended Posts

Posted

Hi,

I'm using a pagefield to hold a list of pages, and asmselect for input. The field holds the pages to show in the main navigation. however, the order of the pages is not saved, always reverting to the same order when I save.

I can add and remove pages, it's the order that gets messed up :-/

any ideas? I'm using 2.5.24 and it's the same with PageListSelectMultiple ..

best,

tomas

Posted

This is how it normally works

Go to the parent page

post-756-0-23408500-1427840961_thumb.png

Edit the parent page

post-756-0-75745800-1427840976_thumb.png

Choose your sort order

post-756-0-36224200-1427840992_thumb.png

If this is not working please let us know

  • Like 2
Posted

Sorry, I guess I was not clear.

I have a field 'main_menu_pages', which is a Page fieldtype with the asmselect for input field type.

I use this field in a "settings" page to specify the pages and order of entries in the main site navigation.

the problem is that the order of the pages is not saved, but reverts when I save the "settings" page.

now I've realised this, it works on my local "uniform server" where I develop. but it does not after I have uploaded to my testing host (for confirmation by the client before I replace her site).

the selected pages are saved correctly, but the order is not.

unfortunately I cannot log in to the hosting cpanel right now so I can't post versions etc from there. But I'm not sure how to go about debugging this. I can provide access if someone is interested in looking at it.

Posted

Thanks for clarifying.

  now I've realised this, it works on my local "uniform server" where I develop. but it does not after I have uploaded to my testing host (for confirmation by the client before I replace her site).

 

the selected pages are saved correctly, but the order is not.

So your local development environment is a Windows based WAMP setup, correct?  What versions of PW, PHP, MySQL and Windows?  What OS,  to include version numbers are on your online hosting solution? 

Posted

I've not seen any errors :-/

Locally, I'm running "Uniform server" UniServer XI 11.7.2, php 5.4.39, mysql 5.5.42

My host is running 5.5.40-MariaDB-cll-lve , PHP 5.4.35

Posted

One thing to keep in mind, I believe there can be some differences (where sorting is involved) between MariaDB and MySQL.  

  • Like 1
Posted

The database looks to be updated correctly when I rearrange the pages and save, but it seems this order is not reflected when the field is loaded, both in admin, and in the frontend when I render the navigation.

Posted

 Just to make it 100% clear. This is my page field

551c359867674.png

The page IDs are as follows:

551c360144742.png

And the database is as expected:

551c362fc393f.png

So far so good.

Now I rearrange the pages, say I move "Kalender" to the top. Then save. In the admin, it looks like it didn't work, when the saved page is loaded again, the pages are ordered exactly as in the first image. With "Kalender" in the bottom, it does not help to reload the page. However, the database IS updated:

551c36bf26294.png

But ... the frontend still receives the pages in the same order as in the admin. Effectively making me unable to sort. I'm not sure what to look at now, I've looked a bit at the FieldtypePage module, but it's a bit heavy for my PHP experience :-/

Posted

Hi lindquist,

How is your selector to get the pages for the frontend? Do you order the pages by sort, e.g. add "sort=sort" in your selector.

Posted

Hi,

it's essentially these few lines in my template

$settings = $pages->get('/site-indstillinger/');
$menu_pages = $settings->main_menu_pages;
foreach ($menu_pages as $p) {
    // echo page links
}

Posted

Does it make any difference in your frontend if you try this:

$menu_pages = $settings->main_menu_pages->sort("sort");
  • Like 1
Posted

Does it make any difference in your frontend if you try this:

$menu_pages = $settings->main_menu_pages->sort("sort");

That does not make a difference

  • 4 months later...
Posted

I don't have any help to contribute, but unfortunately I have also been stuck with the issue for some time now (since at least 2.3). Still experiencing it (only on my remote host, not on local dev machine). Just thought I should add my two cents, maybe the issue isn't common but this also is not a one off. 

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
  • Recently Browsing   0 members

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