Giorgi625 VIP
Total posts: 655
07 Feb 2019 13:13

I think this is the one from very few things I don't like in Cobalt, that some items like system buttons(bookmark, follow,configure) and some remplate related items are controled not from template folders but from different place.

I am updating my site to Bootstrap 4. I have created Custom BS4 templates, but as you can see from image below, follow section button, bookmark and follow record button look like buttons from Windows 98. They look so, because they have attribute type="button" but I can't edit in template file, it is called from somewhere else.

https://i.postimg.cc/1tpnGD1T/cobbtn.jpg

Same is with page like where I set up Modersators for section. Code which call's modal windows with user list is called from a libraty files as I remember and I am not able to override it but edit, which will be overwritten once new udpate comes out. So I am forced to created new menu item for this page and assign it to Protostar template to make it work correctly.

Last Modified: 17 Feb 2019


Sergey
Total posts: 13,748
07 Feb 2019 13:39

I'll see if ш can fix this in Cobalt 9 for Joomla 4.


Giorgi625 VIP
Total posts: 655
07 Feb 2019 18:05

Sergey I'll see if ш can fix this in Cobalt 9 for Joomla 4.

This will be good, for now can you tell me where can I find code which generates this buttons? I only need to remove attribute type. It will solve my current problem.


Sergey
Total posts: 13,748
08 Feb 2019 11:28

Look at this code

<?php if($this->user->get('id')):?>
    <?php echo HTMLFormatHelper::bookmark($item, $this->type, $params);?>
    <?php echo HTMLFormatHelper::follow($item, $this->section);?>
    <?php echo HTMLFormatHelper::repost($item, $this->section);?>
    <?php if($item->controls):?>
        <a href="#" data-toggle="dropdown" class="dropdown-toggle btn btn-mini">
            <?php echo HTMLFormatHelper::icon('gear.png');  ?></a>
        <ul class="dropdown-menu">
            <?php echo list_controls($item->controls);?>
        </ul>
    <?php endif;?>
<?php endif;?>

This is from default article template.The function list_controls is it components/com_cobalt/library/php/helpers/helper.php

What you can do is to catch content to variable first. And then format it.

$bm = HTMLFormatHelper::bookmark($item, $this->type, $params);
$bm = str_replace("something", "", $bm);
echo $bm;

I think you've got an idea.


Giorgi625 VIP
Total posts: 655
08 Feb 2019 12:57

Yeap, I got it.

Thanks


pepperstreet VIP
Total posts: 3,837
16 Feb 2019 13:50

Sergey
Look at this code...
This is from default article template.
The function list_controls is it components/com_cobalt/library/php/helpers/helper.php

Maybe it is a good idea to remove formatting and markup from a core helper file.
In the future, wouldn't it be smarter and more versatile to put it in jLayouts.


Sergey
Total posts: 13,748
17 Feb 2019 07:01

pepperstreet In the future, wouldn't it be smarter and more versatile to put it in jLayouts.

Yes, I'll do that for Cobalt 9 for J4


Giorgi625 VIP
Total posts: 655
17 Feb 2019 13:31

I will write about my another problem here which is partially related to problem in this topic. So I want to edit look of multilevelselect field in submission form page. There are some problems. One I think I have solved. So I have removed it from this post. Another is to give to select elements class >> form-control. How can I do this?

SOLVED

Powered by Cobalt