Author Topic: loading file list  (Read 1558 times)

0 Members and 1 Guest are viewing this topic.

Offline tdv

  • Occasional poster
  • *
  • Posts: 2
    • View Profile
loading file list
« on: November 24, 2013, 09:38:51 AM »
I was so hoping that this method will work to get the files list, but alas.  :(

Template code:
Code: [Select]
[]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
</head>
<body>
 <div id="FilesContainer"></div>

<script type="text/javascript">
jQuery(document).ready(function()
 {
  $("#FilesContainer").load("%folder%?mode=section&id=FileList.html");
 });
</script>

</body>
</html>

[file=folder=link|private]
<br>%item-url%

[FileList.html]
%list%

May be worth processing a list of files in such (%folder%?mode=section&id=FileList.html) requests?

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: loading file list
« Reply #1 on: November 24, 2013, 03:49:37 PM »
try this

  $("#FilesContainer").load("{.get|url|tpl=list.}");

Offline tdv

  • Occasional poster
  • *
  • Posts: 2
    • View Profile
Re: loading file list
« Reply #2 on: November 24, 2013, 05:06:21 PM »
Maybe {.get item|a|b.}? But unfortunately, it will not work.
jQuery.load send http request via ajax mechanism on the server, and all that I want is to process it according to all rules but from another section to eliminate all unnecessary html code. The result of this query is placed directly in the DIV tag. By the way, thus it is possible build and XML  response

I want to make walking on directories without reloading the page.
« Last Edit: November 24, 2013, 05:53:55 PM by tdv »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: loading file list
« Reply #3 on: December 08, 2013, 07:21:54 PM »
i tried what i suggested, and it works to me.
you can eventually change {.get|url|tpl=list.} with ?tpl=list
the first form is actually translated by the server itself, but the second should always work.
here is an example
$('body').load('?tpl=list')

in HFS 3 i already made a default template where you change folder without reloading the page.
They are not compatible, anyway, but you may eventually get inspiration.