News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

layout without some tabs

Started by anja, 21.07.2016 13:36:24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

anja

Hi
I want to use the download details layout with tabs, but without the tab MP3. Is it possible to display only some of tabs?

Anja
  •  

Arno

Hi,
what is when you removed this part from your layout?
{tab mp3}
<div>{mp3_player}</div>
<div>{mp3_id3_tag}</div>
{tab mp3 end}
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

anja

Hi,
Title of the tab MP3 is displayed, but content is from  the last open tab.

Anja
  •  

ColinM

Hi
As you have found out removing the "tab pairs" does not remove the actual tab.  So I have edited the code as I thought it would be useful

Attached, in a zip,  is a new file default.php which should replace the existing file in directory
<your Site>/components/com_jdownloads/views/download/tmpl
Before replacing I suggest you rename the existing file to say defaultOrig.php (have also incude a copy in the attached zip)
If you are uncertain about doing this 'update' then send me, by PM, super user login details.  And also backup your site!!

This modified file checks the current Download Details layout to see if the start tab of a tab pair such as {tab mp3} is present.  One needs edit the layout to delete or comment out from {tab mp3} to just after {tab mp3 end} and all code between the tab pair from the relevant Downloads Detail Layout then the associated Tab, eg Media, will not appear in the front end.

That means editing the layout as described below.  But I have also included an xml exported layout which you could import from the layouts control page.

Please note that it will be up to Arno if this feature is to be made permanent.
I think you already know how to edit the layout but the noes below added for completeness

Notes on editing the layout

As a preliminary step please ensure that the "Use WYSIWYG-editor for layouts?" field in the Configuration - Backend tab is set to No so it appears as the raw HTML format in a simple expandable text box with a scroll bar.

In the backend go to Layouts - Download Details and click on layout "Example Details Layout with Tabs v3.2".

Next make a copy by clicking on the 'Save as Copy' button. There are several reasons for making a copy. One is that if you make an error you can revert back very quickly.  The other is that if you edit one of the Default Layouts then it is possible that during an update a new version overwrites it so that all your edits are lost!

The new layout will then have a name such as "Example Details Layout with Tabs v3.2(2)"

Ensure you have the Edit Layout tab, not Edit Header and Footer Area tab.
In the Layout box showing the layout 'code' scroll down until you see
<div class="jd_clear"> </div>
{tab pics end}
{tab mp3}
<div>{mp3_player}</div>
<div>{mp3_id3_tag}</div>
{tab mp3 end}
{tab data}
     <div class="jd_fields_wrapper {featured_detail_class}"  style="">
           <div class="jd_fields_caption" style="">{details_block_title}</div>


Now delete the lines starting at {tab mp3} and ending at {tab mp3 end} so that it appears as
<div class="jd_clear"> </div>
{tab pics end}
{tab data}
     <div class="jd_fields_wrapper {featured_detail_class}"  style="">
           <div class="jd_fields_caption" style="">{details_block_title}</div>

Then Save & Close which takes you back to the Download Details list.


Colin

[gelöscht durch Administrator]
Colin M
  •  

Arno

#4
@Colin,
this was a bug and i have it fixed fast. 
Please use the unzipped file below and copy it over the original file in:
<your Site>/components/com_jdownloads/views/download/tmpl/

Any corrections in the (original) layout are afterwards not more required.

[Fixed in 3.2.46]

[gelöscht durch Administrator]
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

ColinM

@Arno
I think the layout does need modification to remove the 'tab pair',  such as {tab mp3} and {tab mp3 end}, and the intervening code. so that the actual tab in the Front End, in this case Media, does not appear.
The two pics below illustrate.
Colin

[gelöscht durch Administrator]
Colin M
  •  

anja

Thank you for the quick solution! It works very well. :)

Anja
  •  

Arno

Quote from: ColinM on 23.07.2016 10:32:27
@Arno
I think the layout does need modification to remove the 'tab pair',  such as {tab mp3} and {tab mp3 end}, and the intervening code. so that the actual tab in the Front End, in this case Media, does not appear.
Why? Please check my last version above and try it self. The media tab is not longer displayed.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

ColinM

@Arno
I have used your latest as attached above.  It only differes from the one I did where you used
if (strpos($body, '{tab mp3}') !== false){
I used the  stripos function
With the latest file the media tab does appear even if there are no preview files in the Download
Colin
Colin M
  •