Posted in wrong section: Need to insert Image/Icon in place of text for a single page

Permalink Browser Info Environment
They want the ability to use an image or icon on select navigation items. Is there a simple way to swap out the text for an image in the default navigation? I accomplished this a while back with the Dot Awesome Warm theme by creating 2 page attributes, pic_on and pic_off, but I am not sure what to swap or add in the autonav code.

Type: Discussion
Status: Resolved
barkingtuna
View Replies:
MichaelG replied on at Permalink Reply
MichaelG
in autonav, /packages/grounds_earth/blocks/autonav/templates/vivid_nav.php

you could likely do something like this (after you've made the image attribute)

$cObj = $ni->cObj; //gets the page object
    $img = $cObj->getAttribute("image_attr_handle");
    echo '<li class="' . $ni->classes . '">'; //opens a nav item
    echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $ni->name . $img->getRelativePath(). '</a>';


This is untested, just off the top of my head, but it should get you there or at least a starting point
MichaelG replied on at Permalink Reply
MichaelG
that would essentially replace line 85-89.
barkingtuna replied on at Permalink Reply 1 Attachment
barkingtuna
Hmmm... the row numbers in the vivd_nav.php file I have don't line up. See attached screenshot. Would you mind copying/pasting the exact code that I should try swapping?
Thanks!
MichaelG replied on at Permalink Reply 1 Attachment
MichaelG
Hopefully this is still valuable. :)
I made some comments about what I added, but if you'd like a further explanation, let me know

concrete5 Environment Information

# concrete5 Version
5.6.3.1

# concrete5 Packages
Add Multiple Pages (2.1.1), Attributes Slider (1.0.2), Content Around Image (1.23), Dashboard Maximizer (2.0.4), eCommerce (2.8.12), Formigo Social Links (1.0), Get Directions (1.0b), Google Map (Premium) (2.1), Grounds (1.0.1), Page Redirect (1.4), Page Selector Attribute (1.1), Pro Events (11.1.0), Pro News (5.1.0), Tweetcrete (1.7).

# concrete5 Overrides
blocks/simple_logo_grounds, blocks/form, blocks/simple_hr_grounds, blocks/product_list, blocks/image, blocks/simple_button_grounds, blocks/cart_links, blocks/google_map, blocks/pro_event_list, blocks/autonav, blocks/problog_list, blocks/simple_locations_grounds, blocks/simple_slider_grounds, blocks/homepage_ctas_grounds, blocks/product, elements/product, languages/el_GR, languages/ar, languages/vi_VN, languages/sk_SK, languages/nl_NL, languages/ro_RO, languages/zh_CN, languages/fa_IR, languages/ru_RU, languages/da_DK, languages/tr_TR, languages/it_IT, languages/fr_FR, languages/es_AR, languages/es_ES, languages/zh_TW, languages/nb_NO, languages/es_MX, languages/sl_SI, languages/pt_PT, languages/cs_CZ, languages/ja_JP, languages/sv_SE, languages/de_DE, languages/he_IL, languages/fi_FI, languages/es_PE, mail/block_form_submission.php, themes/Vivo

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - In all cases.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
5.4.34

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, enchant, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, json, ldap, libxml, mbstring, mcrypt, mhash, mysql, mysqli, odbc, openssl, pcntl, pcre, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, readline, recode, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend Guard Loader, zip, zlib.

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 50M
sql.safe_mode - Off
upload_max_filesize - 50M
ldap.max_links - Unlimited
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.