tmatbcorp VIP
Total posts: 41
18 Dec 2014 10:56

Hi,

I am currently migrating that website from Joomla 2.5.8 to 3.3.6 and thus migrating Cobalt from 7 to 8.

I am having trouble migrating this page, due to the search form.

What was done before (J2.5):

  • in Sections, mySection, General parameters, Templates, we had custom_filters_tpl set for Filters template
  • in Types, Fields, myField, we had enable filter set to Yes
  • in default_markup_myApp_articles.php, we had the code
        <?php if($this->section->params->get('general.tmpl_filters')):?>
            <?php echo $this->loadTemplate('filters_'.$this->section->params->get('general.tmpl_filters', 'default'));?>
        <?php endif;?>
  • a custom template default_filters_myFilter.php looped on $this->filters

Now (J3.3): - filters templates are not longer available in Sections, mySection, General parameters, Templates - Types, Fields, myField still has enable filter set to Yes - default_markup_myApp_articles.php adminForm form is updated (copied from default_markup_default.php)

And I have no idea what to do next.

Right now, no filter is displayed on the page, and in $markup, I can see

public 'filters' => 
        object(stdClass)[818]
          public 'filters' => string '0' (length=1)

I have tried using Cobalt Filters Module module (not sure it is made for what I need) and I have created a module for mySection but it has not effect.

Could you please help me:

  • how to link the fields I want to filter on to $markup->filters->filters?
  • how to call the custom filter template default_filters_myFilter.php?

Thank you for any help you can provide.

Last Modified: 19 Dec 2014

Comments have been disabled for this article and works only in read only mode.

Sergey
Total posts: 13,748
19 Dec 2014 04:58

In Cobalt 8, there is no filter template anymore. Filter template is build inside markup template. Why? Because before you caouls only position your filters in one place in cobalt. now with markup you can place filters in right or left column, over or ander menu or section title.

The point is, when you migrate from 7 to 8 you cannot reuse your templates. Simply because in 8 we have different templates struture and all templates are based on twitter bootstrap which is another important fact.

My suggection would be to start with default templates provided with cobalt 8. In your section and type, select all default templates, and then start to build your new view based on ajastments of those templates.


tmatbcorp VIP
Total posts: 41
19 Dec 2014 16:09

OK I fixed my problem by editing default_markup_myApp_articles.php.

$this->filters is available in markup template, I then just edited the filter part to get the display I want.

It could surely be done more beautifully but unfortunately I do not have time to look further. Anyway it is now working properly.

Thank you for your help.

Powered by Cobalt