Judah Raine
Total posts: 332
27 Oct 2012 06:47

Hi there, I'm, feeling sooo stupid. I've been trying to alter the "component heading" on a submission form but cannot find where?? Currently it reads "submit a review" (review is the type) but I want to be able to alter this to read "request a review". I have changed this as the page title in the menu setup but it hasn't altered the form at all. Assistance will be appreciated.thank you

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
27 Oct 2012 07:13

This may be done only by editing template com_cobalt/views/form/tmpl/default.php line 219.

<?php if ($this->tmpl_params->get('properties.form_heading', 1)): ?>

    <?php if($this->item->id):?>

        <h1 class="componentheading"><?php echo JText::sprintf('CTEDIT', $this->escape($this->type->name), $this->item->title); ?></h1>

    <?php else :?>

        <h1 class="componentheading"><?php echo JText::sprintf('CTSUBMIT', $this->escape($this->type->name)); ?></h1>

    <?php endif; ?>

<?php endif; ?>

All you need to do is to copy template, set it for type you need and replace this part to

REQUEST REVIEW

IN THE MEAN TIME I'LL ADD NEW PARAMETER TO form template. SO next version you will ahve it there.


Judah Raine
Total posts: 332
27 Oct 2012 07:17

Thank you! I did not expect a reply on a weekend, you're a very dedicated person!


Judah Raine
Total posts: 332
28 Oct 2012 07:59

I have copied, renamed (to review_requests.php) and amended the template by replacing the entire body of code with

Request a Review from CRR but it still doesn't show the new heading. I assume it's because I need to set the type? I have had another look but can't seem to find anything in this file or in the type parameters to set this. Submission form is set to review_requests but I now have a default_form_review_requests.php and review_requests.php? The first one does not have this code.


Sergey
Total posts: 13,748
29 Oct 2012 11:20
  1. You have to create copy of the template in template manager in backend.

  2. In content type parameters you have to chose this new created type for Submission Form.


Judah Raine
Total posts: 332
29 Oct 2012 12:59

Hmmm. As far as I am aware that is what I have done, but I'll delete and go back and redo just to make sure it's correct. I'll let you know if I have a problem..... Actually, I'm sure I did that, as that was how I got the defualt_form_review_requests.php. When I couldn't find the code in this one, I then copied the default.php and renamed it review_requests.php. But I'll go back and redo - things seem better since I reinstalled Cobalt earlier, so maybe this was part of that problem too.


Judah Raine
Total posts: 332
30 Oct 2012 04:50

I went and deleted the submission form for review_requests and recreated it from default template in back end. I now have 4 files for default_form_review_requests: css, json, php and xml. They are exact replicas of default_form_default: css, json, php and xml. The text you have given me above does not appear in either the default_form_review_requests.php or the default_form_default.php.

There is another file in this directory called: default.php. The text you have given appears in this file, but copying and renaming the template in backend did not create a review_requests version of this file. (I have checked and each of the template options, e.g. article, form, mark-up etc.) have had a review_requests copy created, so that cannot be the problem.

If I copy the default.php and rename to default_review_requests.php in my ftp client I can access this and change the text as explained above. However, this does not seem to link to type as nothing changes in the form display at all. (In type I have selected submission form as review_requests)

So, there must obviously be a way to link this particular (new) file to the type, but I cannot seem to find it.


Sergey
Total posts: 13,748
30 Oct 2012 05:42

YOu cannot copy default.php you can only override it in template.


Sergey
Total posts: 13,748
31 Oct 2012 01:50

Just wait till next update tomorrow. There will be new parameter for form title in form template parameters.


Judah Raine
Total posts: 332
31 Oct 2012 02:56

Thank you so much, it does simplify this, and I am grateful.

Powered by Cobalt