-
AuthorPosts
-
hamlethub Friend
hamlethub
- Join date:
- February 2011
- Posts:
- 128
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 15
- Thanked:
- 3 times in 1 posts
April 19, 2011 at 12:53 am #162941I am using JA tabs and J1.6. I am “duplicating” a page template for many subcategories, and the JA-tabs on the different pages will contain different modules. The problem is I have to make the module names longer, and have part of the category name as part of the title (to keep track of them). Because of this length, I can’t have three tabs in my ja-tabs because there is not enough room for the title.
Is there any way to modify the title for the JA Tabs? I am trying to eliminate the first word of the Module Title, because it is not needed.
So if there were three tabs, right now it would say Boston Most Liked, Boston Most Comments, Boston Most read, and it would not fit. I would like it to simply say Most Liked, Most Comments, Most read on every page, regardless of what subcategory they were in. (even though the module names would be boston most liked, etc)
Thanks!
Ken
himangi Friendhimangi
- Join date:
- April 2011
- Posts:
- 1406
- Downloads:
- 1
- Uploads:
- 86
- Thanks:
- 21
- Thanked:
- 345 times in 332 posts
April 19, 2011 at 7:39 am #387033Hi,
You can use a code to separate first word from the title and give styling display:none to the first word. I think it should work, the only problem is that the JA Tabs has it’s code written in JA tabs plugin, which actually displays the Module Titles as Tab titles. You will need to hack the plugin file to achieve what you want, since there is no way as of yet, to override plugin files from template.
If you want the code, I can paste it here..
hamlethub Friendhamlethub
- Join date:
- February 2011
- Posts:
- 128
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 15
- Thanked:
- 3 times in 1 posts
April 19, 2011 at 11:37 am #387082Can you please post the code? I would greatly appreciate it.
hamlethub Friendhamlethub
- Join date:
- February 2011
- Posts:
- 128
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 15
- Thanked:
- 3 times in 1 posts
April 19, 2011 at 12:08 pm #387084<em>@himangi 235111 wrote:</em><blockquote>Hi,
Since you are displaying multiple modules published in a position as tabs using JA Tabs, the function parseTabModules is being used.
To implement the following code,
- Copy ja_tabs.php, to keep a backup of it.
- Open your ftp and open ja_tabs.php in yoursite/plugins/content folder.
- Find on line 143
- Replace above line with the following code and save the file.
- Go to frontend and inspect the tab titles in Tabs module. You will find that there is an extra span with class=”first-word”, around the first word. If your Module title is not more than 1 word then class will not apply, because we have written code like that.
- Now open your template.css file and place . Save the css file and first word from your tab titles should be hidden.
If it does not work as it is, please update your ticket http://support.joomlart.com/index.php?/Tickets/Ticket/View/70521 to give ftp details to your site, so that I can take a look and fix whatever the issue may be.</blockquote>
Can I rename the php ja_tabs.php file to ja_tabs_NF.php – so that I may use it only when I do want to blank out the first word? Then I will call ja_tabas_NF.php?
himangi Friendhimangi
- Join date:
- April 2011
- Posts:
- 1406
- Downloads:
- 1
- Uploads:
- 86
- Thanks:
- 21
- Thanked:
- 345 times in 332 posts
April 19, 2011 at 12:11 pm #387085My original post was
<blockquote>
Hi,Since you are displaying multiple modules published in a position as tabs using JA Tabs, the function parseTabModules is being used.
To implement the following code,
- Copy ja_tabs.php, to keep a backup of it.
- Open your ftp and open ja_tabs.php in yoursite/plugins/content folder.
- Find <blockquote>$lis .= “<li title=””.strip_tags($list[$j]->title).””><h3><span>”.$list[$j]->title.”</span></h3></li>”;</blockquote> on line 143
- Replace above line with the following code and save the file.
- <blockquote>$title = $list[$j]->title;
- $pos = strripos($title, ‘ ‘);
- if ( $pos !== false ) { $title = “<span class=”first-word”>” . substr($title, 0, $pos+1) .”</span>”. substr($title, $pos+1); }
- $lis .= “<li title=””.strip_tags($list[$j]->title).””><h3><span>”.$title.”</span></h3></li>”;</blockquote>
- Go to frontend and inspect the tab titles in Tabs module. You will find that there is an extra span with class=”first-word”, around the first word. If your Module title is not more than 1 word then class will not apply, because we have written code like that.
- Now open your template.css file and place <blockquote>span.first-word{display:none;}</blockquote>. Save the css file and first word from your tab titles should be hidden.
If it does not work as it is, please update your ticket http://support.joomlart.com/index.php?/Tickets/Ticket/View/70521 to give ftp details to your site, so that I can take a look and fix whatever the issue may be.
</blockquote>1 user says Thank You to himangi for this useful post
hamlethub Friendhamlethub
- Join date:
- February 2011
- Posts:
- 128
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 15
- Thanked:
- 3 times in 1 posts
April 19, 2011 at 12:16 pm #387086<em>@himangi 235113 wrote:</em><blockquote>My original post was</blockquote>
Therefore I should modify the css and create a new class, so when I want to keep the first word in some ja-tabs, I can?
himangi Friendhimangi
- Join date:
- April 2011
- Posts:
- 1406
- Downloads:
- 1
- Uploads:
- 86
- Thanks:
- 21
- Thanked:
- 345 times in 332 posts
April 19, 2011 at 12:17 pm #387087Hi,
I am not sure how it will work and I would recommend not to do so, since you will need to hack the various files which may be calling ja_tabs.php
You can keep ja_tabs_NF.php just to have backup of the original file.
I assume your concern is that you dont want any other titles in Tabs module to get cut, if so you can give a module class suffix to a particular JA Tabs module and specify span.first-word{display:none;} for that module only.
hope that solves your problem.
hamlethub Friendhamlethub
- Join date:
- February 2011
- Posts:
- 128
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 15
- Thanked:
- 3 times in 1 posts
April 19, 2011 at 12:24 pm #387088<em>@himangi 235115 wrote:</em><blockquote>Hi,
I am not sure how it will work and I would recommend not to do so, since you will need to hack the various files which may be calling ja_tabs.php
You can keep ja_tabs_NF.php just to have backup of the original file.
I assume your concern is that you dont want any other titles in Tabs module to get cut, if so you can give a module class suffix to a particular JA Tabs module and specify span.first-word{display:none;} for that module only.
hope that solves your problem.</blockquote>
Thank you – I will try that.
himangi Friendhimangi
- Join date:
- April 2011
- Posts:
- 1406
- Downloads:
- 1
- Uploads:
- 86
- Thanks:
- 21
- Thanked:
- 345 times in 332 posts
April 19, 2011 at 12:50 pm #387092<em>@hamlethub 235116 wrote:</em><blockquote>Thank you – I will try that.</blockquote>
did you find the file? If the problem is solved, kindly let me know so that I can close the thread.
hamlethub Friendhamlethub
- Join date:
- February 2011
- Posts:
- 128
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 15
- Thanked:
- 3 times in 1 posts
April 19, 2011 at 1:06 pm #387094<em>@himangi 235122 wrote:</em><blockquote>did you find the file? If the problem is solved, kindly let me know so that I can close the thread.</blockquote>
Thanks again for your help:
I have implemented the change, but do not see the extra span –
<div style=”” class=”ja-tabs-title-top”>
<ul class=”ja-tabs-title”><li title=”Most Liked” class=”first active”><h3><span>Most Liked</span></h3></li><li title=”Most Read” class=””><h3><span>Most Read</span></h3></li><li title=”Most Comments” class=”last”><h3><span>Most Comments</span></h3></li></ul>
</div>
</li>himangi Friendhimangi
- Join date:
- April 2011
- Posts:
- 1406
- Downloads:
- 1
- Uploads:
- 86
- Thanks:
- 21
- Thanked:
- 345 times in 332 posts
April 19, 2011 at 1:10 pm #387095<em>@hamlethub 235124 wrote:</em><blockquote>Thanks again for your help:
I have implemented the change, but do not see the extra span –
<div style=”” class=”ja-tabs-title-top”>
<ul class=”ja-tabs-title”><li title=”Most Liked” class=”first active”><h3><span>Most Liked</span></h3></li><li title=”Most Read” class=””><h3><span>Most Read</span></h3></li><li title=”Most Comments” class=”last”><h3><span>Most Comments</span></h3></li></ul>
</div>
</li></blockquote>If it’s ok with you can you PM me ftp details? I will implement it for you.
1 user says Thank You to himangi for this useful post
hamlethub Friendhamlethub
- Join date:
- February 2011
- Posts:
- 128
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 15
- Thanked:
- 3 times in 1 posts
April 19, 2011 at 2:01 pm #387100Did you get my pms?
himangi Friendhimangi
- Join date:
- April 2011
- Posts:
- 1406
- Downloads:
- 1
- Uploads:
- 86
- Thanks:
- 21
- Thanked:
- 345 times in 332 posts
April 22, 2011 at 7:18 am #387595Hi,
The work is done.
- I have placed following code in your plugins/system/jatabs/jatabs.php
- Following is the styling code placed in your templates/ja_teline_iv/local/themes/hamlethub/css/template.css
- This styling will be applied to the Tab title, that is the module title, only when you have applied module class suffix blank-first-word to the module.
<blockquote> /*Code added to give class to first word in the module title – hack given by Himangi on JA*/
$title = $list[$j]->title;
$pos = stripos($title, ‘ ‘);
if ( $pos !== false ) { $title = “<span class=”first-word”>” . substr($title, 0, $pos+1) .”</span>”. substr($title, $pos+1); }
$lis .= “<li title=””.strip_tags($list[$j]->title).”””.($clssfx?” class=”ja-tab-title$clssfx””:””).”><h3><span>”.JText::_($title).”</span></h3></li>”;
/*End of change in code*/
//Original code line
//$lis .= “<li title=””.strip_tags($list[$j]->title).”””.($clssfx?” class=”ja-tab-title$clssfx””:””).”><h3><span>”.JText::_($list[$j]->title).”</span></h3></li>”;</blockquote>
NOTE: This code is placed only in parseTabModules function, so if you load anything other than modules exactly like you have done now, the code will not work unless you place the code in respective functions in the jatabs.php file<blockquote>/*styling for first word in Module Title displayed using JA Tabs*/
.ja-tab-titleblank-first-word span.first-word{
display: none !important;
}</blockquote>1 user says Thank You to himangi for this useful post
hamlethub Friendhamlethub
- Join date:
- February 2011
- Posts:
- 128
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 15
- Thanked:
- 3 times in 1 posts
April 22, 2011 at 11:44 am #387633<em>@hamlethub 235124 wrote:</em><blockquote>Thanks again for your help:
I have implemented the change, but do not see the extra span –
<div style=”” class=”ja-tabs-title-top”>
<ul class=”ja-tabs-title”><li title=”Most Liked” class=”first active”><h3><span>Most Liked</span></h3></li><li title=”Most Read” class=””><h3><span>Most Read</span></h3></li><li title=”Most Comments” class=”last”><h3><span>Most Comments</span></h3></li></ul>
</div>
</li></blockquote>I put a module suffix in “(blank)blank-first-word” and then added a new class:
.teline_iv .container .ja-tabs-title-top ul.ja-tabs-title li.blank-first-word h3 span.first-word {
display: none;
}It works great. Let me know if that will cause any issues with anything else down the road.
Ken
hamlethub Friendhamlethub
- Join date:
- February 2011
- Posts:
- 128
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 15
- Thanked:
- 3 times in 1 posts
April 22, 2011 at 12:55 pm #387646I just recognized an issue – it actually blanks our the first two words, not the first word – so if I have toms most comments it makes that “comments” as opposed to “most comments”.
I will see if I can figure out a way to fix this
-
AuthorPosts
This topic contains 19 replies, has 2 voices, and was last updated by himangi 13 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum