Styling/Modifying an existing block
Permalink
First of all I'm fairly new to C5 and not a full time web dev. But the more I learn about C5 the more I like it. :)
I downloaded the free Login/Logout Link block from the market place. The them I am using has CSS button classes that can be applied to text in a content block. when applied the to the block the button class produced a button that spanned the width of the area rather than being sized according to the width of the button text and centered in the area.
I experimented with the view.php file and finally got the desired result. What I have works just fine but I believe there is a better or C5 way of doing this that preserves the original block.
This could be a good opportunity to learn a little more about C5. So I am looking for a little advice or direction with regard to C5 best practice. Any input will be greatly appreciated.
view.php
I downloaded the free Login/Logout Link block from the market place. The them I am using has CSS button classes that can be applied to text in a content block. when applied the to the block the button class produced a button that spanned the width of the area rather than being sized according to the width of the button text and centered in the area.
I experimented with the view.php file and finally got the desired result. What I have works just fine but I believe there is a better or C5 way of doing this that preserves the original block.
This could be a good opportunity to learn a little more about C5. So I am looking for a little advice or direction with regard to C5 best practice. Any input will be greatly appreciated.
view.php
Thank you very much, that's exactly what I was looking for. Jordif already told me about #1 and that worked great. I'm thrilled to learn about #2 because I had been wondering about how to make custom block templates but hadn't yet found enough time to pursue it specifically.
Since we are on the subject may I ask if custom page templates are created in the same or similar manner?
I feel that I really made the right choice to go with C5,
Since we are on the subject may I ask if custom page templates are created in the same or similar manner?
I feel that I really made the right choice to go with C5,
Thank you very much, that's exactly what I was looking for. Jordif already told me about #1 and that worked great. I'm thrilled to learn about #2 because I had been wondering about how to make custom block templates but hadn't yet found enough time to pursue it specifically.
Since we are on the subject may I ask if custom page templates are created in the same or similar manner?
I feel that I really made the right choice to go with C5,
Since we are on the subject may I ask if custom page templates are created in the same or similar manner?
I feel that I really made the right choice to go with C5,
1) If you want this style applied every single block of this type you could just copy the view.php from /packages/package_name/blocks/block_name/view.php to /application/blocks/block_name/view.php
2) If you only want these styles in certain places not everywhere you could create a custom template, to do that you would copy /packages/package_name/blocks/block_name/view.php to /application/blocks/block_name/templates/custom_template_name.php and then on your block you would go to the gear icon and under Custom Template select your custom template from the dropdown (if it isn't there clear your cache).