Disable one of the views (General)

by Michael Ben-Nes ⌂ @, Israel, Thursday, March 05, 2009, 20:53 (5531 days ago)

Hi,

I wish to disable one of the views (table), is it possible through the configuration?
Or I should just forcefully overwrite in the code one of the GET variables?

Thanks for the great forum.

Disable one of the views

by Auge, Friday, March 06, 2009, 12:13 (5530 days ago) @ Michael Ben-Nes

Hello

I wish to disable one of the views (table), is it possible through the configuration?
Or I should just forcefully overwrite in the code one of the GET variables?

In the version 1.x that was possible in the (advanced?) forum settings (so yes, it should be possible in the configuration). I can't believe that this is not possible in the 2.x branch.

Tschö, Auge

Disable one of the views

by Michael Ben-Nes ⌂ @, Israel, Sunday, March 08, 2009, 09:40 (5528 days ago) @ Auge

Hi, Auge

Actually I couldn't find such option in the settings

Avatar

Disable one of the views

by Alex ⌂, Saturday, March 07, 2009, 10:03 (5529 days ago) @ Michael Ben-Nes

I wish to disable one of the views (table), is it possible through the configuration?

From version 2 on the "views" are just a template issue (both views use the same back-end). The easiest way to deactivate the table view would be removing the link to toggle between the views (templates/default/subtemplates/subnavigation_2.tpl.inc: search for {#table_view#}). Additional, you could modify includes/index.inc.php in order to prevent requests for the table view:

replace ...

if($user_view==1) $smarty->assign('subtemplate','index_table.tpl.inc');
else $smarty->assign('subtemplate','index.tpl.inc');

... by ...

$smarty->assign('subtemplate','index.tpl.inc');

Alex

Disable one of the views

by Michael Ben-Nes ⌂ @, Israel, Sunday, March 08, 2009, 09:44 (5528 days ago) @ Alex

Thanks Alex,

I did something slightly different. Basically because I was not aware of your solution then.

in main tpl I changed:

{if $subtemplate}
{include file="$template/subtemplates/$subtemplate"}
{else}
{$content|default:""}
{/if}

To:

{if $subtemplate=="index_table.tpl.inc"}
{include file="$template/subtemplates/index.tpl.inc"}
{elseif $subtemplate}
{include file="$template/subtemplates/$subtemplate"}
{else}
{$content|default:""}
{/if}

RSS Feed of thread