How to add file type icons to links?

Discussion forum for MOD Writers regarding MOD Development.
Locked
atoirtap
Registered User
Posts: 63
Joined: Thu Aug 01, 2013 8:34 pm

How to add file type icons to links?

Post by atoirtap » Thu Apr 02, 2015 9:16 pm

Hi buddies, I would like to add some icons to links (as you guys do with KB links in this forum), but I'm not sure how to do it. I tried adding this (as an example) to content.css

a[href$='.pdf'] {
display:inline-block;
line-height:18px; /* check your icon height */
padding-right:20px;
background: transparent url('path/to/icon) center right no-repeat;
}

But with no results. Could anyone please give advice?
Last edited by atoirtap on Fri Apr 03, 2015 5:33 pm, edited 1 time in total.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51727
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: How to add file type icons to links?

Post by Brf » Thu Apr 02, 2015 9:17 pm

The KB links are made with a custom BBCode.

atoirtap
Registered User
Posts: 63
Joined: Thu Aug 01, 2013 8:34 pm

Re: How to add file type icons to links?

Post by atoirtap » Thu Apr 02, 2015 9:33 pm

Thanks for answeinrg, Brf. Anyway, could I do what I pretend with a minor hack of the default url bbcode?

atoirtap
Registered User
Posts: 63
Joined: Thu Aug 01, 2013 8:34 pm

Re: How to add file type icons to links?

Post by atoirtap » Fri Apr 03, 2015 5:33 pm

Anyone? :)

User avatar
ac_roma
Registered User
Posts: 304
Joined: Thu Mar 08, 2007 2:48 pm
Location: egypt,alexandria
Contact:

Re: How to add file type icons to links?

Post by ac_roma » Fri Apr 03, 2015 11:42 pm

with css i am surs will be awseme and best for sure

atoirtap
Registered User
Posts: 63
Joined: Thu Aug 01, 2013 8:34 pm

Re: How to add file type icons to links?

Post by atoirtap » Sat Apr 04, 2015 7:20 am

ac_roma wrote:with css i am surs will be awseme and best for sure
As I explained in my first post, I tried with css with no results. Thanks.

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: How to add file type icons to links?

Post by Oyabun1 » Sun May 03, 2015 10:26 am

Why reinvent the wheel? The Prime Links MOD can do that already.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

atoirtap
Registered User
Posts: 63
Joined: Thu Aug 01, 2013 8:34 pm

Re: How to add file type icons to links?

Post by atoirtap » Sun May 03, 2015 2:57 pm

Interesting, I'll have a look.

Anyway, if someone want to explore a css solution, try with

.postlink[href$='.pdf'] {
display:inline-block;
line-height:18px; /* check your icon height */
padding-right:20px;
background: transparent url('path/to/icon) center right no-repeat;
}

Locked

Return to “[3.0.x] MOD Writers Discussion”

cron