| Author |
Message |
|
Algirdas
|
Post subject: Navigation images Posted: Thu Nov 24, 2011 6:07 pm |
|
Joined: Thu Nov 24, 2011 6:04 pm Posts: 20
|
|
Hello,
I want to add images to a navigation, insted of text, but I cant find a HTML or CSS code where to do that. Is it possible?
Waiting for help,
Algirdas
|
|
 |
|
 |
|
maskas
|
Post subject: Re: Navigation images Posted: Thu Nov 24, 2011 6:39 pm |
|
 |
| Project Developer |
Joined: Tue Apr 28, 2009 9:43 am Posts: 1720
|
|
 |
|
 |
|
Algirdas
|
Post subject: Re: Navigation images Posted: Thu Nov 24, 2011 6:50 pm |
|
Joined: Thu Nov 24, 2011 6:04 pm Posts: 20
|
|
1. I did that, but nothing happens. There isnt no images in menu, just ordinary text links.
2. Can i change class to id ? I want to add unique images to all navigation lists. Also where do I put that HTML code?
|
|
 |
|
 |
|
maskas
|
Post subject: Re: Navigation images Posted: Thu Nov 24, 2011 8:08 pm |
|
 |
| Project Developer |
Joined: Tue Apr 28, 2009 9:43 am Posts: 1720
|
1. Press F5 in administration panel and you will see new tab: Ddisplay Content -> Associated Images 2. You can if you will create your own menu generation class. I've prepared step number 2 for you. I've released new version of Associated Images plugin ( http://www.impresspages.org/extensions/ ... ed-images/). Please download (replace current plugin files) and carefully read readme.txt file how to use it. Now this plugin has an example of menu generation class that outputs associated images.
|
|
 |
|
 |
|
Algirdas
|
Post subject: Re: Navigation images Posted: Thu Nov 24, 2011 8:48 pm |
|
Joined: Thu Nov 24, 2011 6:04 pm Posts: 20
|
Thanks for your help. Now it works, but the image doesnt replace text, it is above text. How do i get rid off text, and have only image? also it is only image, not link. I need that this image would be link, navigation button i mean  here is the problem: http://www.negeriau.lt
|
|
 |
|
 |
|
maskas
|
Post subject: Re: Navigation images Posted: Thu Nov 24, 2011 9:04 pm |
|
 |
| Project Developer |
Joined: Tue Apr 28, 2009 9:43 am Posts: 1720
|
|
Do you know some PHP / HTML?
Open ip_plugins/display_content/assocaiated_images/menu.php
and edit HTML to your needs near lines 180 and 182
|
|
 |
|
 |
|
Algirdas
|
Post subject: Re: Navigation images Posted: Thu Nov 24, 2011 9:09 pm |
|
Joined: Thu Nov 24, 2011 6:04 pm Posts: 20
|
I know HTML, but dont know php. Maybe you can give me a hint what to edit? 
|
|
 |
|
 |
|
Algirdas
|
Post subject: Re: Navigation images Posted: Mon Nov 28, 2011 7:08 pm |
|
Joined: Thu Nov 24, 2011 6:04 pm Posts: 20
|
|
 |
|
 |
|
maskas
|
Post subject: Re: Navigation images Posted: Mon Nov 28, 2011 7:29 pm |
|
 |
| Project Developer |
Joined: Tue Apr 28, 2009 9:43 am Posts: 1720
|
|
If you know HTML, then you can do what you need.
Look at lines I've described above and just change html to what you need.
You don't need text link, so remove text link. And place link surrounding image tag. That's all.
Not a rocket since.
|
|
 |
|
 |
|
Algirdas
|
Post subject: Re: Navigation images Posted: Mon Nov 28, 2011 9:49 pm |
|
Joined: Thu Nov 24, 2011 6:04 pm Posts: 20
|
Code: $image = \Modules\display_content\associated_images\Db::getElementImages($element); if (isset($image[0])) { $imageHtml = '<img width="50px" src="'.BASE_URL.IMAGE_DIR.$image[0]['image'].'" alt="'.htmlspecialchars($image[0]['title']).'"/>'; } else { $imageHtml = ''; }
$tmpLink = $element->getLink(); if ($tmpLink) { if($element->getType() == 'inactive') { $html .= ' <li class="'.$class.'">'.$imageHtml.'<a class="'.$class.'" title="'.htmlspecialchars($element->getPageTitle()).'">'.htmlspecialchars($element->getButtonTitle()).'</a>'.$subHtml."</li>"."\n"; } else { $html .= ' <li class="'.$class.'">'.$imageHtml.'<a class="'.$class.'" href="'.$tmpLink.'" title="'.htmlspecialchars($element->getPageTitle()).'">'.htmlspecialchars($element->getButtonTitle()).'</a>'.$subHtml."</li>"."\n"; } } else { $html .= ' <li class="'.$class.'"><a>'.htmlspecialchars($element->getButtonTitle())."</a>\n".$subHtml."\n </li>\n"; } Heres the code, but I dont really know what to do, as I mentioned, I dont know php, and this code is php yes? 
|
|
 |
|
 |
|