Customizing auto-nav block

Permalink 1 user found helpful
Hi Team

OK I have an issue customizing the autonav block on the latest concrete5 version. I have looked thorough the market place and their are a couple of blocks which allow for image replacement but I don't need individual images depending on page. i just want a Simple gray dot for page and black dot for active. Having looked at the tutorials they all seem to be for older versions of code, if some one can point me to a relevant one that would also do if not please see problem below.

replace names with img.

echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '"><img src="./img/grey-dot.png" alt="0" height="10" width="10"> </a>';


Now this seems to replace the name as I deleted it and it calls the alt name but can't find the img path?

I have a folder in the the templates which i have copied to blocks folder to override.
In their I have the img/ folder with the images


Thanks For any Help
Carl
Ps I have just posted this twice but it didn't seem to post ?

carl101lee
 
adajad replied on at Permalink Reply
adajad
Don't know if this is the best way, but I guess it will work.

$grey_dot = '<img src="' . $this->getBlockURL() . '/templates/YOUR_TEMPLATE_NAME/img/grey-dot.png" alt="0" height="10" width="10" />';
echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $grey_dot . '</a>';
//or as a one liner
echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '"><img src="' . $this->getBlockURL() . '/templates/YOUR_TEMPLATE_NAME/img/grey-dot.png" alt="0" height="10" width="10" /></a>';
pvernaglia replied on at Permalink Reply
pvernaglia
You can do that with CSS, just add a background image to the li or a tags on for normal state and one for hover state. You son't need to make any adjustments to the autonav files, just add to your main.css
adajad replied on at Permalink Reply
adajad
That would work if he wanted text links as well, but as I understand it he want's to substitute the links with the images (and you can't click a background image).
carl101lee replied on at Permalink Reply
carl101lee
Hi All Thanks for the responses

The 1st fix did indeed work..


I also Used the second idea to add the active dot other the top using the class.

I would have done it all from the css preferred But I found with the basic template their are no assigned css class to the none active links, also like you said I ant sure they would be click able!

Um how ever I guess If I div of the nav bar and style all 'li' inside to have background images that would work.!

I have done it a strange way ATM have a look.

dev.sportoluations.com

Thanks for advise