Project page:
My solution is an answer to a long standing issue in Drupal core as explained on the project page:
https://drupal.org/sandbox/Mywebmaster/2118939
Git clone command:
git clone --branch 7.x-1.x Mywebmaster@git.drupal.org:sandbox/Mywebmaster/2118939.git field_html_trim
Functionality:
This module provides a neat solution for cutting off the text without taking any HTML tags into consideration. It uses a regular expression containing all the words of a trimmed textual representation of the field value to extract the wanted block of HTML.
This is a simple solution for anyone that just wants their teasers to have the same textual length regardless of any links, images or other tags that are in the field value. This module does not provide a way to cut off at the end of a sentence. It goes up to word level.
Similar projects:
There are multiple other solutions that try to provide a better trim method for D7. But they both always count the HTML unless tags are removed as well. Thats why my project deserves it's own place:
- Field word boundary: Field HTML trim also trims at word level.
- Smart trim: Allows for stripping HTML tags all together.
Simplytest.me:
If you would like to use simplytestme:
- http://simplytest.me/project/2118939
- Enable Field HTML Trim at /node#overlay=admin/structure/types/manage/article/display for the body field.
- Create some content with lot's of html and some content without html in the body field. Trim will be just the same.
Manual reviews of other projects
https://drupal.org/comment/8296039#comment-8296039
https://drupal.org/comment/8296105#comment-8296105
https://drupal.org/comment/7195422#comment-7195422
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Screenshot from 2013-10-30 16:57:58.png | 78.16 KB | alinouman |
Comments
Comment #1
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
softescu commentedFixed issues from pareview.sh
Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
FILE: /var/www/drupal-7-pareview/pareview_temp/README.txt
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 3 WARNING(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 85 characters
96 | WARNING | Line exceeds 80 characters; contains 97 characters
121 | WARNING | Line exceeds 80 characters; contains 98 characters
--------------------------------------------------------------------------------
Comment #3
alexverb commentedI cannot find any issues through the pareview.sh website or my local coder setup.
http://pareview.sh/pareview/httpgitdrupalorgsandboxmywebmaster2118939git
The only problem found is "File: @file block missing (Drupal Docs) [comment_docblock_file]". But this is rather a bug in the Coder module that only parses php files for @file blocks. https://drupal.org/node/1834598
So unless you can confirm this issue really comes from my README.txt I'm setting the status back to needs review.
Comment #4
alinouman commented1-Hi alex nice module, i find a bug with your module using views. when i give trim length 5 in manage display. On the views side it still shows 600 and views output is 5 they should be interdependent.
2- And u should be using #ajax states api rather checking using raw javascript in settings form.
Comment #5
alexverb commented1- Thx. I haven't looked at the views integration yet. I will digg in to that first. I'm setting the status to Postponed until I've figured this one out.
2- I tried using the #states api first. But it presented some buggy behaviour within the formatter settings. Do you have knowledge of any other modules that are using #states within the formatter settings form through the field_formatter_settings module? Would be great to have a working example to go off. If not I'm going to leave this as is, because I don't want to spend ages on figuring out what might be a core bug.
Comment #5.0
alexverb commentedAdded simplytestme link
Comment #6
alexverb commented@alinouman:
1-The view field settings weren't actually being used in the field formatter settings. This has been fixed.
Aside from that I've also removed a bug that caused the regular expression to end at newlines.
Comment #7
anemirovsky commentedhttp://pareview.sh/ came up clean.
Took a look a the code and it seems to be using the API well. No security vulnerabilities from what I can see.
Tried the module out on simplytest.me and it works well. Nice work!
Comment #8
alexverb commentedThis module has been in the application queue with status "Reviewed & tested by the community" for almost a month now. Is there anyone willing to give me full project access or at least promote this module to a full project?
I would like to contribute some other interesting sandbox modules to the community:
As long as these projects remain in sandbox I don't get the benefits of people submitting bug reports or feature requests. And these projects will not be able to grow.
I don't want to come accross impatient but I feel like I cannot do much more to give my contributions back to the community. So I'm changing the priority to critical in the hope somebody will help me out before I give up.
Comment #9
PA robot commentedProject 1: https://drupal.org/node/2147579
Project 2: https://drupal.org/node/2118995
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #10
alexverb commentedComment #11
alexverb commentedComment #12
alexverb commentedComment #13
alexverb commentedComment #14
klausiRemoving review bonus tag, you did not provide any feedback on the source code of the projects, you just repeated what the automated bot already told them or pointed them to. And please review applications in the "needs review" state, applications in "needs work" are blocked already and need a response from the applicant anyway.
Comment #15
alexverb commentedAllright, nevermind. I'll bury my efforts in the sandbox.
Comment #16
alexverb commentedTried to put some more effort into these reviews. Hope they suffice.
https://drupal.org/comment/8296039#comment-8296039
https://drupal.org/comment/8296105#comment-8296105
https://drupal.org/comment/7195422#comment-7195422
Comment #17
kscheirerLooks nice, this is definitely a problem for any site wanting significant text manipulation!
Thanks for your contribution, alexverb!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
----
Top Shelf Modules - Crafted, Curated, Contributed.