rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: ~GeeS~ on August 26, 2006, 01:02:38 AM

Title: Diff Template (=alternative template) Proposal
Post by: ~GeeS~ on August 26, 2006, 01:02:38 AM
Does anybody make use of the diff template function?
I'm starting to redesign some templates and want to use this functionality. Am i right, that when i want to apply a different template other than the hfs.tpl to certain folders, i have to enter a different code in the window which pops up when i select this folders. Is there then still interaction with the hfs.tpl code? I guess not.
If i am wrong, could somebody please explain this function (i searched the boards, but could not find the info). Thx!
Edit:
Meanwhile i got the picture: Code from the pop up window is applied and inherited to subdirectories. But...when i entered a complete template like "clean[EN].tpl from chionsas" it worked, except that the different style was not applied! Still the style from hfs.tpl was valid. Is this a bug?
Proposal:
Is it possible to implement, instead of copy/pasting code to the popup window, entering the file name for the alternative code, like hfs_jpg.tpl, hfs_clean.tpl, hfs_1 ... etc. These alternative tpl files would reside in the same directory as the default hfs.tpl and applied instead of hfs_default. This would increase usability a lot.
______
~GeeS~
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on August 26, 2006, 05:35:14 PM
when i entered a complete template like "clean[EN].tpl from chionsas" it worked, except that the different style was not applied! Still the style from hfs.tpl was valid. Is this a bug?
the [style] section is handled as any other. you can check it by doing "view source" in your browser.

Quote
Is it possible to implement, instead of copy/pasting code to the popup window, entering the file name for the alternative code, like hfs_jpg.tpl, hfs_clean.tpl, hfs_1 ... etc.
there is an undocumented feature, that works for sure in real folders.
just put the template in a file called hfs.diff.tpl inside the folder you want to customize.
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on August 26, 2006, 07:59:36 PM
anyway, i think your FR is interesting, and i will implement it.

but i also noticed there is a bug in difftemplate feature. it doesn't apply to some sections, like [up]. it will require some internal change to fix this. :(
Title: Re: Diff Template (=alternative template) Proposal
Post by: ~GeeS~ on August 27, 2006, 01:18:39 AM
Great! Thanks alot!!!  :)
Title: Re: Diff Template (=alternative template) Proposal
Post by: TCube on August 09, 2007, 12:58:11 AM
Hello,
Just moved to 2.2a (124) and haven't seen this requested feature yet. Is it on ?
TCube

Edit : arrgggg .... not yet  ??? [new] per user diff-tpl (apply both folder and user diff-tpl.s, and let the user decide priority, default:user,folder)
Title: Re: Diff Template (=alternative template) Proposal
Post by: bacter on September 11, 2007, 01:23:53 PM
proposal for the implementation:

Now, diff templates is handled in two ways: a section [whateveritis] is stored with the folder caracteristics. A whole template is placed outside, in the folder as hfs.diff.tpl

I think with a third mode to handle the content of the diff template window, we could have some advantages:
A: No need to copy the same template in diferent folders, one copy in any accessible directory would be enough.
B: It would be possible to realize the often demanded 'per user template'!

how?

The third form to handle the diff template text could be something like  "#use or #include

Sintaxis:  #use path/filname ...(#use ..)

Examples:  #use /sys/bigimage.tpl                     (for full or partial template)
                  #use /sys/templates/snd%user%.tpl  (should exist: snd.tpl (for @anonymous) as sndusername.tpl for each user with access rights to the folder, or even it would be possible search first for sndusername.tpl, and if it doesn't exist, use snd.tpl


Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on September 11, 2007, 03:56:56 PM
Just moved to 2.2a (124) and haven't seen this requested feature yet. Is it on ?

no, i forgot to put it in the to-do-list. i did it now :)

Quote
Edit : arrgggg .... not yet  ??? [new] per user diff-tpl (apply both folder and user diff-tpl.s, and let the user decide priority, default:user,folder)

that's another feature, unrelated
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on September 11, 2007, 04:05:32 PM
Examples:  #use /sys/bigimage.tpl                     (for full or partial template)
                  #use /sys/templates/snd%user%.tpl  (should exist: snd.tpl (for @anonymous) as sndusername.tpl for each user with access rights to the folder, or even it would be possible search first for sndusername.tpl, and if it doesn't exist, use snd.tpl

yes, this would fit both needs...
in to-do
Title: Re: Diff Template (=alternative template) Proposal
Post by: Alons0 on September 12, 2007, 01:56:30 PM
Is it possible using two templates (two languages)? I wanna have site in two languages ::)
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on September 13, 2007, 03:35:57 AM
i will introduce a %lang% symbol that will be the one reported by the browser
Title: Re: Diff Template (=alternative template) Proposal
Post by: Alons0 on September 13, 2007, 07:49:14 AM
i will introduce a %lang% symbol that will be the one reported by the browser
And maybe we'll have section [lang]?
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on September 13, 2007, 02:22:37 PM
[lang] ? for what?
you shot too fast.
does %item-name% have a [item-name] ?
Title: Re: Diff Template (=alternative template) Proposal
Post by: Alons0 on September 13, 2007, 02:46:03 PM
Ummm sorry. Please tell me how %lang% will work (changing the languages) ::) :-\
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on September 14, 2007, 02:14:18 AM
by letting you specify the file of the template with the %lang% in the file name
Title: Re: Diff Template (=alternative template) Proposal
Post by: Alons0 on September 14, 2007, 03:54:50 AM
by letting you specify the file of the template with the %lang% in the file name
ok it'll be great ;D
Title: Re: Diff Template (=alternative template) Proposal
Post by: bacter on September 16, 2007, 02:18:13 PM
Very good idea the %lang% symbol !

I've tried to use java to get the language of the browser/system, but it will produce much overhead having different languages in the same template.

But the %lang% poses some problems. Supose than %lang% can be something like 'de','en','es','fr','it' and so on. Could we then use something like [sym-tblde],[sym-tblit] with %symtbl%lang%% ??
In all case, y think %lang% will need in the hfs.ini a list of our supported languages, and in the case that the language isn't in this list, %lang% should be empty, in order to use our default language.

Many thanks, rejetto, for your great work!
Molte grazie per il tuo lavoro eccellente !
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on September 21, 2007, 02:12:59 PM
i get the idea.
such thing is possible, but i'm not sure it will be done, i have to consider how this will affect the rest of the code.
Title: Re: Diff Template (=alternative template) Proposal
Post by: Foggy on September 22, 2007, 02:48:03 AM
how about you create a new template file for each language and have them called <language>.diff.tpl and then when you first connect to hfs, hfs requests the client lnguage and if a templae matching the language is found it is then used otherwise use the one set in the editor.
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on September 22, 2007, 04:48:35 AM
this was already accepted few posts before
Title: Re: Diff Template (=alternative template) Proposal
Post by: TCube on November 29, 2007, 05:41:27 AM
So now, U all talked about AlOnso's crap comment about %lang% (http://xs121.xs.to/xs121/07484/whistling.gif) (http://xs.to)

Back to diff. temp. please  ... rejetto, times are tough ... how are things going for diff. temp ?
Merci
Tcube
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on November 29, 2007, 06:50:52 AM
how about you create a new template file for each language and have them called <language>.diff.tpl and then when you first connect to hfs, hfs requests the client lnguage and if a templae matching the language is found it is then used otherwise use the one set in the editor.

re-reading your proposal, i misread, it is different than others.
but now that we have macros, i think it is possible to make it by putting this at the end of the template
{{load|%lang%.diff.tpl}}
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on November 29, 2007, 06:52:14 AM
Back to diff. temp. please  ... rejetto, times are tough ... how are things going for diff. temp ?

what are you referring to?
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on November 29, 2007, 08:57:24 AM
Mars, I hope there was nothing I was supposed to answer to in your post, because i didn't get any point.

Anyway, consider that starting with "sym-" is no more mandatory.
Title: Re: Diff Template (=alternative template) Proposal
Post by: TCube on November 29, 2007, 10:13:24 AM
Not sure which side is getting silly  ;)  anyway, I 'm refering to this 1st post 1 page :

Quote
Proposal:
Is it possible to implement, instead of copy/pasting code to the popup window, entering the file name for the alternative code, like hfs_jpg.tpl, hfs_clean.tpl, hfs_1 ... etc. These alternative tpl files would reside in the same directory as the default hfs.tpl and applied instead of hfs_default. This would increase usability a lot.
Title: Re: Diff Template (=alternative template) Proposal
Post by: rejetto on November 29, 2007, 10:25:49 AM
sorry, i probably considered implicit:
in the popup dialog just type {{load|hfs_jpg.tpl}}
or any other file name
you could even BUILD the file name (by other commands) instead of typing it ;D
Title: Re: Diff Template (=alternative template) Proposal
Post by: TCube on November 29, 2007, 11:19:01 AM
No harm done : I moved to built 146 couple of days ago ... don't know shit yet about macros I'll read the wiki  ;D  merci Rejetto