FORUM IS CLOSED. PLEASE USE QUESTIONS / ANSWERS PAGE INSTEAD
Login  |  Forum  |  Search   

Board index » Development » Help requests




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2, 3  Next
 
Author Message
 Post subject: Navigation images
 Post Posted: Thu Nov 24, 2011 6:07 pm 
Offline

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


Top 
 Profile  
 
 Post subject: Re: Navigation images
 Post Posted: Thu Nov 24, 2011 6:39 pm 
Offline
Project Developer

Joined: Tue Apr 28, 2009 9:43 am
Posts: 1720
Yo need to have two things:

1. Install associated images plugin that will let to add an image to each menu element.

http://www.impresspages.org/extensions/ ... ed-images/


2. Create your own menu generation class that outputs menu and add associated images.

http://www.impresspages.org/docs/workin ... ion-class/


Top 
 Profile  
 
 Post subject: Re: Navigation images
 Post Posted: Thu Nov 24, 2011 6:50 pm 
Offline

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?


Top 
 Profile  
 
 Post subject: Re: Navigation images
 Post Posted: Thu Nov 24, 2011 8:08 pm 
Offline
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.


Top 
 Profile  
 
 Post subject: Re: Navigation images
 Post Posted: Thu Nov 24, 2011 8:48 pm 
Offline

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


Top 
 Profile  
 
 Post subject: Re: Navigation images
 Post Posted: Thu Nov 24, 2011 9:04 pm 
Offline
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


Top 
 Profile  
 
 Post subject: Re: Navigation images
 Post Posted: Thu Nov 24, 2011 9:09 pm 
Offline

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? :(


Top 
 Profile  
 
 Post subject: Re: Navigation images
 Post Posted: Mon Nov 28, 2011 7:08 pm 
Offline

Joined: Thu Nov 24, 2011 6:04 pm
Posts: 20
Any help please?


Top 
 Profile  
 
 Post subject: Re: Navigation images
 Post Posted: Mon Nov 28, 2011 7:29 pm 
Offline
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.


Top 
 Profile  
 
 Post subject: Re: Navigation images
 Post Posted: Mon Nov 28, 2011 9:49 pm 
Offline

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? :shock:


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2, 3  Next

Board index » Development » Help requests


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron