Template Version: 2.3
What this does: Adds text size options under template features font category which you can change your Menu Text Size, Joomla Article Titles, K2 Article Titles.
Who is this for: Users asking how to change article titles in forums.
Should it be added to feature templates: Yes i think so considering amount of users are asking in forums.
How this looks:
How mod works: Once enabled adds required css into the template.
Does it work on other templates: Technique is same and will work but might need to be adjusted in few templates.
Mod Starts here:
Find File: "joomla rootlanguageen-GBen-GB.tpl_gk_twn2.ini"
Add at the end following strings:
- Code: Select all
TPL_GK_LANG_TEXT_SIZE_TEXT="Text Size Options"
TPL_GK_LANG_TEXT_SIZE_SWITCH="Enable / Disable Title Text Size"
TPL_GK_LANG_TEXT_SIZE_SWITCH_DESC="You can enable or disable text size overrides option by turning switch to on"
TPL_GK_LANG_MAIN_MENU_TEXT_SIZE="Main Menu:"
TPL_GK_LANG_MAIN_MENU_TEXT_SIZE_DESC="You can specify main menu title font size in here by using example 20px or 100%"
TPL_GK_LANG_K2_ARTICLE_TITLE_SIZE="K2 Article Title:"
TPL_GK_LANG_K2_ARTICLE_TITLE_SIZE_DESC="You can specify K2 article title font size in here by using example 20px or 100%"
TPL_GK_LANG_K2_CATEGORY_ARTICLE_TITLE_SIZE="K2 Category Layout Article Title:"
TPL_GK_LANG_K2_CATEGORY_ARTICLE_TITLE_SIZE_DESC="You can specify K2 category layout article title font size in here by using example 20px or 100%"
TPL_GK_LANG_JOOMLA_ARTICLE_TITLE_SIZE="Joomla Article Title:"
TPL_GK_LANG_JOOMLA_ARTICLE_TITLE_SIZE_DESC="You can specify Joomla article title font size in here by using example 20px or 100%"
TPL_GK_LANG_JOOMLA_ARTICLE_BLOG_TITLE_SIZE="Joomla Blog Layout Article Title:"
TPL_GK_LANG_JOOMLA_ARTICLE_BLOG_TITLE_SIZE_DESC="You can specify Joomla blog layout article titles font size in here by using example 20px or 100%"
Find File: "Joomla Roottemplatesgk_twn2templateDetails.xml"
Find Line: 326
Which is :
- Code: Select all
<field name="font_rules_group3" type="textarea" rows="6" cols="40" label="TPL_GK_LANG_FONT_RULES_G3" description="TPL_GK_LANG_FONT_RULES_G3_DESC" />
Add after Following:
- Code: Select all
<field name="gk_line_17" type="line" text="TPL_GK_LANG_TEXT_SIZE_TEXT" />
<field name="text_size_switch" type="list" class="gk_switch" default="0" label="TPL_GK_LANG_TEXT_SIZE_SWITCH" description="TPL_GK_LANG_TEXT_SIZE_SWITCH_DESC">
<option value="1">TPL_GK_LANG_ENABLED</option>
<option value="0">TPL_GK_LANG_DISABLED</option>
</field>
<field name="main_menu_title" type="text" class="small tright suffix-pxorpercents" default="18px" label="TPL_GK_LANG_MAIN_MENU_TEXT_SIZE" description="TPL_GK_LANG_MAIN_MENU_TEXT_SIZE_DESC" />
<field name="k2_article_title" type="text" class="small tright suffix-pxorpercents" default="35px" label="TPL_GK_LANG_K2_ARTICLE_TITLE_SIZE" description="TPL_GK_LANG_K2_ARTICLE_TITLE_SIZE_DESC" />
<field name="k2_article_category_title" type="text" class="small tright suffix-pxorpercents" default="28px" label="TPL_GK_LANG_K2_CATEGORY_ARTICLE_TITLE_SIZE" description="TPL_GK_LANG_K2_CATEGORY_ARTICLE_TITLE_SIZE_DESC" />
<field name="joomla_article_title" type="text" class="small tright suffix-pxorpercents" default="35px" label="TPL_GK_LANG_JOOMLA_ARTICLE_TITLE_SIZE" description="TPL_GK_LANG_JOOMLA_ARTICLE_TITLE_SIZE_DESC" />
<field name="joomla_article_blog_title" type="text" class="small tright suffix-pxorpercents" default="35px" label="TPL_GK_LANG_JOOMLA_ARTICLE_BLOG_TITLE_SIZE" description="TPL_GK_LANG_JOOMLA_ARTICLE_BLOG_TITLE_SIZE_DESC" />
Find File: "joomla Roottemplatesgk_twn2layoutsblockshead.php"
Find Line: 48 to 51 which is below
- Code: Select all
// include CSS Override
if($this->getParam("css_override", '0')) {
$this->addCSS($this->URLtemplate() . '/css/override.css');
}
Add after below code:
- Code: Select all
// include Text Size Override
if($this->getParam("text_size_switch", '0')) {
$this->addCSSRule('#gkMainMenu > div > ul > li > a { font-size: ' . $this->getParam('main_menu_title','18px') . '; }');
$this->addCSSRule('.itemHeader .itemTitle { font-size: ' . $this->getParam('k2_article_title','35px') . '; }');
$this->addCSSRule('.catItemHeader .catItemTitle a { font-size: ' . $this->getParam('k2_article_category_title','28px') . '; }');
$this->addCSSRule('#gkComponent > div > h1, #gkComponent > div > h2, #gkComponent > div > h1 a, #gkComponent > div > h2 a { font-size: ' . $this->getParam('joomla_article_title','35px') . '; }');
$this->addCSSRule('.article-meta.blog > h2 { font-size: ' . $this->getParam('joomla_article_blog_title','35px') . '; }');
}
Thats it...
Now you can enable and change font size from template settings...