1 webadmin May 17, 2010 02:02
3 tilqicom May 17, 2010 09:30
Yep.. there are hell lot of parameters but not one for category text afai see..
#
function request_title( $params = array() )
#
{
#
global $MainList, $preview, $disp;
#
#
$r = array();
#
#
$params = array_merge( array(
#
'auto_pilot' => 'none',
#
'title_before' => '',
#
'title_after' => '',
#
'title_none' => '',
#
'title_single_disp' => true,
#
'title_single_before' => '#',
#
'title_single_after' => '#',
#
'title_page_disp' => true,
#
'title_page_before' => '#',
#
'title_page_after' => '#',
#
'glue' => ' - ',
#
'format' => 'htmlbody',
#
'arcdir_text' => T_('Archive Directory'),
#
'catdir_text' => T_('Category Directory'),
#
'mediaidx_text' => T_('Photo Index'),
#
'postidx_text' => T_('Post Index'),
#
'search_text' => T_('Search'),
#
'sitemap_text' => T_('Site Map'),
#
'msgform_text' => T_('Send an Email Message'),
#
'profile_text' => T_('User Profile'),
#
'user_text' => T_('User'),
#
'subs_text' => T_('Subscriptions'),
#
'comments_text' => T_('Latest Comments'),
#
'feedback-popup_text' => T_('Feedback'),
#
), $params );
no worries though, it's in the TODO.
Todo: make it complete with all possible params!
4 lturner May 17, 2010 10:53
This is already possible. Add the following to your request_title function:
'category_text' => '',
So mine looks like:
request_title( array(
'title_before'=> '<h2 class="requesttitle">',
'title_after' => '</h2>',
'title_none' => '',
'glue' => ' - ',
'title_single_disp' => false,
'title_page_disp' => false,
'format' => 'htmlbody',
'category_text' => '',
) );
L
5 tilqicom May 17, 2010 11:42
i kind of remembered sth like that, but couldnt figure what it was , thank you lee.. wonder why it was not in doc. head
6 lturner May 17, 2010 12:08
No worries, not sure about the docs. I'll add it when I have a mo. I tend to bypass the docs and go straight for the code so I didn't realise it wasn't there.
L
7 webadmin May 24, 2010 01:10
Thanks! Good to know about 'category_text'
8 webadmin May 24, 2010 17:25
One more question -- is there a way for request_title to show a top level category name without showing all of the sub categories? Thanks a lot.
9 tilqicom May 24, 2010 21:50
webadmin wrote:
One more question -- is there a way for request_title to show a top level category name without showing all of the sub categories? Thanks a lot.
I couldn't think of an easy way to do that, however i agree with you in the necessity of that one.. If you have many sub-cats the title grows too long.
10 cslepage Dec 04, 2010 05:10
Will this work in index.main.php as well? I ask because I tried, and it didn't appear to.
11 lturner Dec 08, 2010 19:26
Are you talking about in the page title ?
L
12 cslepage Dec 08, 2010 20:02
Yes, I want the page title to not be "Category-XXX". Just "XXX" would work fine.
13 lturner Dec 08, 2010 20:43
Did you add the
'category_text' => '',
to the request_title in the header?
L
14 theman82 Aug 02, 2011 21:09
The: 'category_text' => '', addon only works when a category without any subcategories is selected.
Is there a way for a category with sub-categories to display only the current category name, without 'Categories:', or any of the subcategories?
I've checked the _template.funcs.php file, but I don't see where this is being pulled from.
I think it might be defined in the $Blog class, or in the variable $r, which is returned from $Blog->get('name'); function, I think.
I just want *this* category to display... Sounds simple enough. :-/
15 theman82 Aug 03, 2011 00:18
Figured it out.
Add: 'categories_text' => '',
i.e. my request looks like this:
request_title( array(
'title_before'=> '<h2 style="font-size:1.6em">',
'title_after' => '</h2>',
'title_none' => '',
'glue' => ' - ',
'title_single_disp' => true,
'format' => 'htmlbody',
'category_text' => '',
'categories_text' => '',
) );
Then edit the following file: \inc\items\model\_itemlistlight.class.php
Change lines 947 - 953 from:
foreach( $this->filters['cat_array'] as $cat_ID )
{
if( ($my_Chapter = & $ChapterCache->get_by_ID($cat_ID, false) ) !== false )
{ // It is almost never meaningful to die over an invalid cat when generating title
$cat_names[] = $my_Chapter->name;
}
}
to:
$cat_ID = current( $this->filters['cat_array'] );
if( ($my_Chapter = & $ChapterCache->get_by_ID($cat_ID, false) ) !== false )
{ // It is almost never meaningful to die over an invalid cat when generating title
$cat_names[] = $my_Chapter->name;
}
This makes the function only return the first category, which will always be the top category.
I've tested this solution on my site, and it works unconditionally so far.
Sound like the perfect scenario for an Intro (post type Intro-Cat).
Type what you want it to say at the top of the page... assign the category... boom! You're done.
... almost. ;)
Just comment out the whole request_title() section from your posts.main.php after you make an Intro for every category if you don't like the - Category: Name thing showing up.
Don't know if it will cause problems anywhere else, but it works for me with no bad side effects.
EDIT: Might not be the best solution, as it doesn't take into account Latest Comments or Archives titles.