Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Category tab: category name as title of category listing
Hi all
In category tab, the categories are listed using title, it’s ok when you have to make some selection, but if you are codig form (using txp:category_list like today for me) you have to use category name instead of category title, and sometime you don’t remember wich categoy name you have.
Is it possible to add the category name to view? somethink like this:
category_title (category_name)
or add category name as title of link, than when over it with cursor we can saw it?
I suppose it s the eLink function in txplib_html.php that can be changed to:
function eLink($event,$step='',$thing='',$value='',$linktext,$thing2='',$val2='',$linktitle='')
{
return join('',array(
'<a href="?event='.$event,
($step) ? a.'step='.$step : '',
($thing) ? a.''.$thing.'='.urlencode($value) : '',
($thing2) ? a.''.$thing2.'='.urlencode($val2) : '',
($linktitle) ? ' title="'.$linktitle.'"' : '',
'">'.escape_title($linktext).'</a>'
));
}
and in txp_category.php around line 316 the line:
$edit_link = eLink('category', 'cat_'.$event.'_edit', 'id', $id, $title);
become:
$edit_link = eLink('category', 'cat_'.$event.'_edit', 'id', $id, $title, $name);
The code above has not been tested it’s just an attemp looking inside code.
Is this useful for community or am i the only one that find that useful!
Cheers.
Last edited by Dragondz (2009-05-27 16:52:48)
Offline
Re: Category tab: category name as title of category listing
I like the intent of this suggestion, but not the particular way the requirement is fulfilled:
We’d rather have some kind of presentation which would enable copy/pasting a category name instead of reading a flashing tooltip and hastily retyping it elsewhere. Can you come up with a proposal for that?
Offline
#3 2009-05-28 10:19:47
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: Category tab: category name as title of category listing
Maybe it should be shown only for some user levels?
I think users which can only access the content tab won’t have any real advantage if the name is shown. On the contrary it can unnecessarily clutter the interface.
Just a thought.
Offline
Re: Category tab: category name as title of category listing
redbot wrote:
Maybe it should be shown only for some user levels?
Or for some production levels?
Offline
#5 2009-05-28 10:41:14
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: Category tab: category name as title of category listing
wet wrote:
Or for some production levels?
Yes, makes a lot more sense.
Offline
Re: Category tab: category name as title of category listing
wet a écrit:
I like the intent of this suggestion, but not the particular way the requirement is fulfilled:
We’d rather have some kind of presentation which would enable copy/pasting a category name instead of reading a flashing tooltip and hastily retyping it elsewhere. Can you come up with a proposal for that?
Hi Wet,
Do you mean code like that ?: (in txp_category.php and without need changing other file)
global $prefs;
if (empty($title)) {
$edit_link = '<em>'.eLink('category', 'cat_'.$event.'_edit', 'id', $id, gTxt('untitled')).'</em>';
} else {
if ($prefs['production_status'] == 'live') {
$edit_link = eLink('category', 'cat_'.$event.'_edit', 'id', $id, $title);
} else {
$edit_link = eLink('category', 'cat_'.$event.'_edit', 'id', $id, $name);
}
}
(tested code on localhost (4.07) it works)
Offline