OS Property support center

Default View: List View

  • Johnny Norton
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 7 months ago #18513 by Johnny Norton
Default View: List View was created by Johnny Norton
Hi.

Is there a way to set the default view to list view instead of grid view? I actually don't need the grid view at all for this project.

Thanks

J.

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #18516 by Mr. Dam
Replied by Mr. Dam on topic Re: Default View: List View
Hi,
There are no configuration way to set the list view is default layout. But you can edit in the source code.
Please open file components > com_osproperty > classes > listing.php
Function : listProperties($option,$rows,$pageNav,$lists,$filterParams,$configs)
Find this code :
if($view_type_cookie == 1){
$body = $tpl->fetch("listing.html.tpl.php");
}elseif($view_type_cookie == 2){
$body = $tpl->fetch("map.html.tpl.php");
}else{
$body = $tpl->fetch("grid.html.tpl.php");
}

Replace by :
if($view_type_cookie == 3){
$body = $tpl->fetch("grid.html.tpl.php");
}elseif($view_type_cookie == 2){
$body = $tpl->fetch("map.html.tpl.php");
}else{
$body = $tpl->fetch("listing.html.tpl.php");
}

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #18531 by kalesh.suby
Replied by kalesh.suby on topic Re: Default View: List View
Instead of replacing the grid view, how to make the DEFAULT view as list view.

In other words, when property list page loads, the default view should be list view and not grid view.

Thanks

Please Log in or Create an account to join the conversation.

  • Johnny Norton
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 7 months ago #18538 by Johnny Norton
Replied by Johnny Norton on topic Re: Default View: List View
Hi.
I couldn't find that code in listing.php but I did find a similar code in listing.html.php
I changed the code below and it seems to have worked.

Thanks.

}

if($view_type_cookie == 1){
$body = $tpl->fetch("listing.html.tpl.php");
}else{
$body = $tpl->fetch("grid.html.tpl.php");
}
echo $body;
}

}

if($view_type_cookie == 1){
$body = $tpl->fetch("grid.html.tpl.php");
}else{
$body = $tpl->fetch("listing.html.tpl.php");
}
echo $body;
}

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #18539 by Mr. Dam
Replied by Mr. Dam on topic Re: Default View: List View
Sorry, my fault. It's listing.html.php
You are great :)
Thanks
Dam

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamNguyen Phu Quan