Right now PhpFox is limited to 500 characters on the intro field for the announcement plugin. I would like to increase this. Does anyone know what file to edit to increase the character limit?

Thank you!

Topics: announcements
Last update on November 19, 2020 by Amanda Brai.
Be the first person to like this.
JohnJr

Hello Amanda,

This hack will be written over during any upgrade so first make a backup copy of this file in case you decide it does not fit needs.  Then make another copy with code since during update the original file will be over written and you will lose this code.    Like add.html.php, add.html.CODE.php and add.html_ORG.php

File:  PF.Site/Apps/core-announcement/views/controller/admincp/add.html.php

at about line 31 it says Field Intro and within the calls there are two things to look at.  First is the amount of rows (currently it is set a 5 rows of information to show).  Then right after that it says maxlength=500 which is what I think you are looking.  You also might have to change the phrase for "maximum_is_number_characters" to your new character count for members to see if they have permission to add announcements.

I will post the code in the next post since I think there are issue with the forum and posting code.

Last update on November 20, 2020 by JohnJr.
Be the first person to like this.
JohnJr

                <!-- Field Intro -->                 <div class="form-group">                     {field_language phrase='intro_var' label='intro' field='intro' format='val[intro_' type='textarea' rows=5 maxlength=500 required=true}                     <p class="help-block">{_p var='maximum_is_number_characters' number=500}</p>                 </div>

Be the first person to like this.

That the aggravating part to this, I have already changed that file, I do have a good amount of coding knowledge to track things down, but when I make changes and nothing changes even after clearing cache on site and browser. That's when I start using the real language of coding, PROFANITY. I just went ahead and put 5000 and it seems to have changed everything but the view on the site. When the announcement pops up on my site it still shows words being cut off and haven't to click on the actual announcement to view it. The change shows the end of the text being... and that's it. So fixing it on the backend is done, but fixing it on the front it; not.

Thanks for the help!

Be the first person to like this.

Be the first person to like this.

I even removed the original announcement and made a new to see if it would force the changes, no go.

Be the first person to like this.
JohnJr

Sorry, it looked simple, and that sounds weird.  Will mess around with it today.

Please do, we have been fighting with it for over a week.  It changed it in admin but not the actual app. I changed my to 5000 and it reflects it here, but not on the front end and I couldn't find anything in block or controller anywhere else.

Be the first person to like this.
JohnJr

Ok, on the bottom of the file there is also this.

{literal}

<script>

    $Behavior.init_add_announcement = function () {

        var $intro = $('textarea[id^=intro]');

        if ($intro.length) {

            $intro.prop('maxlength', 500);

        }

    }

</script>

{/literal}

 


I would assume there is CSS to change as well since most likely overflow is hidden.  He you need help with that as well let me know.  Also, I noticed before I found this new code that in the database for intro_var and content_var is set a varchar(255) which I would assume would also affect it.  Good luck and let me know.

Last update on November 20, 2020 by JohnJr.

John I owe you a beer or striper or both! I did not even think about the css and that was the problem. On bootstrap.css for me is 37306

.announcement-slider
.item .core-announcement-item
.item-inner .item-desc

there is a hidden overflow. I knew about the the code at the bottom and changed that with no result. But the second I turned off the overflow, winner winner chicken dinner.

THANK YOU!!!

JohnJr

A beer, a striper, and warm weather...sound like paradise :)

Be the first person to like this.