Printable Membership Card?

3 years 3 months ago #322679 by AlexRag
Printable Membership Card? was created by AlexRag
I was looking for recommendation on adding the ability to have members print a membership card that would contain their name plan type and expiry date. I know we can customize the invoice so I was looking at starting there since the invoice can pull in data from the substitution feature.

Please Log in to join the conversation.

3 years 2 months ago #322689 by krileon
Replied by krileon on topic Printable Membership Card?
You could probably use a Joomla article since it has a built in print feature. You can use CB Content Bot to substitute the users information in. You'd then just customize it using CSS and HTML for them to print and cut out. If you want to generate an actual image file probably only way to do that is using a Code action and PHP image functions in CB Auto Actions to generate an image.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

3 years 2 months ago #322709 by AlexRag
Replied by AlexRag on topic Printable Membership Card?
These are two great ideas. If I'm not mistaken, I can create a tab in the users profile to embed the article or image.

The first one seems straight forward. The second one might be more like what I'd want (an image file). Can you point me towards more info on how to do that? I'm not entirely familiar with the process.

Please Log in to join the conversation.

3 years 2 months ago #322711 by krileon
Replied by krileon on topic Printable Membership Card?

These are two great ideas. If I'm not mistaken, I can create a tab in the users profile to embed the article or image.

Ideally your image would just make the appropriate PHP calls and then the auto action url would just be the src for the image tag. As for article I suppose if you used a Joomla article module then output the module in a Custom HTML field that'd work.

The first one seems straight forward. The second one might be more like what I'd want (an image file). Can you point me towards more info on how to do that? I'm not entirely familiar with the process.

It's not an easy implementation so I do not recommend it unless you're experienced with PHP. See the below PHP documentation for GD reference guide on how to generate an image. You can use this in a Code action with Method set to PHP.

www.php.net/manual/en/ref.image.php

A Joomla article with substitutions and simply using the articles built in print feature would be the easiest approach otherwise you may want to check if there's a Joomla extension for generating membership cards or consider hiring a developer experienced enough to write the PHP for you if you don't have enough experience yourself.

There are likely several examples on stackoverflow as well.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

3 years 2 months ago - 3 years 2 months ago #322713 by AlexRag
Replied by AlexRag on topic Printable Membership Card?
Thanks the extra info, Kyle.

I also came across this open source project that is used to generate PDF documents using PHP. I wonder is this is something consider too?
tcpdf.org/

In the meantime, I am trying the simple route of creating an article to make up a printable membership card as you suggest.
I was wondering what substitutions are available for the CB Subs information. What I wanted to do was include the following:

1. name [name]
2. membership plan name [?]
3. membership expiry date [?]

Optional:
4. plan image [cb_planimage] only displays the url to the image
5. avatar (i.e. profile image)

The minimum to be useful is the name and plan expiry date.

Please Log in to join the conversation.

3 years 2 months ago #322724 by krileon
Replied by krileon on topic Printable Membership Card?

2. membership plan name [?]

Check the description of the "cbpaidsubsbot" plugin in Extensions > Plugins for available CBSubs substitutions. For plan name you'd use the below for example.

[cbsubs:plans plan="PLAN_ID_HERE" output="name" /]

3. membership expiry date [?]

Same as #2 and is done as follows for example.

[cbsubs:subscriptions plan="PLAN_ID_HERE" output="expiry_date" /]

4. plan image [cb_planimage] only displays the url to the image

Please read the substitution tutorial below carefully.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

You're using a raw substitution so it's only going to display URL. Use the below for HTML output.

[cb:userfield field="FIELD_NAME" /]

5. avatar (i.e. profile image)

All profile fields are supported. See the above substitution tutorial for usage information.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.254 seconds

Facebook Twitter LinkedIn