Support Forums

Support Offline : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

How does the Font Family in Add-on being applied?

Featured Lock Resolved
Hello!

So, I created a template override of Articles add-on so I can add my own option on the Read More link. It's working great but I don't understand the Font Family and how it is being loaded. I cannot find the name font_family being called in the site.php file, so, I assumed that a javascript is taking care of it.

Now, my problem is, when editing a page, changing the font family does not change anything but if I leave the SPPBuilder, it does render the font that I selected. Am I missing something or do I need to add any code for it to work? I am looking at text_block add-on as an example and I cannot find a line of code that called for font_family and text_font_family.

Thanks,

Jackson

7 Answers

Paul Frankowski - Staff

More than a month ago #Permalink
Hi Jackson,
why you need to change font-family from addon, it make only mess.
One user would choose Arial, 2nd Lato, and 3th Roboto. And you would get only mix.
Sorry I don't know code structure.
But in most cases I set fonts family from template only. And tell clients, DO NOT TOUCH font-family.

LAC Webadmin

More than a month ago #Permalink
Hi Paul,

Well, I guess you are right, I think I might be going over on my add-on override options.

But anyhow, I am learning how SPPBuilder works and font_family is kind of a puzzle to me. Does any of your developer able to answer my question on why the font_family is not loading when inside SPPBuilder?

Thanks,

Jackson

Paul Frankowski - Staff

More than a month ago #Permalink
No sooner than on Monday.
Ping me on Monday, if you won't find.

LAC Webadmin

More than a month ago #Permalink
Hi Paul,

Any update on this?

Thanks,

Jackson

Paul Frankowski - Staff

More than a month ago #Permalink
You forgot to remind me...
sorry, we have so many topics that easy to forget.
----
Have you checked the source code deeply?
No, they are not loaded from addons directly, addons only use features from the component.

LAC Webadmin

More than a month ago #Permalink
Hi Paul,

Well, I just followed how other add-ons added parameters in the XML file and it seems to work when loaded but when I do the same thing with my custom add-on it does not.

Can you ask your developer please? What is the procedure to add a Font Family parameter to an Add-On?

Thanks,

Jackson

Paul Frankowski - Staff

More than a month ago #Permalink
I got a short tip only

there is file name fontlist.js but you will not get that file in package that is compiled in minified js


'font_family'=>array(
'type'=>'fonts',
'title'=>JText::_('COM_SPPAGEBUILDER_ADDON_TITLE_FONT_FAMILY'),
'desc'=>JText::_('COM_SPPAGEBUILDER_ADDON_TITLE_FONT_FAMILY_DESC'),
'depends'=>array(array('title', '!=', '')),




to add this code to admin.php file

the similar code you can find here:
addons\text_block\admin.php
addons\heading\admin.php


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Leaderboard (30 days)

Sifat

Sifat

Total Accepted Answers: 113
Paul Frankowski

Paul Frankowski

Total Accepted Answers: 108
Toufiq

Toufiq

Total Accepted Answers: 37
Pavel

Pavel

Total Accepted Answers: 4
J

johnny

Total Accepted Answers: 3

100+

Templates

200,000+

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us