solved How Can I Change Button Icons?

PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
I see this code in the profile_header.tpl:
{jrCore_item_create_button module="jrProfile" view="create" profile_id=$_profile_id title="Create new Profile"}

Which generates:
<a href="https://assemble-together.org/profile/create" title="Create new Profile" onclick="jrCore_window_location('https://assemble-together.org/profile/create');return false"><span class="sprite_icon sprite_icon_30"><span class="sprite_icon_30 sprite_icon_30_img sprite_icon_30_plus">&nbsp;</span></span></a>

Where do I go to change the button icon?


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3

updated by @the-patria-company: 10/12/16 06:00:12PM
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
You can use icon="hand.png" if you want another of the core icons (which are in /modules/jrCore/img/icons_black/)

Or if you have the image in your skin directory use image="your_custom_image.png" where your_custom_image.png is in the active skin /img directory


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
How can I register new icons that are added to the directory? /modules/jrCore/img/icons_black/

I tried using the image="my.png", but the img css messes it all up.

I can easily add the icon to the folder, but it shows a different icon on the page, not the one in my code. Even though I can see that the html is correct on my browser:
<span class="sprite_icon_30 sprite_icon_30_img sprite_icon_30_profile_m.png">&nbsp;</span>

I shows the down arrow, not my custom icon profile_m.png

Thanks!


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3
brian
@brian
8 years ago
10,148 posts
You can't add anything to the core - you need to add them in your custom skin.

Create the directories:

skins/YourSkin/img/icon_black
skins/YourSkin/img/icon_white

Put your icon images inside (should be 64x64 pixels in size).

Then ACP -> Reset Caches and make sure the "reset icon cache" is checked.

Then you can do:

{jrCore_icon icon="custom" size=30}
Which would line up with "custom.png" in your directory.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
Sorry for being so dense sometimes, but I am just not sure where to place the code. Here is the original:

{jrCore_item_create_button module="jrProfile" view="create" profile_id=$_profile_id title="Create new Profile" icon="profile_m.png"}

But of course the custom icon did not work. I tried this, but it did not work:

{jrCore_item_create_button module="jrProfile" view="create" profile_id=$_profile_id title="Create new Profile" {jrCore_icon icon="custom" size=30}}

Where should I put the icon code?


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
OK, I got this to work.

<a href="{$jamroom_url}/profile/create" title="Create new Profile">{jrCore_icon icon="profile_m" size=30}</a>

Can you see any long term problems with using it?


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
Yes, there was a problem with this specific example. It needs to be wrapped by an if statement so that it is only visible to the profile owner.
{if jrProfile_is_profile_owner($_profile_id)}

Then it works great.

*** We had some members that were confused by all of the PLUS "+" icon buttons. So now they have a "silhouette with a plus" icon button for creating new profiles. ***

Thanks for the help guys!!


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3
brian
@brian
8 years ago
10,148 posts
You can just add an "icon" parameter:
{jrCore_item_create_button module="jrProfile" view="create" profile_id=$_profile_id title="Create new Profile" icon="custom"}



--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
Thank you!! I have this working really nice now. :)


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3

Tags