Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Limit character length for new blurbs, etc.

edited January 2017 in Feature Requests
I'm displaying some blog blurbs on the home page of a website I'm working on... I am just displaying the TITLE and a Read More link, but I want to limit the number of characters of the TITLE. If anyone could help, or provide some insight I would appreciate it. Thanks in advance.

Comments

  • edited 8:40AM
    You could try using the word_limiter or char_limiter functions from CodeIgniter:
    https://codeigniter.com/user_guide/helpers/text_helper.html
  • edited 8:40AM
    I'm not that savvy with PHP, but I'm fairly capable of manipulating FUEL. Do I add the CI scripts to the helper file? Or do I add it directly to the page I want the blurb to show up on. I'm not 100% clear on this probably because I'm a designer before coder. Hmmmm?
  • edited 8:40AM
    If it is a blog post object, you may be able to use one of the built in magic methods in the template:
    $post->title_excerpt(15)
  • edited 8:40AM
    thank you. had to add ' ' around the number but worked.

    $post->title_excerpt('50')
Sign In or Register to comment.