list order by assigned variable

blindmime
@blindmime
4 years ago
772 posts
I'm trying to order a profile list by the order of last page created so the first profile would be the profile with the most recently created page. Here's what I got:

{jrCore_list module="jrPage" order_by="_created desc" template="null" return_keys="_created" limit="1" assign="last_project_created"}
{jrCore_list module="jrProfile" order_by="last_project_created desc" quota_id="6" limit=$limit require_image="profile_image" template="index_core_profile_list.tpl" quota_check=false}

Something's not quite right.
updated by @blindmime: 01/22/21 04:58:01AM
douglas
@douglas
4 years ago
2,790 posts
try this:

order_by="last_project_created numerical_desc"

hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
paul
@paul
4 years ago
4,326 posts
{jrCore_list module="jrPage" order_by="_created desc" template="null" return_keys="_created" limit="1" assign="last_project_created"}
actually returns the 'last_project_created' variable as an array -
{$last_project_created}
	Array (1)
0 => Array (5)
  _created => "1603438512"
  _profile_id => "1"
  _user_id => "1"
  _item_id => "2"
  list_rank => 1
so for the second call you need to extract the _profile_id from the array. As you are only returning one item do this -
{jrCore_list module="jrProfile" search="_profile_id = `$last_project_created.0._profile_id`" require_image="profile_image" template="index_core_profile_list.tpl"}
hth


--
Paul Asher - JR Developer and System Import Specialist

Tags