Hierarchy problems with modules

General project discussion. NOT for help questions.
Post Reply
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Hierarchy problems with modules

Post by nils73 »

wishy,

I have figured out a problem with $gCms->variables['position'] within module.functions.php because I got 00003.00007 instead of 3.7 when being on a module-generated page. Again this is just a dirty hack but you might know where to solve it. On line 144 - 145 I have inserted:

$gCms->variables['position'] = $line['hierarchy'];
$gCms->variables['position'] = str_replace("0000", "", $gCms->variables['position']);


I should finally sign-up for the bug-tracking module ... but (as always) I am either too busy or too lazy. ;)

Regards
Nils
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Hierarchy problems with modules

Post by Ted »

You can also do:

Code: Select all

ContentManager::CreateFriendlyHierarchyPosition($line['hierarchy']);
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Re: Hierarchy problems with modules

Post by nils73 »

Thank you, wishy --- the new lines look like this:

$gCms->variables['position'] = $line['hierarchy'];
$gCms->variables['position'] = ContentManager::CreateFriendlyHierarchyPosition($line['hierarchy']);


Is there anything like this CreateFriendlyHierarchyPosition for $title? Looks like it does not use any title at all, so I use a hack there as well.

Regards,
Nils
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Hierarchy problems with modules

Post by Ted »

No, there isn't.  But it would probably be a good idea.  Lemme see if I can come up with a good way of doing it...
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Re: Hierarchy problems with modules

Post by nils73 »

Probably grabbing the title for return_id (the respective page) would be a good idea ...

Just my 0.02 EUR
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Hierarchy problems with modules

Post by Ted »

Oh, yeah, that's an idea.

I was thinking more along the lines of the module being able to set it's own title if it had control of the page...  like News detail
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Re: Hierarchy problems with modules

Post by nils73 »

Actually with return_id you could have both (isset) ... but this idea is only worth my 0.01 EUR .. ;)
Post Reply

Return to “General Discussion”