Customize existing block

Permalink 1 user found helpful
Hello,

I'm a C5 newbie. I'm follow a video how integrate a html-template, so far so good.
Now i'm adding the featured block, but if adding this block, the font awesome icon placed on the left side and the title on the right side.
Founding the block here 'concrete/blocks/feature/view.php'
How can i overriding this block with my own html-code?

 
brutalnv replied on at Permalink Reply
brutalnv
Hello!

You must create a folder /application/blocks/feature/
and put your custom view.php, view.css and view.js into it. That's all.

Regards, Nick
ctuxboy replied on at Permalink Reply
Hi Nick,

Thanks for your help. I'm do a lot a research, so i do my first steps with C5. Follow your answer, but doens't work. For a newbie it is not so easy to understand :-s

When i'm use C5 for a few months, then i think understand the minimum information you give.

But at the moment trying learning C5, so hope more a step-by-step guide for the first time.

So, first i'm searching where can found this files (view.php, view.css and view.js).
Found it in:
../concrete/blocks/feature/templates/hover_description/
I think this is not the right place!?

Then found a view.php in:
../concrete/blocks/feature/
and for testing, replace '<h4>' with '<h1>' (see code below).
Paste this view.php in:
../application/blocks/feature/view.php

But this gives no effect on the webpage.

<?php  defined('C5_EXECUTE') or die("Access Denied."); ?>
<?php
$title = h($title);
if ($linkURL) {
    $title = '<a href="' . $linkURL . '">' . $title . '</a>';
}
?>
<div class="ccm-block-feature-item">
    <?php if ($title) {
    ?>
        <h1><i class="fa fa-<?=$icon?>"></i> <?=$title?></h1>
    <?php
} ?>
    <?php
    if ($paragraph) {
brutalnv replied on at Permalink Reply
brutalnv
You must turn off overrides caching via Dashboard > System & Settings > Optimization > Cache & Speed Settings. Until this is turned off Concrete5 won't look in the application directory unless it knows it has a file in there.

Just create a copy of view.php from /concrete/blocks/feature/ to /application/blocks/feature/view.php and make your edits after that.
ctuxboy replied on at Permalink Reply 1 Attachment
Hi @brutalnv,

Thanks for the help!
Now it works and your answer is clearify for me. Happy with this :-)
In the screenshot you can see that i'm adding the <br>-tag, so i see the effect in my page.

I'm working several years with WP, and do some minor changes in the WP core also build simple plugins.
The only thing that i'm afraid about C5, i have no OOP knowledge.
I will try myself working with C5 and hope not confused if i want small modifications in the core it's to difficult. :-/

If you have some good tips or starting points. (Follow some video's on youTube and read in the C5 documentation).

(sorry for my poor english)

Regards,
Christophe
brutalnv replied on at Permalink Reply
brutalnv
Hi Christophe!

Well, I believe that the best starting point for you is to study the developers documentation together with code review of any free add-ons that you can find in the c5 marketplace.

Write to me, if you have any questions. I will try to help you as much as I can.

Regards, Nick.
ctuxboy replied on at Permalink Reply
Hi,

Thank you Nick!

I appreciate it a lot :-)

Today, try following this tutorial:
https://documentation.concrete5.org/developers/working-with-blocks...

I think indeed downloading blocks and other stuff from the marketplace and see how they are developed :-)

Regards,
Christophe