where to edit the "Register (Individual)" button?

  • thepiston
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 11 months ago #80086 by thepiston
In what file would I edit the Register (Individual) button so I can give it a new class? thanks

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago - 9 years 11 months ago #80090 by James Riley
Replied by James Riley on topic where to edit the "Register (Individual)" button?
Rather than editing core files, I've edited the translation to add a <div> with a class so as to target the text.

When CSS parent selectors become widely adopted, this will become the easy way of targeting the button :)

But for now, if you need to target the <a> on the actual button itself, then you will need to edit core code. As you can see in my above screenshot, the translation tag for this button's text is "EB_REGISTER_INDIVIDUAL", so we just need to search the component for all uses of that tag (you'll need to modify each location in each file). Here's the list:

Find the EB_REGISTER_INDIVIDUAL in each file, and add your class into the existing class="btn" that you will see on the same line as the EB_REGISTER_INDIVIDUAL.

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 9 years 11 months ago by James Riley. Reason: Added additional instruction.

Please Log in or Create an account to join the conversation.

  • thepiston
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 11 months ago #80091 by thepiston
yep, I need to add a class to the a tag

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #80092 by James Riley
Replied by James Riley on topic where to edit the "Register (Individual)" button?

thepiston wrote: yep, I need to add a class to the a tag

Edit the [strike]5[/strike] 4 files listed in my (revised) screenshot and look for the EB_REGISTER_INDIVIDUAL tag, and add your class into the class="btn" that you will see near each EB_REGISTER_INDIVIDUAL,

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

Please Log in or Create an account to join the conversation.

  • thepiston
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 11 months ago #80093 by thepiston
thanks. In these files the class is actually defined by a variable but I can't find that variable in the global options. I could change it manually but would be better if I could change that variable:

<a class="<?php echo $btnClass; ?>"

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #80102 by James Riley
Replied by James Riley on topic where to edit the "Register (Individual)" button?
That will be a global button class that will apply to ALL buttons used by Event Booking (Group, Details, Process Registration, etc), so you won't want to change that unless you want to effect all those too.
Just add your custom class here <a class="<?php echo $btnClass; ?> YOUR_CLASS" (a space after the ?>, and before the closing ".
I can do some digging to see when the $btnClass variable is defined if you need to change ALL buttons to your new class (or @Tuan probably knows exactly where and can tell you as soon as he sees this thread).

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #80107 by James Riley
Replied by James Riley on topic where to edit the "Register (Individual)" button?
Looks like it calls on Bootstrap's default button class ( $btnClass = $this->bootstrapHelper->getClassMapping('btn'); ), you you'd have to really start diving deep into core code to change the $btnClass variable :( EventBooking's bootstrapHelper>getClassMapping file doesn't have code in to handle the ('btn') option, so I'm guessing that EB hands the 'btn' request off to BootStrap or some other file for handling... I don't see where an additional class could be added within EB's bootstrapHelper>getClassMapping function.

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #80119 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic where to edit the "Register (Individual)" button?
Look at the file components/com_eventbooking/helper/bootstrap.php, you should see the mapping and can change it to meet your need

Tuan

Please Log in or Create an account to join the conversation.

  • thepiston
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 7 months ago #85950 by thepiston

Tuan Pham Ngoc wrote: Look at the file components/com_eventbooking/helper/bootstrap.php, you should see the mapping and can change it to meet your need

Tuan

Tuan, I looked in that file but do not see the $btnClass variable

Can we have that as a Global Configuration variable so we can have the same look of button across our website?

Thanks

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #85956 by James Riley
Replied by James Riley on topic where to edit the "Register (Individual)" button?
Many templates use the .btn class to define the look of their buttons, but some don't (eg. one of my sites running a 3rd-party ThemExpert template defines the .btn class, but another site running a modified Beez3 stock template does not have the class defined...). Event Booking makes use of this standard .btn class but does not define it itself (otherwise it would override your site's .btn classing).

You will need to take a look at what your site applies to your buttons and introduce a .btn class either as part of your site's template css or in EB's /media/com_eventbooking/assets/css/custom.css file. If you post a link to your site (preferably a page where I can see an example of one of your site's styled buttons), I can help guide you further :)

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc