rejetto forum

bug or not bug topic to rejetto

Mars · 6 · 3175

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2055
    • View Profile
By consulting the documentation on wiki I found this

Embedding pages inside a template
If you put a whole HTML page under [a_name_you_choose] section, then it will be available at

http://YOUR_ADDRESS/~a_name_you_choose


Having tested, this is functional but not recursive in subfolders as it is possible with ~login: little bug

The risk is to have access for a user to a section [mysection] which we would like to keep  hidden. To by-pass the problem my solution is to create in the root a named virtual file "~mysection" and to put it hidden

Exepté for sections predefined in hfs, it would be possible that are effectively visible only sections such as [~mysection] and in all subfolders as with ~login?
If a name of section begins by ~, then it will be visible by the url only on this condition.

Modification possible in main.pas

 // provide access to any [section] in the tpl, included [progress]
  if (f = rootFile) and (urlCmd > '') then
    begin
    s:='~' +copy(urlCmd,2,MAXINT);
    if tpl.sectionExist(s) then
      begin
      getPage(s, data);
      exit;
      end;
    end;

thanks.



Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
perhaps when rejetto will implement the third form to define diff-templates as in todo list and treated in http://www.rejetto.com/forum/index.php?topic=3681.0 , you could have different templates in a hidden folder and you don't need to blow up your main template with many [sym-..]'s.
your computer has no brain - use your own !


Offline Foggy

  • Tireless poster
  • ****
    • Posts: 806
    • View Profile
by memory you cannot show files in the ~ sections because they are not a folder and have no files to display, so what is the point of this ~mysection?

And also I would like the user created sections to be recursive, if possible


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13438
    • View Profile
Having tested, this is functional but not recursive in subfolders as it is possible with ~login: little bug

it is not recursive by design. it works exactly as documented. thus it is not a bug.

Quote
The risk is to have access for a user to a section [mysection] which we would like to keep  hidden. To by-pass the problem my solution is to create in the root a named virtual file "~mysection" and to put it hidden

nice workaround.
but if anyone has such need, i could make [sections] optionally invisible, this way
[section|hidden]
but only if it is really useful.

Quote
Exepté for sections predefined in hfs, it would be possible that are effectively visible only sections such as [~mysection] and in all subfolders as with ~login?
If a name of section begins by ~, then it will be visible by the url only on this condition.

i guess this would break compatibility with most recent templates.
anyway, if such thing is needed, i could introduce an option like
[section|visible]
and all those who don't have it, are not accessible.

but what to do it depends on what people wants.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2055
    • View Profile
Sorry dear Rejetto
It seems to me simpler to identify a section as visible by preceding its name of one ~ ([~section]) that by a VISIBLE option, this in agreement with the fact that every visible section  can be already called by URL  http://........./~section

Among all the templates which I was able to study I did not find track of the use of this type of URL for sections others than those predefined in hfs, thus no risk of disrupting templates existing by my proposition

The usage of ~ seems to me a reference way for the special VISIBLE said use of sections, and simpler to understand for a greenhorn who discovers the usage of templates

**********************************************
Another remark concerning sections:

 If the one of her is in several copies
.
.
[test]
test1
.
.
[test]
test2
.
.

And what I use the url:  http://..../~test the shown resultat is: test2 on the web page
Only the last section of the same name is recognized the others are simply ignored (trymade with 6 TEST sections, only the last one appeared)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13438
    • View Profile
It seems to me simpler to identify a section as visible by preceding its name of one ~ ([~section]) that by a VISIBLE option,

yes, it's simpler

Quote
Among all the templates which I was able to study I did not find track of the use of this type of URL for sections others than those predefined in hfs, thus no risk of disrupting templates existing by my proposition

i know there are users using this feature.
they would be pissed off by a change.
such a change is not very important, so why bother people.


Quote
Only the last section of the same name is recognized the others are simply ignored (trymade with 6 TEST sections, only the last one appeared)

yes i know.
that's the way it has to be.