Link Styling
Permalink Browser Info Environment
Is it possible to specify a CSS class the link? I am using the Framework theme and it has a number of button classes that can be applied to text in content blocks. It ends up in html as "<p class=...">text</p>. If only I could do something similar with your block it would be perfect for what I need.
So if it's not possible to specify the class using your block is there an alternative where I could hardcode something in an HTML block?
Thanks
Rick
So if it's not possible to specify the class using your block is there an alternative where I could hardcode something in an HTML block?
Thanks
Rick
Type: | Pre-Sale |
---|---|
Status: | In Progress |
Hi Jordif,
Yes I tried that and it created a button spanning the width of the block. What I wanted was a button sized to the width of the text centered in the area where I placed the block. I was able to hack the view.php file as I explain below. It's working now to my satisfaction but I am curious about what is the proper C5 way of implementing my solution. This could be an opportunity to learn more about C5 development.
Yes I tried that and it created a button spanning the width of the block. What I wanted was a button sized to the width of the text centered in the area where I placed the block. I was able to hack the view.php file as I explain below. It's working now to my satisfaction but I am curious about what is the proper C5 way of implementing my solution. This could be an opportunity to learn more about C5 development.
Hi,
glad you got it working!
The recommended way would be to copy the hacked view.php file under the following path:
/application/blocks/login_logout_link/
If you edit the original files, the changes will be lost if you ever update the add-on. So the proper way is to override the file by placing a copy under /application.
More info:
http://documentation.concrete5.org/tutorials/override-almost-any-co...
Jordi
glad you got it working!
The recommended way would be to copy the hacked view.php file under the following path:
/application/blocks/login_logout_link/
If you edit the original files, the changes will be lost if you ever update the add-on. So the proper way is to override the file by placing a copy under /application.
More info:
http://documentation.concrete5.org/tutorials/override-almost-any-co...
Jordi
Ok, I successfully hacked the view.php file to get it working the way I want. There were two problems applying the btn, btn-primary classes to the block. The first problem was that the button covered the full width of the block. After that was solved there was a problem centering the button, because the length of text is not known until after the php function returns. The solution was to specify a div width of 125px that corresponds to the width of the button text.
You could try this:
1. Edit the block and select "SPAN" as the formatting style. Then save the block.
2. Click on the block and choose "Design & Custom template". Click on the "Gear icon" and enter the classes in the "Custom class" box. For instance, try entering the following classes: btn btn-default
Hope this helps
Jordi