How to use "Additional classes" ?

Permalink Browser Info Environment
Hi,

I did'nt find any documentation about how to use the "Additional classes" input field of a Button-Pro button.
For example, how to get an event action running like this:

onclick="window.history.back()"

Best wishes
Danny

Type: Pre-Sale
Status: Resolved
Resipisco
View Replies:
mnakalay replied on at Permalink Reply
mnakalay
Hello,

The additional classes filed is not for javascript, it is for css classes but you can then use those classes to hook any js function you want.

With your code what you could do is
1- put a class name in the additional class field. For instance "history-back" without the quotation marks
2- In your theme add the following javascript:
$( document ).ready(function() {
    $('.history-back').on('click', function() {
        window.history.back();
    });
});


The easiest way to add this to your theme without having to edit any file directly would be to add it to your footer through your dashboard's tracking codes page. It's at dashboard/system/seo/codes.

Let me know if it works for you.
Resipisco replied on at Permalink Reply
Resipisco
Hi,
thanks for your quick response.
It works perfect !!!!

May I ask you what code I can use to call a stack content (e.g. helpstack_<pageID>) in a light-box by that way. This would give me the oportunity to use button-pro for "Help-Buttons" on my website.

Or maybe you like to extend the next Version of button-pro with such functionallity to trigger a stack in a light-box?

Best wishes
Danny

Best wishes
Danny
mnakalay replied on at Permalink Reply
mnakalay
Hi,
I'm glad it worked for you.

Concerning the idea of putting a stack in an overlay called by a Buttons Pro button, I do have plans to add that functionality, as well as a pop over and maybe other stuff. But truth is I do not know when I'll have the time.

Meanwhile, the easiest solution would be to get an existing package from the marketplace that allows you to get a stack in a popup and use Buttons Pro in a template for the block. Buttons Pro was built to be used within other blocks so it would be easy to do that.

The good news is if you find a package that does what you want, I am totally happy to make the template for you to integrate Buttons Pro.

The bad news is I believe there is only one package in the market place that actually does what you want with a stack, it costs $30 and hasn't been approved yet so you won't be able to buy it just yet. It's called EZ modal. There is another one that doesn't use stacks but uses a content block so it might work for you as well.
mnakalay replied on at Permalink Reply
mnakalay
Actually I was wrong, there is another add-on called stack popover that does what you want. The name was misleading so I didn't think it was right at first, but their video shows what it does and it seems it would work for you
Resipisco replied on at Permalink Reply
Resipisco
Hi,

I have this add-on but it Supports only text and pictures.
And if I have to code in the add-on templates I face the problem nr. 1 of all add-on.
With running an update, it will delete all files before and do not care about my changes or additional files in it. That means I have to care about the change documentation and need to do it again after updating.

Best wishes
Danny
mnakalay replied on at Permalink Reply
mnakalay
Hi again,

I see what you mean, if you modify the add-on and let it update you will loose everything.

But if you use templates, you will not loose them at all.

What you must do is put the template for the block in the applications/blocks folder.

Say you have a template for a block with a handle of my_block you put your template in applications/blocks/my_block/templates/name_of_your_template

When the add-on gets an update, your template stays where it is.

Would that help?
Resipisco replied on at Permalink Reply
Resipisco
Hi,
that sounds good (but as long as the template stays compatible to all updates).
Thanks for your support!!
Best wishes
Danny
mnakalay replied on at Permalink Reply
mnakalay
You are welcome. Let me know if you need help to set up Buttons Pro in your template.

If you had the time, I'd really appreciate if you could leave a review for buttons Pro. Reviews from actual users are one of the most important source of information other users pay attention to so it's really helpful.

You can do it here:https://www.concrete5.org/marketplace/addons/buttons-pro/reviews/...
mnakalay replied on at Permalink Reply
mnakalay
Hello again,
I am happy to tell you that Buttons Pro, now renamed Buttons Factory Pro, now includes a popup add-on that allows the use of either a stack or a video

concrete5 Environment Information

C5 v5.7.5.9

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36

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.