News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

Redirect after deleting a file

Started by RMDsign, 23.02.2015 12:58:49

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RMDsign

Hi,

another question... ;)

After deleting a file from the frontend category-view, a redirect to the "All Downloads"-view take place. Can I change this, that the user stay in his category? Or can I change the layout of this view? I cant find them under layouts. Maybe I'am blind... yet again.

Regards, Ralph
  •  

ColinM

Hi
Just to be clear
Were you deleting a file ( red X button) or a Download (delete button)??

I think you mean Deleting an entire Download.

Doing that does take you back to List All Downloads, which really means List All Downloads for which User has View Access Level.

This is presently fixed in the code.  It would need a new Config or User Groups option.  So I have moved this thread to Suggestions
Colin
Colin M
  •  

RMDsign

Yes... I mean deleting an entire download. THX for moving to suggestions! But where can I change the layout for the all downloads list view? I cant find it in the layout-section. Or is it only in the code components/com_jdownloads/views/downloads/tmpl/default.php?
  •  

ColinM

The main body uses the active layout in Downloads Details such as Standard Details Layout v2.5 - Full Info. Plese remember to do a Save As Copy before changing the 'default' one.  Tthe header and subheader come from the active Files layout.

Colin
Colin M
  •  

RMDsign

Thx! I have placed a redirect in the default.php:

// ==========================================
    // VIEW THE BUILDED OUTPUT
    // ==========================================

    if ( !$jlistConfig['offline'] ) {
            // echo $html;
            // Do a redirect instead
         $app->redirect(JRoute::_(JURI::root().'index.php?option=com_jdownloads&view=category&catid=2&Itemid=-1'));
    } else {

After deleting an entire download, the redirect brings me to category 2. Unfortunately I have not yet managed to grab the current category.  :'(

Regards, Ralph
  •  

ColinM

Hi
You might like to consider getting the output of javascript function history.go(-1)

I have used something like below to show a button to go back to previous page
<input value="Back" onclick="history.go(-1)" class="jd_back_button2A jorange" type="button">

and links like
<a href="javascript:history.go(-1)">Go back</a>

However it would probably need a form with Get/Post or maybe a jQuery call

Colin
Colin M
  •  

karencho

Hello,

How do we make the user to stay on the current category instead of redirecting to all downloads list page after deleting a file from front end? 
Could you please tell us exactly where do we need to add this code? 


jDownloads Version 3.2.46
Joomla! 3.6.4

Thank you
KG
  •  

ColinM

Hi
In jD a Download consists of many items such as a description, previews and the like together with the actual file that is downloadable.
So do you mean deleting the file associated with a Download or deleting the entire Download?
Colin
Colin M
  •  

karencho

#8
Hi Colin,

Thank you for getting back to me.

I am talking about deleting the entire download.

After deleting the entire download from the front end it redirects the user to the All Downloads List page.
We want the user to stay in the same category.

please see the attached file


Thank you

[gelöscht durch Administrator]
  •  

ColinM

Ok
Will need to look further into this to examine possibilities.
Colin
Colin M
  •  

karencho

Hi,

I managed to redirect the user to the previous category automatically by using JavaScript

if ( !$jlistConfig['offline'] ) {
// echo $html;
echo '<script>history.go(-2);</script>';



But I don't think this is good fix.
  •  

ColinM

Hi
Where did you place the code?
Have discussed with Arno the possibility of a configurable solution - it would need quite some code to make it both flexible and robust.YTour solution is good for your purposes but beware on updates.
Colin
Colin M
  •