Forums

Show Page Heading not working?

tsili 20 Apr, 2011
Hi,

I am using Chronoforms_J1.6_V4_RC1.8 with Joomla 1.6.8 (just installed it).
I have created a new menu for my form. Everything seems to work fine except from the Page Heading: I have set 'Show Page Heading' to yes and I have entered something in the 'Page Heading' parameter. However the form displays without any heading.
Can someone help please?

Cheers!
GreyHead 20 Apr, 2011
Hi tsili,

I don't think that ChronoForms has ever supported Page Headings in that way. I guess it shouldn't be too hard to add. Do you know what code is used to do this in an article page?

Bob
tsili 20 Apr, 2011
Hi GreyHead and thanx very much for the quick response.
The code used is something like that:
<?php if ($this->params->def('show_page_heading', 1)) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
This should be added somewhere around
echo $form->form_output;
in components\com_chronoforms\chronoforms.html.php

but I haven't figured out yet how...
Max_admin 21 Apr, 2011
Hi,

You may add your code above the
echo $form->form_output;
line, please let us know if it works fine!🙂

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
tsili 26 Apr, 2011
Hi,

I've tried but $this is giving me an error.
Should I change anything in the code?
tsili 27 Apr, 2011
OK guys I found it. My solution displays all page headings (I wanted to display all, so I didn;t bother checking if page_heading is set).

The solution is the following:

edit the file /components/com_chronoforms.html.php before the end:

Replace
echo $form->form_output;

with:

$menus = &JSite::getMenu(); //returns JMenuSite object
        $menu= $menus->getActive(); //gets current page menu item properties

        //retrieve page parameters
        $params = new JParameter( $menu->params );

        $page_heading = $params->get('page_heading');
        echo "<div class=\"item-page\"><h1 class=\"componentheading\">" . $page_heading . "</h1>" . $form->form_output . "</div>";


Hope this helps anyone in the same situation.

Cheers
Max_admin 29 Apr, 2011
Nice solution, thanks for posting!🙂

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
ccondrup 26 Jul, 2012
Thanks a lot!
I would very much like to see this in place in Chrono core so it's not overwritten on next update. (but please work around the use of JParameter which is deprecated).
This topic is locked and no more replies can be posted.