Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Loïc BEL

Set default column set

Hi, I have 2 column sets. I’d like to always set the first one as default column set, instead of use the last selected column set as default.
How can i do ?

5 years, 3 months ago
Stefan van den Dungen Gronovius
Developer

There is not really a way to do this with our GUI.
We set the layout ID as a user preference once a user switches to a specific layout.

So you could use the following snippet that always sets a specific layout as a user preference. You can probably improve a little bit so it does not always run, but I hope you get the idea.

add_action( 'ac/table/list_screen', function ( AC\ListScreen $list_screen ) {
	$layouts = ACP()->layouts( $list_screen );

	$layout_id = '5d12279905d80'; // layout ID can be found in the URL when switching to a specific layout

	if ( $layout = $layouts->get_layout_by_id( $layout_id ) ) {
		$layouts->set_user_preference( $layout );
	}

}, 8 );
5 years, 3 months ago
Fabian Gigler

I just submitted a similar request about column-set order in the interface:

Feature Request: Edit Column-Set Order

I’m not sure if it works like this, but I’m assuming a new user on a new browser would be presented the first column-set by default. If this is how it works currently, then the possibility to sort the column-set order would improve this issue as well.

5 years, 3 months ago

You must be logged in to reply to this topic.