[Tiki-devel] Displaying integers as Roman numerals (was RE : list-style-type in PHP)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Tiki-devel] Displaying integers as Roman numerals (was RE : list-style-type in PHP)

Cloutier, Philippe (RESSOURCE EXTERNE)
Hi Brendan,
The Smarty part should be trivial. You could see truncate for an example Smarty modifier.

De : Brendan Ferguson [[hidden email]]
Envoyé : 16 février 2017 20:42
À : Tiki developers
Objet : Re: [Tiki-devel] list-style-type in PHP

hmm. ok. I will think about that. Obviously its best to let CSS take care of stuff like that.... but the way in which css does take care of things like that is EXTREMELY limited. For example, it will only do it in a ordered list, which is always list type, (similar to block style) so no inline styling can be accomplished in this way. The numbers are never clickable and additional styling can not be applied, they can not be selected-copied-pasted and there are a number of other restrictions as well, but I think you get the point.

A smarty modifier sounds interesting. I still don't have my head totally around smarty. Let me see if I can figure out how to do something like that. (at this point I dont have a clue)

I did a quick search within the tiki code for something like this, but couldn't find anything. So if its there, someone will need to point out to me where it might be.

Unfortunately, I wont be able to make the meeting, but I do plan on reviewing the recording so I can keep up to date. If i have questions-comments I will bring them up on the dev list.

Thanks for all your help, and for the idea of the smarty modifier. Im looking forward to expressing integers in what ever form suites my fancy.

Brendan



On Thu, Feb 16, 2017 at 11:23 PM, luciash <[hidden email]> wrote:
Ah, right, Smarty modifier sounds good too... I do not remember but
maybe there already exists one?

luci


On 16.2.2017 15:19, Jonny Bradley wrote:
> Again i think it would be better to let CSS do this, then the browser will do all the locale stuff and work better (maybe) in RTL languages etc...
>
> But if that's not an option i think this should be a smarty thing, maybe a modifier? So you would use it in the template like
>
>       {$the_number|convertnum:'upper-roman'}
> or
>       {'3'|convertnum:'upper-roman'}
>
> Then to use it in php directly you would call something smarty_modifier_convertnum() (having asked smarty where it is using loadPlugin).
>
> Sounds suitable?
>
> Maybe come along to the meeting (<a href="https://tiki.org/Roundtable&#43;Meeting&#43;2017&#43;02" rel="noreferrer" target="_blank">https://tiki.org/Roundtable+Meeting+2017+02) and we could discuss it in the second hour?
>
> jonny
>
>
>
>
>> On 16 Feb 2017, at 14:06, Brendan Ferguson <[hidden email]> wrote:
>>
>> ya, I guess I wasnt very clear. Its a php series of php functions (bundeled into a class) that converts integers into strings that represent that integer, using the same scheme as the CSS attribute list-style-type. So ConvertNum(3,'upper-roman') returns 'III' etc. Sorry for the confusion.
>>
>> Brendan
>>
>> On Thu, Feb 16, 2017 at 10:55 PM, luciash <[hidden email]> wrote:
>> I don't think CSS styling a numbered list belongs to the lib/ but maybe we just misunderstood your question - a PHP class (or is it a library?) definitely goes to lib/ or vendor/ if it is part of third party lib... but if it is just a class, a tikilib.php sounds good?
>>
>> luci
>>
>> On 16.2.2017 14:42, Brendan Ferguson wrote:
>>> I don't think php libraries belong in the less folder.
>>>
>>> On Thu, Feb 16, 2017 at 9:34 PM, luciash <[hidden email]> wrote:
>>> Hi!
>>>
>>> Nowhere in the lib/ folder please. Add it to the themes/base_files/less/tiki-wikipages_and_plugins.less and recompile the CSS using php console.php (see php console.php --help for the command params available)
>>>
>>> luci
>>>
>>> On 16.2.2017 2:31, Brendan Ferguson wrote:
>>>> Ive got a php class I am created for the footnotes that styles a number as if one used list-style-type in CSS.
>>>>
>>>> I was wondering if people had an idea where the best place in the lib folder would be the best place to house it.
>>>>
>>>> Brendan
>>>>
>>>>
>>>> ------------------------------------------------------------
>>>> ------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, SlashDot.org!
>>>> http://sdm.link/slashdot
>>>>
>>>> ______________________________
>>>> _________________
>>>> TikiWiki-devel mailing list
>>>>
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ TikiWiki-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, SlashDot.org!
>>> http://sdm.link/slashdot
>>>
>>> ______________________________
>>> _________________
>>> TikiWiki-devel mailing list
>>>
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> TikiWiki-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
>> TikiWiki-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> TikiWiki-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Tiki-devel] Displaying integers as Roman numerals (was RE : list-style-type in PHP)

Dr. Sassafras
Great. I will do that. My first step I was going to take was to try and find a good example, so thanks. 

Brendan

On Feb 17, 2017, at 11:43 AM, Cloutier, Philippe (RESSOURCE EXTERNE) <[hidden email]> wrote:

Hi Brendan,
The Smarty part should be trivial. You could see truncate for an example Smarty modifier.

De : Brendan Ferguson [[hidden email]]
Envoyé : 16 février 2017 20:42
À : Tiki developers
Objet : Re: [Tiki-devel] list-style-type in PHP

hmm. ok. I will think about that. Obviously its best to let CSS take care of stuff like that.... but the way in which css does take care of things like that is EXTREMELY limited. For example, it will only do it in a ordered list, which is always list type, (similar to block style) so no inline styling can be accomplished in this way. The numbers are never clickable and additional styling can not be applied, they can not be selected-copied-pasted and there are a number of other restrictions as well, but I think you get the point.

A smarty modifier sounds interesting. I still don't have my head totally around smarty. Let me see if I can figure out how to do something like that. (at this point I dont have a clue)

I did a quick search within the tiki code for something like this, but couldn't find anything. So if its there, someone will need to point out to me where it might be.

Unfortunately, I wont be able to make the meeting, but I do plan on reviewing the recording so I can keep up to date. If i have questions-comments I will bring them up on the dev list.

Thanks for all your help, and for the idea of the smarty modifier. Im looking forward to expressing integers in what ever form suites my fancy.

Brendan



On Thu, Feb 16, 2017 at 11:23 PM, luciash <[hidden email]> wrote:
Ah, right, Smarty modifier sounds good too... I do not remember but
maybe there already exists one?

luci


On 16.2.2017 15:19, Jonny Bradley wrote:
> Again i think it would be better to let CSS do this, then the browser will do all the locale stuff and work better (maybe) in RTL languages etc...
>
> But if that's not an option i think this should be a smarty thing, maybe a modifier? So you would use it in the template like
>
>       {$the_number|convertnum:'upper-roman'}
> or
>       {'3'|convertnum:'upper-roman'}
>
> Then to use it in php directly you would call something smarty_modifier_convertnum() (having asked smarty where it is using loadPlugin).
>
> Sounds suitable?
>
> Maybe come along to the meeting (https://tiki.org/Roundtable+Meeting+2017+02) and we could discuss it in the second hour?
>
> jonny
>
>
>
>
>> On 16 Feb 2017, at 14:06, Brendan Ferguson <[hidden email]> wrote:
>>
>> ya, I guess I wasnt very clear. Its a php series of php functions (bundeled into a class) that converts integers into strings that represent that integer, using the same scheme as the CSS attribute list-style-type. So ConvertNum(3,'upper-roman') returns 'III' etc. Sorry for the confusion.
>>
>> Brendan
>>
>> On Thu, Feb 16, 2017 at 10:55 PM, luciash <[hidden email]> wrote:
>> I don't think CSS styling a numbered list belongs to the lib/ but maybe we just misunderstood your question - a PHP class (or is it a library?) definitely goes to lib/ or vendor/ if it is part of third party lib... but if it is just a class, a tikilib.php sounds good?
>>
>> luci
>>
>> On 16.2.2017 14:42, Brendan Ferguson wrote:
>>> I don't think php libraries belong in the less folder.
>>>
>>> On Thu, Feb 16, 2017 at 9:34 PM, luciash <[hidden email]> wrote:
>>> Hi!
>>>
>>> Nowhere in the lib/ folder please. Add it to the themes/base_files/less/tiki-wikipages_and_plugins.less and recompile the CSS using php console.php (see php console.php --help for the command params available)
>>>
>>> luci
>>>
>>> On 16.2.2017 2:31, Brendan Ferguson wrote:
>>>> Ive got a php class I am created for the footnotes that styles a number as if one used list-style-type in CSS.
>>>>
>>>> I was wondering if people had an idea where the best place in the lib folder would be the best place to house it.
>>>>
>>>> Brendan
>>>>
>>>>
>>>> ------------------------------------------------------------
>>>> ------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, SlashDot.org!
>>>> http://sdm.link/slashdot
>>>>
>>>> ______________________________
>>>> _________________
>>>> TikiWiki-devel mailing list
>>>>
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ TikiWiki-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, SlashDot.org!
>>> http://sdm.link/slashdot
>>>
>>> ______________________________
>>> _________________
>>> TikiWiki-devel mailing list
>>>
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> TikiWiki-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
>> TikiWiki-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> TikiWiki-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Tiki-devel] Displaying integers as Roman numerals (was RE : list-style-type in PHP)

luciash d' being

btw, all custom Tiki Smarty modifiers (besides of the default Smarty ones) we have available are located in lib/smarty_tiki/modifier.*.php

also remember, they are meant to be used in Smarty tpl files (templates/)

luci


On 17.2.2017 10:05, Dr. Sassafras wrote:
Great. I will do that. My first step I was going to take was to try and find a good example, so thanks. 

Brendan

On Feb 17, 2017, at 11:43 AM, Cloutier, Philippe (RESSOURCE EXTERNE) <[hidden email]> wrote:

Hi Brendan,
The Smarty part should be trivial. You could see truncate for an example Smarty modifier.

De : Brendan Ferguson [[hidden email]]
Envoyé : 16 février 2017 20:42
À : Tiki developers
Objet : Re: [Tiki-devel] list-style-type in PHP

hmm. ok. I will think about that. Obviously its best to let CSS take care of stuff like that.... but the way in which css does take care of things like that is EXTREMELY limited. For example, it will only do it in a ordered list, which is always list type, (similar to block style) so no inline styling can be accomplished in this way. The numbers are never clickable and additional styling can not be applied, they can not be selected-copied-pasted and there are a number of other restrictions as well, but I think you get the point.

A smarty modifier sounds interesting. I still don't have my head totally around smarty. Let me see if I can figure out how to do something like that. (at this point I dont have a clue)

I did a quick search within the tiki code for something like this, but couldn't find anything. So if its there, someone will need to point out to me where it might be.

Unfortunately, I wont be able to make the meeting, but I do plan on reviewing the recording so I can keep up to date. If i have questions-comments I will bring them up on the dev list.

Thanks for all your help, and for the idea of the smarty modifier. Im looking forward to expressing integers in what ever form suites my fancy.

Brendan



On Thu, Feb 16, 2017 at 11:23 PM, luciash <[hidden email]> wrote:
Ah, right, Smarty modifier sounds good too... I do not remember but
maybe there already exists one?

luci


On 16.2.2017 15:19, Jonny Bradley wrote:
> Again i think it would be better to let CSS do this, then the browser will do all the locale stuff and work better (maybe) in RTL languages etc...
>
> But if that's not an option i think this should be a smarty thing, maybe a modifier? So you would use it in the template like
>
>       {$the_number|convertnum:'upper-roman'}
> or
>       {'3'|convertnum:'upper-roman'}
>
> Then to use it in php directly you would call something smarty_modifier_convertnum() (having asked smarty where it is using loadPlugin).
>
> Sounds suitable?
>
> Maybe come along to the meeting (https://tiki.org/Roundtable+Meeting+2017+02) and we could discuss it in the second hour?
>
> jonny
>
>
>
>
>> On 16 Feb 2017, at 14:06, Brendan Ferguson <[hidden email]> wrote:
>>
>> ya, I guess I wasnt very clear. Its a php series of php functions (bundeled into a class) that converts integers into strings that represent that integer, using the same scheme as the CSS attribute list-style-type. So ConvertNum(3,'upper-roman') returns 'III' etc. Sorry for the confusion.
>>
>> Brendan
>>
>> On Thu, Feb 16, 2017 at 10:55 PM, luciash <[hidden email]> wrote:
>> I don't think CSS styling a numbered list belongs to the lib/ but maybe we just misunderstood your question - a PHP class (or is it a library?) definitely goes to lib/ or vendor/ if it is part of third party lib... but if it is just a class, a tikilib.php sounds good?
>>
>> luci
>>
>> On 16.2.2017 14:42, Brendan Ferguson wrote:
>>> I don't think php libraries belong in the less folder.
>>>
>>> On Thu, Feb 16, 2017 at 9:34 PM, luciash <[hidden email]> wrote:
>>> Hi!
>>>
>>> Nowhere in the lib/ folder please. Add it to the themes/base_files/less/tiki-wikipages_and_plugins.less and recompile the CSS using php console.php (see php console.php --help for the command params available)
>>>
>>> luci
>>>
>>> On 16.2.2017 2:31, Brendan Ferguson wrote:
>>>> Ive got a php class I am created for the footnotes that styles a number as if one used list-style-type in CSS.
>>>>
>>>> I was wondering if people had an idea where the best place in the lib folder would be the best place to house it.
>>>>
>>>> Brendan
>>>>
>>>>
>>>> ------------------------------------------------------------
>>>> ------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, SlashDot.org!
>>>> http://sdm.link/slashdot
>>>>
>>>> ______________________________
>>>> _________________
>>>> TikiWiki-devel mailing list
>>>>
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ TikiWiki-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, SlashDot.org!
>>> http://sdm.link/slashdot
>>>
>>> ______________________________
>>> _________________
>>> TikiWiki-devel mailing list
>>>
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> TikiWiki-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
>> TikiWiki-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> TikiWiki-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel