Hello
It should be easy if you use 2 templates,
- because you display the same item in different ways
using multiple templates that use different HTML and different fields
Lets say you item type is called "Download" (or "Article" or "Car")
- and for "Download" type (in the backend TYPE configuration form) you have selected template:
"download_tmpl" template
if you want to show current item in a different way
then
1. you can
create 1 more template in the backend template manager:
"download_tmpl_basic" template
2. Edit "ITEM LAYOUT" of the new template,
and
only add some fields, e.g. only add file field in the
3. Edit file
item(_html5).php of your normal template "
download_tmpl" in backend template manager
- and click
copy default code button to get the default PHP code
4. Find the place that you want to link to the other view:
Code:
$url = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
$url = $url . (strstr($url, '?') ? '&' : '?') . 'ilayout=download_tmpl_basic';
$escaped_url = htmlspecialchars( $url, ENT_QUOTES, 'UTF-8' );
echo '<a href="' . $escaped_url . '">' . $item->titme. '</a>';
NOTICE that we added to the URL so that you link to the display of the item with the new template:
?ilayout=download_tmpl_basic
or
&ilayout=download_tmpl_basic