Hi Jan,
is it possible to apply to phoca tree a max width so that entries which are too long will be splittet into at least two parts?
Thanks for your good work - siy
Max Width?
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Max Width?
hi, the tree is created by dtree. For now I didn't find any solution in javascript how to do it
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 13
- Joined: 20 Oct 2009, 17:12
Re: Max Width?
Hm, I tried it via the white-space css tag and it's working. Actually not very good To explain my problem the left menu modules are overlayed by the content stuff through my template und that's why every kind of text is going to the invisibility by running into the content's area.
Do you think there would be an option to indent the text which is white-spaced to the position the father-element is?
Another Possibility in my case would be to create a new module-class on the left which is overlaying the content box but I'm not very happy with this solution.
Third, I have a question. Is it easier for you to read and write in English or German?
Thanks - siy
Do you think there would be an option to indent the text which is white-spaced to the position the father-element is?
Another Possibility in my case would be to create a new module-class on the left which is overlaying the content box but I'm not very happy with this solution.
Third, I have a question. Is it easier for you to read and write in English or German?
Thanks - siy
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Max Width?
Depends on the words used in the answer Sometimes it is better in English, machmal auf DeutschI have a question. Is it easier for you to read and write in English or German?
As I don't know exactly what happens in the javascript I cannot say anything about the method (css) which can fix this
no experience thereAnother Possibility in my case would be to create a new module-class on the left which is overlaying the content box but I'm not very happy with this solution.
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 16
- Joined: 16 Sep 2008, 09:13
Re: Max Width?
Hi,
I had the same problem. I have modified the categoryTree function in mod_phocagallery_tree.php file so that the names longer than 15 characters are cut. The code searches the first space in the text, cuts the rest and then padds it with three dots:
// Categories tree
$tree = array();
$text = '';
$tree = categoryTree( $categories, $tree, 0, $text, $treeId );
// Create category tree
function categoryTree( $data, $tree, $id=0, $text='', $treeId ) {
foreach ( $data as $value ) {
if ($value->parentid == $id) {
$link = getLink($value->id);
$title = $value->text;
// Cut a long name.
if(strlen($title) > 15) {
$subtitle = explode(" ", $title);
$title = $subtitle[0] . ' ...';
}
$title = addslashes($title);
$showText = $text . ''.$treeId.'.add('.$value->id.','.$value->parentid.',\''.$title.'\',\''.$link.'\');'."\n";
$tree[$value->id] = $showText;
$tree = categoryTree($data, $tree, $value->id, '', $treeId);
}
}
return($tree);
}
You may see the effect here: http://www.zlotniki.szkola.pl (on the right there is a module 'W galerii...').
However, it would be fine to see a full name when the mouse pointer is over the "shortened" title - maybe in a tooltip? The 'title' part of a 'href' tag would be OK, but where to put it? Have you any suggestions?
Best regards,
Stan
I had the same problem. I have modified the categoryTree function in mod_phocagallery_tree.php file so that the names longer than 15 characters are cut. The code searches the first space in the text, cuts the rest and then padds it with three dots:
// Categories tree
$tree = array();
$text = '';
$tree = categoryTree( $categories, $tree, 0, $text, $treeId );
// Create category tree
function categoryTree( $data, $tree, $id=0, $text='', $treeId ) {
foreach ( $data as $value ) {
if ($value->parentid == $id) {
$link = getLink($value->id);
$title = $value->text;
// Cut a long name.
if(strlen($title) > 15) {
$subtitle = explode(" ", $title);
$title = $subtitle[0] . ' ...';
}
$title = addslashes($title);
$showText = $text . ''.$treeId.'.add('.$value->id.','.$value->parentid.',\''.$title.'\',\''.$link.'\');'."\n";
$tree[$value->id] = $showText;
$tree = categoryTree($data, $tree, $value->id, '', $treeId);
}
}
return($tree);
}
You may see the effect here: http://www.zlotniki.szkola.pl (on the right there is a module 'W galerii...').
However, it would be fine to see a full name when the mouse pointer is over the "shortened" title - maybe in a tooltip? The 'title' part of a 'href' tag would be OK, but where to put it? Have you any suggestions?
Best regards,
Stan
-
- Phoca Member
- Posts: 13
- Joined: 20 Oct 2009, 17:12
Re: Max Width?
Seems to work properly, thanks for this advise. I'll go check this out later and give you some feedback.
-
- Phoca Newbie
- Posts: 2
- Joined: 21 Aug 2010, 14:13
Re: Max Width?
Hi,
I use Tree Module - version 2.7.1, I tried to apply this solution, but I did not succeed. There is an error "Fatal error: Call to undefined function getlink () in /.../ modules / mod_phocagallery_tree / mod_phocagallery_tree.php on line 122.
I use Tree Module - version 2.7.1, I tried to apply this solution, but I did not succeed. There is an error "Fatal error: Call to undefined function getlink () in /.../ modules / mod_phocagallery_tree / mod_phocagallery_tree.php on line 122.
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Max Width?
Hi, you should check your code getlink ->getLink
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 2
- Joined: 21 Aug 2010, 14:13
Re: Max Width?
Online check of syntax of the modified file "mod_phocagallery_tree.php" on a site www.meandeviation.com has passed without errors.
Line number 122 - "$ link = getLink ($ value-> id);".
If instead of it to put a line "$link = JRoute:: _ (PhocaGalleryRoute:: getCategoryRoute ($value-> id, $value-> alias));" from original mod_phocagallery_tree.php, then there is no error, but the module is working as usual .
Line number 122 - "$ link = getLink ($ value-> id);".
If instead of it to put a line "$link = JRoute:: _ (PhocaGalleryRoute:: getCategoryRoute ($value-> id, $value-> alias));" from original mod_phocagallery_tree.php, then there is no error, but the module is working as usual .