Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Topic closed
[archived] xkl_contact_card: contact cards
Notice: This thread is archived, this plugin is no longer available.
**********************************************************
This is my first attempt at a plugin, and since I’m still not familiar with much of textpattern, there’s probably a lot of stuff that could have been done better.
Currently:
This plugin will display contact “cards” for each registered member (set up in textpattern admin – site admin). A contact card is a block with the real name, title (set in Priviledges), and an e-mail link (Contact whoever).
By default, the tag will output a card for each member, but you can specify the loginname/username to output a card for that member. There is also an option to hide the email link.
I wrote some documentation which describes most of the options.
see it in action – 1 card with the dca_mailto_form plugin
The site I’m using it on is currently in development.
To Do:
Add an option to display lists by title
Add sorting options
If I learn enough about textpattern, make my plugin more user-friendly.
If anyone is feeling charitable:
I’d like to make this into a full business card plugin, where I can use avatars, add address/phone number fields, etc. If there are any ideas on where to find the info to do this (API documentation, etc.), I’m all ears (or is it eyes).
Note:
This hasn’t been vigorously tested, but it’s working the way I expect on my site. Any feedback is greatly appreciated.
Last edited by nimnix (2004-06-17 20:42:24)
textpattern.org :: find and share Textpattern resources
textpattern.net :: TextBook – Textpattern wiki
Offline
Re: [archived] xkl_contact_card: contact cards
Nice idea,
Now we just need Dean to sort out those privileges.
Offline
Re: [archived] xkl_contact_card: contact cards
nimnix excellent idea.. just in case it helps look the “business cards” that are using in http://www.thefeature.com/
It might give you other ideas :)
Offline
Re: [archived] xkl_contact_card: contact cards
That’s exactly the kind of thing I’m going for. Now I just need to figure out avatars, or custom db tables, or something…
textpattern.org :: find and share Textpattern resources
textpattern.net :: TextBook – Textpattern wiki
Offline
Re: [archived] xkl_contact_card: contact cards
Ok, I’ve added a basic image lookup to it.
If you specify that you want to display images, (img = “1” or “yes” or whatever), it will search in the image directory for images that are named username.ext, where ext is gif, jpg, or png.
The image “name” is the one you assign to it in admin, when you upload or edit an image.
The image is in a “fieldtag” (span by default) with class name cc_image.
******
from the documentation
******
Basic Tag: <txp:xkl_contact_card />
By default, this tag will display a contact card for each member.
Basic Tag with images: <txp:xkl_contact_card img=“yes” />
This will display an image in the card for each user that has one.
Options:
noemail – set this option if you don’t want the e-mail link displayed
img – set this option if you want to display a user image. This looks for images with the name username.ext, for example: jane.jpg.
username – this will only display the card for the specified user (login name)
class – to specify a different class from contact_card
nl – this is the whitespace used to separate each field. must be “br”, “hr”, or other self-closed tags. default: “br”
conttag – this is the wrapper around the card itself. default is “div”. must be “div”, “span”, or other open tags.
fieldtag – this is the wrapper around each field. default is “span”.
Examples:
Example 1:
<txp:xkl_contact_card class=“stafflist” conttag=“span” nl=“img src=‘images/5.gif’” noemail=“1” img=“yes” />
This outputs a list like this:
—
[username1.jpg] Name 1(img5)Title 1
Name 2(img5)Title 2 (this user has no image associated.)
[username3.gif] Name 3(img5)Title 3
—
With the class “stafflist” in a span tag.
Example 2: <txp:xkl_contact_card username=“jane” img=“yes” />
This outputs a basic contact card for the user “jane”.
Last edited by nimnix (2004-06-17 20:43:20)
textpattern.org :: find and share Textpattern resources
textpattern.net :: TextBook – Textpattern wiki
Offline
Re: [archived] xkl_contact_card: contact cards
I’ve moved the site out of the subdirectory, so I changed the link to view
textpattern.org :: find and share Textpattern resources
textpattern.net :: TextBook – Textpattern wiki
Offline
Pages: 1
Topic closed