Flexinode content types don't use their descriptive names
pamphile - June 1, 2005 - 15:55
| Project: | IndexPage |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | NancyDru |
| Status: | closed |
Description
When displated with the Indexpage, Flexinode content types don't use their descriptive names
Instead of saying
Index page for company report
Index page for company review
It says:
Index page for flexinode-1
Index page for flexinode-2
That would be a turn off to any user.
Any plans fix this ?
Thanks

#1
Ran into that too - here's a patch to call the node_name hook, filling in the "real" flexinode type name.
#2
Oops, missed the group headers on the settings page...
#3
Has this patch been added to Head yet?
#4
I'm not the author of indexpage, it's up to him to decide whether to commit a patch.
Keep in mind that the typical open-source author has other responsibilities (e.g., a day job, maintaining their own sites, etc.). For example, outside my day job I generally focus on my site content weeknights and do my programming on the weekends (although this week I seem to be in geek mode:-) - let's give Carlos a little time... In the meantime, the patch isn't all that big, you could apply it to your own copy of indexpage.module, or even edit the changes in manually by looking at the patch file.
#5
I've tried this patch and it doesn't work. I get exactly the same results as before. I can see how it should work and so I'm completely bamboozled!
Any ideas? Help!
Regards
Patrick
#6
Where is it that you're not seeing the "true" flexinode node names? Note that most of the visible uses of the type are settable on the settings page, and my patch only affects how those values default - if you saved the settings under the original version without changing the "Name to show for this node type" for your flexinodes, that original name will still be used, you need to reset it explicitly.
On the settings page, what name is used in the group header "Index page settings for ..."?
#7
mikeryan
Thanks for your answer. I can see from what you're saying that you've hit the nail on the head - I did save the settings previously. You say that I need to "reset [them] explicitly". How do I do that?
On the settings page, the name(s) used in the group headers currently show what I want them to, but this doesn't reflect in the actual index pages for flexinode types that existed prior to installing this patch.
Regards
Patrick
#8
Patrick,
I have been banging my head against exactly the same problem, and applied the same patches (to no avail). Ended up searching the database for the offending text, which is where it turned up. The problem is that the page heading is actually taken from the menu entry. These entries are written at some point, but then not modified when the flexinodes are renamed.
Two solutions - through the UI and directly on the DB
1) Through the UI
You will have to enable the menu module for this. Once it is enabled, go into 'administer/menus'. You will see the offending entry or entries. If they are disabled, you will have to enable them to edit the menu item, and then disable them again.
Edit the name to use the required page title.
2) Through phpmyadmin (or equivalent)
Browse the 'menu' table. Edit the 'title' field where the 'path' field starts with 'indexpage/flexinode'. Then delete all entries in the 'cache' table (or you won't see the changes).
#9
therave - thanks for that! I'm now sorted.
Gratefully
Patrick
#10
I'm not sure what you guys are on about, but I had a problem where when I viewed the indexpage for a flexinode type, I'd still get "index page for flexinode-1", rather than that admin set name. so I looked at the code and updated the following function (you can see my comments):
function indexpage_menu($may_cache) {global $user;
$items = array();
if ($may_cache) {
$items[] = array('path' => 'indexpage', 'title' => t('main index page'), 'callback' => 'indexpage_page', 'access' => user_access('access indexpage'), 'type' => MENU_NORMAL_ITEM);
}
$result = @db_query("SELECT DISTINCT type FROM {node} ORDER BY type");
while ($node = db_fetch_object($result)) {
// SM fix to use the flexinode name instead of the node type. I think this
// means that you have to always have a name set (which is done so by default)
//array_push($items, array('path' => 'indexpage/'.$node->type, 'title' => t("index page for %s", array("%s" => $node->type)), 'access' => user_access('access indexpage'), 'type' => MENU_NORMAL_ITEM));
$name = variable_get("indexpage_".$node->type."_name", $node->type);
array_push($items, array('path' => 'indexpage/'.$node->type, 'title' => t("index page for %s", array("%s" => $name)), 'access' => user_access('access indexpage'), 'type' => MENU_NORMAL_ITEM));
}
return $items;
}
now when I view ?q=indexpage/flexinode-1, I can see the proper name, rather than "index page for flexinode-1".
#11
The code above doesn't work for me. I'm using 4.7.2
#12
I don't think this will be a problem in the 5.x and 6.x versions, even if Flexinode ever gets updated. I have changed the code that gets the node types, and it all seems to work right for me. The menu entries and index page will also correctly show the name as entered on the settings page.
#13
I'm marking this as fixed in the 5.x version. I don't have Flexinode, and one really should use the conversion to CCK.
#14