1
aerograf
Language in js
  • 2017/6/6 17:58

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


Tell me please, how best to connect language constants to the js script?
It is necessary to localize the script.
Thank you in advance,

2
geekwright
Re: Language in js

There are several ways you might accomplish this, depending on the exact requirements.

Here is an example from XOOPS 2.5.9, where the image manager code sets up to use the fine-uploader javascript. To do this, we used javascript in a script tag in a Smarty template to initialize the library code, passing in all the required language constants. In the template we can use the language constants as normal -- Smarty will do the substitution in the script code just like it will in HTML.

See the code here, on GitHub:
https://github.com/geekwright/XoopsCore25/blob/master/htdocs/modules/system/templates/system_imagemanager2.tpl#L52

3
aerograf
Re: Language in js
  • 2017/6/6 19:25

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


I thought about how to connect language files and pull data out of them. Smarty does not work.
To make separate files which then to translate - I think not an option and there is a decision much easier.
All for the user

4
aerograf
Setting the block
  • 2017/6/16 13:09

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


Dear forum users.
With the previous question figured out.
Tell me, is it possible to change the style, visibility of one (not all blocks) of a specific block from the left or right without affecting the main css files?

5
Bleekk
Re: Setting the block
  • 2017/6/16 16:34

  • Bleekk

  • Theme Designer

  • Posts: 941

  • Since: 2002/12/14


Yes it is possible. But you need css to change it. If you do not want to change the main css File, You can add the css into your theme.html. You can add a css class to your blocks using for example the block id.
class="block-<{block.id} >"
And when you know the id of the block you want to change then add a css style for it like
.block-4{background#c3c3c3}
This will not affect other blocks

6
aerograf
Re: Setting the block
  • 2017/6/16 16:45

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


I know this option. The question concerns to the concrete module. I can not know what ID it will be assigned to in the future, and what topic will be.
Is it possible to change the appearance, size, etc.? By adding styles to xoops_version.php or configuring the blocks in the _show ($ options) function or something else?
It is in a single module.

7
Bleekk
Re: Setting the block
  • 2017/6/16 17:54

  • Bleekk

  • Theme Designer

  • Posts: 941

  • Since: 2002/12/14


You can add the class in the name of the Blocks.
Name your block like "blue|block-title"
Then use a .blue class in the css.
In the template you need to work with smarty to check if the title has a | in it and then use first Part as css class and second as the title

8
aerograf
Re: Setting the block
  • 2017/6/16 19:37

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


Thanks, I'll try.
p.s. I tried it. Valid only for content in the block. But the system itself does not change ...
Maybe some other ideas?
And if not, how can you make a global link from the module, that would be possible to install all the modules? (Management via admin panel is planned)

9
Bleekk
Re: Setting the block
  • 2017/6/17 7:05

  • Bleekk

  • Theme Designer

  • Posts: 941

  • Since: 2002/12/14


No, it is not only valid for content of the block, it is valid for all html that is inside the foreach loop of the blocks.

10
aerograf
Re: Setting the block
  • 2017/6/17 8:07

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


Maybe.
I'll try again, in more detail.
Thank you,

Login

Who's Online

274 user(s) are online (112 user(s) are browsing Support Forums)


Members: 0


Guests: 274


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits