[SOLVED] CGFeedback textarea -- display line returns?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
twwitt
Forum Members
Forum Members
Posts: 149
Joined: Thu Aug 28, 2008 7:45 pm

[SOLVED] CGFeedback textarea -- display line returns?

Post by twwitt »

Hi -- I'm using CGFeedback 1.511. with CMSMS 1.11.4.

My client would like carriage returns within the Text Area response to be displayed when the comment is posted. (Currently, even if a responder makes a hard return, the comment appears as one long paragraph). Maybe this has to do with how all Text Areas behave?

Can somebody give me a clue as to how to enable paragraph returns in this module?

Thanks in advance.
Last edited by twwitt on Mon Dec 16, 2013 11:43 pm, edited 1 time in total.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: CGFeedback textarea -- possible to display line returns?

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
twwitt
Forum Members
Forum Members
Posts: 149
Joined: Thu Aug 28, 2008 7:45 pm

Re: CGFeedback textarea -- possible to display line returns?

Post by twwitt »

Thanks for responding. I'm not 100% sure in a Feedback template to put the |nl2br modifier (in the Summary Template in {$one.data}??)

But the problem seems that ALL of the formatting (hard returns, soft returns, etc,) is stripped out of the responses typed in the text area. Would this solution correct this?
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: CGFeedback textarea -- possible to display line returns?

Post by Wishbone »

twwitt wrote:Thanks for responding. I'm not 100% sure in a Feedback template to put the |nl2br modifier (in the Summary Template in {$one.data}??)
Whatever variable displays the text, put |nl2br after it.

Example: {$myvar.text|nl2br}
twwitt
Forum Members
Forum Members
Posts: 149
Joined: Thu Aug 28, 2008 7:45 pm

Re: CGFeedback textarea -- possible to display line returns?

Post by twwitt »

Thanks. I believe the change should be {$one.data|nl2br} if I'm reading the Summary Template correctly (see full template below). However, changing this has no effect on keeping line returns.

What does have an effect on keeping line returns in comment responses is this:

In CGFeedback settings, if I choose NO for "Allow use of the wysiwyg editor for comments?" (formerly, it was YES -- even though a wysiwyg editor does not appear on the website for the commenter to use, only in the admin for the administrator to use-- is this the intended result for saying yes to this selection?) and if I choose YES for "Allow commenter to include html in comments", then the formatting is correctly retained, though the wysiwyg disappears from the admin Edit Comments page (I assume this is the intended result?).

It's recommended in the Module to not enable the wysiwyg editor at the same time as allowing the commentor to include html in comments.

So, is this my solution, then? "Allow commentor to include html in comments" but then to disable the wysiwyg editor in the admin?

Summary template below:

Code: Select all

{* summary template *}
<div id="cgfeedback_report">
<div id="{$actionid}_feedback_summary_report">
{strip}
{if $pagecount > 1}
<p>
  {if $pagenum > 1}
    <a href="{$firstpage_url}" title="{$mod->Lang('lbl_goto_firstpage')}"><<</a> 
    <a href="{$prevpage_url}" title="{$mod->Lang('lbl_goto_prevpage')}"><</a> 
  {/if}
  {$mod->Lang('lbl_page')} {$pagenum} {$mod->Lang('lbl_of')} {$pagecount}
  {if $pagenum < $pagecount}
     <a href="{$nextpage_url}" title="{$mod->Lang('lbl_goto_nextpage')}">></a> 
    <a href="{$lastpage_url}" title="{$mod->Lang('lbl_goto_lastpage')}">>></a>
  {/if}
</p>
{* pagecount *}{/if}

{if isset($comments)}
{foreach from=$comments item='one'}
<div class="feedback_summary_item">
    <div class="feedback_item_title">
  <strong>    <a href="{$one.detail_url}" title="{$one.title}">{$one.title}</a></strong>
    </div>

 <div class="feedback_item_authorname">
  Date: {$one.created|cms_date_format}
    </div>

  {*  <div class="feedback_item_rating">
      {$mod->Lang('lbl_rating')}: {$one.rating}  
      {section name='rating' start=1 loop=6}
        {if $smarty.section.rating.index <= $one.rating}
          <img src="{$rating_imgs.img_on}" alt=""/>
        {else}
          <img src="{$rating_imgs.img_off}" alt=""/>
        {/if}
      {/section}
    </div>*}

    {if $one.author_name}
    <div class="feedback_item_authorname">
      {$mod->Lang('lbl_author_name')}: {$one.author_name}
    </div>
    {/if}

 {if $one.author_email}
    <div class="feedback_item_authoremail">
      {$mod->Lang('lbl_author_email')}: {$one.author_email}
    </div>
    {/if}

  {*  {if $one.author_ip}
    <div class="feedback_item_authorip">
      {$mod->Lang('lbl_author_ip')}: {$one.author_ip}
    </div>
    {/if} *}

    <div class="feedback_item_data">
       {$one.data|nl2br}
    </div>



    {if isset($one.fields)}    
      {foreach from=$one.fields key='name' item='field'}
      <div class="feedback_item_field">
        {$name}: {$field.value}
      </div>
      {/foreach}
    {/if}

    <br/><br/>
  </div>



{/foreach}
{* comments *}{/if}
{* feedback_summary_report *}</div>
{/strip}
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: CGFeedback textarea -- possible to display line returns?

Post by Wishbone »

Can you point me to a URL with feedback?

|nl2br should do it.. It takes new lines and replaces them with <br/> .. I wouldn't give users HTML editing ability.
twwitt
Forum Members
Forum Members
Posts: 149
Joined: Thu Aug 28, 2008 7:45 pm

Re: CGFeedback textarea -- possible to display line returns?

Post by twwitt »

Can you point me to a URL with feedback?
Here's URL: http://scsynod.com/index.php?mact=CGBlo ... eturnid=86

Note: The posts are in reverse order (it's what the client wanted)...the client has manually inserted hard returns from within the Feedback admin for all of the posts except for the last one at the bottom of the page -- I left that one as it appears as it normally would.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: CGFeedback textarea -- possible to display line returns?

Post by Wishbone »

Works for me.. I installed CGFeedback on a hidden page on one of my sites:

http://thecastironcompanion.ca/twwitt

You can add a comment if you like.

In the summary template, I show a before |nlbr and after, so you can see the difference. If you 'view source' you can see the new lines in the one without, but doesn't have the <br/>

Excerpt of summary template:

Code: Select all

<strong>With |nl2br:</strong><br/>
         {$one.data|nl2br}
<br/><br/>
<strong>Without |nl2br:</strong><br/>
         {$one.data}
CMSMS: 1.11.9
CGFeedback: 1.6.2
twwitt
Forum Members
Forum Members
Posts: 149
Joined: Thu Aug 28, 2008 7:45 pm

Re: CGFeedback textarea -- possible to display line returns?

Post by twwitt »

Weird...I now have the latest version of CGFeedbacka installed (thought that was the problem), and have {$one.data|nl2br} in the summary template, but still doesn't display properly...Oh well.

One more question: did you enable Allow use of the wysiwyg editor for comments? in the CGFeeback setting? I have that enabled...but if I disable it (which I don't prefer), and then choose yes for Allow commentor to include html in comments then the results display properly with line returns. Can't figure out why this would be true.

Guess I'll go with that solution, though it doesn't seem quite right.

Thanks for spending all the time trying to help me out!
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: CGFeedback textarea -- possible to display line returns?

Post by Wishbone »

twwitt wrote:Weird...I now have the latest version of CGFeedbacka installed (thought that was the problem), and have {$one.data|nl2br} in the summary template, but still doesn't display properly...Oh well.

One more question: did you enable Allow use of the wysiwyg editor for comments? in the CGFeeback setting? I have that enabled...but if I disable it (which I don't prefer), and then choose yes for Allow commentor to include html in comments then the results display properly with line returns. Can't figure out why this would be true.

Guess I'll go with that solution, though it doesn't seem quite right.

Thanks for spending all the time trying to help me out!
That is weird.. No I don't have any HTML option on.
twwitt
Forum Members
Forum Members
Posts: 149
Joined: Thu Aug 28, 2008 7:45 pm

Re: CGFeedback textarea -- possible to display line returns?

Post by twwitt »

Well, regardless, I'm going to mark this as SOLVED, since I believe you do have the correct solution...Just something screwy going on for me.

Thanks for spending all of the time helping...
Post Reply

Return to “Modules/Add-Ons”